From 56bea579ccf66cc04239a1ad89cabbb5ff28f472 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 17 Jul 2024 22:58:16 +0200 Subject: [PATCH] fix: change metadata input from image to file allow metadata reading from jpeg and webp again see https://github.com/mashb1t/Fooocus/discussions/56#discussioncomment-10077227 --- webui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webui.py b/webui.py index 2eb0f609..07d6c0ec 100644 --- a/webui.py +++ b/webui.py @@ -339,12 +339,13 @@ with shared.gradio_root: with gr.TabItem(label='Metadata') as metadata_tab: with gr.Column(): - metadata_input_image = grh.Image(label='For images created by Fooocus', source='upload', type='filepath') + metadata_input_image = gr.File(label='For images created by Fooocus', source='upload', file_types=['image']) + # metadata_input_image = grh.Image(label='For images created by Fooocus', source='upload', type='filepath') metadata_json = gr.JSON(label='Metadata') metadata_import_button = gr.Button(value='Apply Metadata') - def trigger_metadata_preview(filepath): - parameters, metadata_scheme = modules.meta_parser.read_info_from_image(filepath) + def trigger_metadata_preview(file): + parameters, metadata_scheme = modules.meta_parser.read_info_from_image(file.name) results = {} if parameters is not None: