This commit is contained in:
Liam 2022-09-25 16:09:43 -04:00 committed by AUTOMATIC1111
parent ca3e5519e8
commit db4ab47f09

View File

@ -978,18 +978,21 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
outputs=[result, text_settings], outputs=[result, text_settings],
) )
paste_field_names = ['Prompt', 'Negative prompt', 'Steps', 'Face restoration', 'Seed', 'Size-1', 'Size-2']
txt2img_fields = [field for field,name in txt2img_paste_fields if name in paste_field_names]
img2img_fields = [field for field,name in img2img_paste_fields if name in paste_field_names]
send_to_img2img.click( send_to_img2img.click(
fn=lambda x: (image_from_url_text(x)), fn=lambda img, *args: (image_from_url_text(img),*args),
_js="extract_image_from_gallery_img2img", _js="(gallery, ...args) => [extract_image_from_gallery_img2img(gallery), ...args]",
inputs=[txt2img_gallery], inputs=[txt2img_gallery] + txt2img_fields,
outputs=[init_img], outputs=[init_img] + img2img_fields,
) )
send_to_inpaint.click( send_to_inpaint.click(
fn=lambda x: (image_from_url_text(x)), fn=lambda x, *args: (image_from_url_text(x), *args),
_js="extract_image_from_gallery_inpaint", _js="(gallery, ...args) => [extract_image_from_gallery_inpaint(gallery), ...args]",
inputs=[txt2img_gallery], inputs=[txt2img_gallery] + txt2img_fields,
outputs=[init_img_with_mask], outputs=[init_img_with_mask] + img2img_fields,
) )
img2img_send_to_img2img.click( img2img_send_to_img2img.click(