Skip to content

Commit

Permalink
remove legacy restore resolution
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Mandic <[email protected]>
  • Loading branch information
vladmandic committed Jan 5, 2025
1 parent 702d887 commit 17760cf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions modules/generation_parameters_copypaste.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ def connect_paste_params_buttons():
if binding.tabname not in paste_fields:
debug(f"Not not registered: tab={binding.tabname}")
continue
"""
# legacy code that sets width/height based on image itself instead of metadata
destination_image_component = paste_fields[binding.tabname]["init_img"]
fields = paste_fields[binding.tabname]["fields"]
override_settings_component = binding.override_settings_component or paste_fields[binding.tabname]["override_settings_component"]
destination_width_component = next(iter([field for field, name in fields if name == "Size-1"] if fields else []), None)
destination_height_component = next(iter([field for field, name in fields if name == "Size-2"] if fields else []), None)

if binding.source_image_component and destination_image_component:
if isinstance(binding.source_image_component, gr.Gallery):
func = send_image_and_dimensions if destination_width_component else image_from_url_text
Expand All @@ -142,6 +141,9 @@ def connect_paste_params_buttons():
outputs=[destination_image_component, destination_width_component, destination_height_component] if destination_width_component else [destination_image_component],
show_progress=False,
)
"""
fields = paste_fields[binding.tabname]["fields"]
override_settings_component = binding.override_settings_component or paste_fields[binding.tabname]["override_settings_component"]
if binding.source_text_component is not None and fields is not None:
connect_paste(binding.paste_button, fields, binding.source_text_component, override_settings_component, binding.tabname)
if binding.source_tabname is not None and fields is not None and binding.source_tabname in paste_fields:
Expand Down
2 changes: 1 addition & 1 deletion modules/infotext.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def parse(infotext):
params[f"{key}-2"] = int(size.group(2))
elif isinstance(params[key], str):
params[key] = val
debug(f'Param parsed: type={type(params[key])} {key}={params[key]} raw="{val}"')
debug(f'Param parsed: type={type(params[key])} "{key}"={params[key]} raw="{val}"')

# check_lora(params)
return params
Expand Down
1 change: 0 additions & 1 deletion modules/processing_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:t
debug_log(f'Diffusers task args: {task_args}')
for k, v in task_args.items():
if k in possible:
print('HERE OVERRIDE', k, v)
args[k] = v
else:
debug_log(f'Diffusers unknown task args: {k}={v}')
Expand Down
4 changes: 2 additions & 2 deletions modules/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,8 @@ def get_default_modes():
"return_mask": OptionInfo(False, "Inpainting include greyscale mask in results"),
"return_mask_composite": OptionInfo(False, "Inpainting include masked composite in results"),
"disable_weights_auto_swap": OptionInfo(True, "Do not change selected model when reading generation parameters"),
"send_seed": OptionInfo(True, "Send seed when sending prompt or image to other interface"),
"send_size": OptionInfo(True, "Send size when sending prompt or image to another interface"),
"send_seed": OptionInfo(True, "Send seed when sending prompt or image to other interface", gr.Checkbox, {"visible": False}),
"send_size": OptionInfo(False, "Send size when sending prompt or image to another interface", gr.Checkbox, {"visible": False}),
"quicksettings_list": OptionInfo(["sd_model_checkpoint"], "Quicksettings list", gr.Dropdown, lambda: {"multiselect":True, "choices": list(opts.data_labels.keys())}),
}))

Expand Down
7 changes: 5 additions & 2 deletions modules/ui_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,13 +658,16 @@ def create_ui(_blocks: gr.Blocks=None):
# second pass
(enable_hr, "Second pass"),
(enable_hr, "Refine"),
(hr_sampler_index, "Hires sampler"),
(denoising_strength, "Hires strength"),
(denoising_strength, "Denoising strength"),
(denoising_strength, "Hires strength"),
(hr_sampler_index, "Hires sampler"),
(hr_resize_mode, "Hires mode"),
(hr_resize_context, "Hires context"),
(hr_upscaler, "Hires upscaler"),
(hr_force, "Hires force"),
(hr_second_pass_steps, "Hires steps"),
(hr_scale, "Hires upscale"),
(hr_scale, "Hires scale"),
(hr_resize_x, "Hires fixed-1"),
(hr_resize_y, "Hires fixed-2"),
# refiner
Expand Down

0 comments on commit 17760cf

Please sign in to comment.