This commit is contained in:
Haoming 2025-09-01 15:22:10 +08:00
parent b07c0bac97
commit 4f736641c6
2 changed files with 17 additions and 3 deletions

View File

@ -256,7 +256,14 @@ def img2img_function(id_task: str, request: gr.Request, mode: int, prompt: str,
if opts.do_not_show_images:
processed.images = []
return processed.images + processed.extra_images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
if processed.video_path is None:
gallery_arg = gr.update(value=processed.images + processed.extra_images, visible=True)
video_arg = gr.update(value=None, visible=False)
else:
gallery_arg = gr.update(value=None, visible=False)
video_arg = gr.update(value=processed.video_path, visible=True)
return gallery_arg, video_arg, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
def img2img(id_task: str, request: gr.Request, mode: int, prompt: str, negative_prompt: str, prompt_styles, init_img, sketch, sketch_fg, init_img_with_mask, init_img_with_mask_fg, inpaint_color_sketch, inpaint_color_sketch_fg, init_img_inpaint, init_mask_inpaint, mask_blur: int, mask_alpha: float, inpainting_fill: int, n_iter: int, batch_size: int, cfg_scale: float, distilled_cfg_scale: float, image_cfg_scale: float, denoising_strength: float, selected_scale_tab: int, height: int, width: int, scale_by: float, resize_mode: int, inpaint_full_res: bool, inpaint_full_res_padding: int, inpainting_mask_invert: int, img2img_batch_input_dir: str, img2img_batch_output_dir: str, img2img_batch_inpaint_mask_dir: str, override_settings_texts, img2img_batch_use_png_info: bool, img2img_batch_png_info_props: list, img2img_batch_png_info_dir: str, img2img_batch_source_type: str, img2img_batch_upload: list, *args):

View File

@ -110,7 +110,7 @@ def txt2img_upscale_function(id_task: str, request: gr.Request, gallery, gallery
new_gallery.append(image)
if i == gallery_index:
new_gallery.extend(processed.images)
new_index = gallery_index
if insert:
new_index += 1
@ -139,7 +139,14 @@ def txt2img_function(id_task: str, request: gr.Request, *args):
if opts.do_not_show_images:
processed.images = []
return processed.images + processed.extra_images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
if processed.video_path is None:
gallery_arg = gr.update(value=processed.images + processed.extra_images, visible=True)
video_arg = gr.update(value=None, visible=False)
else:
gallery_arg = gr.update(value=None, visible=False)
video_arg = gr.update(value=processed.video_path, visible=True)
return gallery_arg, video_arg, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
def txt2img_upscale(id_task: str, request: gr.Request, gallery, gallery_index, generation_info, *args):