mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
index
This commit is contained in:
parent
1c9fe22fd3
commit
d38c616681
@ -384,6 +384,7 @@ options_templates.update(
|
||||
"sd_webui_modal_lightbox_toolbar_opacity": OptionInfo(0.9, "[Lightbox]: tool bar opacity", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.05}, onchange=shared.reload_gradio_theme).info("for mouse only").needs_reload_ui(),
|
||||
"open_dir_button_choice": OptionInfo("Subdirectory", "What directory the [📂] button opens", gr.Radio, {"choices": ("Output Root", "Subdirectory", "Subdirectory (even temp dir)")}),
|
||||
"hires_button_gallery_insert": OptionInfo(False, "When using the [✨] button, insert the upscaled image to the gallery").info("otherwise replace the selected image in the gallery"),
|
||||
"hires_insert_index": OptionInfo(True, "When the above option is enabled, automatically select the upscaled image").info("otherwise select the original image"),
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
@ -111,14 +111,15 @@ def txt2img_upscale_function(id_task: str, request: gr.Request, gallery, gallery
|
||||
if i == gallery_index:
|
||||
new_gallery.extend(processed.images)
|
||||
|
||||
new_index = gallery_index
|
||||
if insert:
|
||||
new_index += 1
|
||||
new_index = gallery_index + 1
|
||||
geninfo["infotexts"].insert(new_index, processed.info)
|
||||
if not getattr(shared.opts, "hires_insert_index", True):
|
||||
gallery_index -= 1
|
||||
else:
|
||||
geninfo["infotexts"][gallery_index] = processed.info
|
||||
|
||||
return new_gallery, json.dumps(geninfo), plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
|
||||
return gr.update(value=new_gallery, selected_index=gallery_index), json.dumps(geninfo), plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
|
||||
|
||||
|
||||
def txt2img_function(id_task: str, request: gr.Request, *args):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user