hide limit target resolution under option

This commit is contained in:
Andray 2024-03-17 14:51:19 +04:00
parent 06c5dd0907
commit 81be357925
2 changed files with 6 additions and 2 deletions

View File

@ -102,6 +102,7 @@ options_templates.update(options_section(('upscaling', "Upscaling", "postprocess
"DAT_tile_overlap": OptionInfo(8, "Tile overlap for DAT upscalers.", gr.Slider, {"minimum": 0, "maximum": 48, "step": 1}).info("Low values = visible seam"),
"upscaler_for_img2img": OptionInfo(None, "Upscaler for img2img", gr.Dropdown, lambda: {"choices": [x.name for x in shared.sd_upscalers]}),
"set_scale_by_when_changing_upscaler": OptionInfo(False, "Automatically set the Scale by factor based on the name of the selected Upscaler."),
"show_limit_target_resolution_in_extras_upscale": OptionInfo(False, 'Show "Limit target resolution" slider in "Upscale" extras script. Useful for batches where can be big images.'),
}))
options_templates.update(options_section(('face-restoration', "Face restoration", "postprocessing"), {

View File

@ -44,8 +44,11 @@ class ScriptPostprocessingUpscale(scripts_postprocessing.ScriptPostprocessing):
with gr.Tabs(elem_id="extras_resize_mode"):
with gr.TabItem('Scale by', elem_id="extras_scale_by_tab") as tab_scale_by:
upscaling_resize = gr.Slider(minimum=1.0, maximum=8.0, step=0.05, label="Resize", value=4, elem_id="extras_upscaling_resize")
limit_target_resolution = gr.Slider(minimum=0, maximum=10000, step=8, label="Limit target resolution", value=0, elem_id="extras_upscale_limit_target_resolution",
tooltip="0 = no limit. Limit target resolution by one demension. Useful for batches where can be big images.")
if shared.opts.show_limit_target_resolution_in_extras_upscale:
limit_target_resolution = gr.Slider(minimum=0, maximum=10000, step=8, label="Limit target resolution", value=8000, elem_id="extras_upscale_limit_target_resolution",
tooltip="0 = no limit. Limit target resolution by one demension. Useful for batches where can be big images.")
else:
limit_target_resolution = gr.Number(0, visible=False)
with gr.TabItem('Scale to', elem_id="extras_scale_to_tab") as tab_scale_to:
with FormRow():