From 5b636b31052e728d92656c4f066e206969c96daa Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Sun, 17 Dec 2023 00:43:18 -0700 Subject: [PATCH] Make extras work again Not all postprocessing scripts work --- modules/postprocessing.py | 3 +++ modules/ui_postprocessing.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/postprocessing.py b/modules/postprocessing.py index 3c85a74c1..2cf4dda08 100644 --- a/modules/postprocessing.py +++ b/modules/postprocessing.py @@ -12,6 +12,9 @@ def run_postprocessing(id_task, extras_mode, image, image_folder, input_dir, out shared.state.begin(job="extras") outputs = [] + + if isinstance(image, dict): + image = image["composite"] def get_images(extras_mode, image, image_folder, input_dir): if extras_mode == 1: diff --git a/modules/ui_postprocessing.py b/modules/ui_postprocessing.py index fbad0800a..ae245d5e1 100644 --- a/modules/ui_postprocessing.py +++ b/modules/ui_postprocessing.py @@ -4,14 +4,14 @@ import modules.generation_parameters_copypaste as parameters_copypaste def create_ui(): - dummy_component = gr.Label(visible=False) + dummy_component = gr.Textbox(visible=False) tab_index = gr.State(value=0) with gr.Row(equal_height=False, variant='compact'): with gr.Column(variant='compact'): with gr.Tabs(elem_id="mode_extras"): with gr.TabItem('Single Image', id="single_image", elem_id="extras_single_tab") as tab_single: - extras_image = gr.Image(label="Source", source="upload", interactive=True, type="pil", elem_id="extras_image") + extras_image = gr.ImageEditor(label="Source", interactive=True, type="pil", elem_id="extras_image") with gr.TabItem('Batch Process', id="batch_process", elem_id="extras_batch_process_tab") as tab_batch: image_batch = gr.Files(label="Batch Process", interactive=True, elem_id="extras_image_batch")