mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
refactor: convert XYZ grid detailer option to boolean dropdown
- Change AxisOption type from str to bool with [False, True] choices - Simplify apply_detailer() to accept bool directly - Fix log message from "face-restore" to "detailer"
This commit is contained in:
@@ -246,7 +246,7 @@ axis_options = [
|
||||
AxisOption("[Refine] Refiner steps", float, apply_field("refiner_steps")),
|
||||
AxisOption("[Postprocess] Upscaler", str, apply_upscaler, cost=0.4, choices=lambda: [x.name for x in shared.sd_upscalers]),
|
||||
AxisOption("[Postprocess] Context", str, apply_context, choices=lambda: ["Add with forward", "Remove with forward", "Add with backward", "Remove with backward"]),
|
||||
AxisOption("[Postprocess] Detailer", str, apply_detailer, fmt=format_value_add_label),
|
||||
AxisOption("[Postprocess] Detailer", bool, apply_detailer, fmt=format_bool, choices=lambda: [False, True]),
|
||||
AxisOption("[Postprocess] Detailer strength", str, apply_field("detailer_strength")),
|
||||
AxisOption("[Quant] SDNQ quant mode", str, apply_sdnq_quant, cost=0.9, fmt=format_value_add_label, choices=lambda: ['none'] + sorted(shared.sdnq_quant_modes)),
|
||||
AxisOption("[Quant] SDNQ quant mode TE", str, apply_sdnq_quant_te, cost=0.9, fmt=format_value_add_label, choices=lambda: ['none'] + sorted(shared.sdnq_quant_modes)),
|
||||
|
||||
@@ -284,10 +284,8 @@ def apply_context(p: processing.StableDiffusionProcessingTxt2Img, opt, x):
|
||||
|
||||
|
||||
def apply_detailer(p, opt, x):
|
||||
opt = opt.lower()
|
||||
is_active = opt in ('true', 'yes', 'y', '1')
|
||||
p.detailer_enabled = is_active
|
||||
shared.log.debug(f'XYZ grid apply face-restore: "{x}"')
|
||||
p.detailer_enabled = bool(opt)
|
||||
shared.log.debug(f'XYZ grid apply detailer: "{x}"')
|
||||
|
||||
|
||||
def apply_control(field):
|
||||
|
||||
Reference in New Issue
Block a user