Skip to content

Commit

Permalink
block some settings from extra_options for txt2img/img2img (AUTOMATIC…
Browse files Browse the repository at this point in the history
…1111#2218)

There are various negative effects if these settings are allowed in the extra options for txt2img or img2img. This PR removes them from the extra_options lists at load time.

'sd_model_checkpoint' and 'CLIP_stop_at_last_layers' will invisibly override main UI settings, leading to confusing behaviour
'sd_vae' doesn't seem harmful, but can create an empty block in the UI section
'forge_additional_modules' causes an error that prevents the UI from loading
  • Loading branch information
DenOfEquity authored Oct 30, 2024
1 parent 077933d commit ecd4d28
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def ui(self, is_img2img):
extra_options = shared.opts.extra_options_img2img if is_img2img else shared.opts.extra_options_txt2img
elem_id_tabname = "extra_options_" + ("img2img" if is_img2img else "txt2img")

not_allowed = ['sd_model_checkpoint', 'sd_vae', 'CLIP_stop_at_last_layers', 'forge_additional_modules']
for na in not_allowed:
if na in extra_options:
extra_options.remove(na)

mapping = {k: v for v, k in infotext_utils.infotext_to_setting_name_mapping}

with gr.Blocks() as interface:
Expand Down

0 comments on commit ecd4d28

Please sign in to comment.