From b856a91ec83757803fa7fd750abe4f036c9a7f7a Mon Sep 17 00:00:00 2001 From: hlky <106811348+hlky@users.noreply.github.com> Date: Fri, 16 Sep 2022 20:55:58 +0100 Subject: [PATCH] allow webp uploads to img2img tab #991 --- scripts/img2img.py | 4 ++-- scripts/imglab.py | 2 +- scripts/txt2vid.py | 2 +- scripts/webui_streamlit_old.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/img2img.py b/scripts/img2img.py index a2c0744..32988e2 100644 --- a/scripts/img2img.py +++ b/scripts/img2img.py @@ -483,7 +483,7 @@ def layout(): image_holder = st.empty() uploaded_images = st.file_uploader( - "Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg"], + "Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg", "webp"], help="Upload an image which will be used for the image to image generation.", ) if uploaded_images: @@ -494,7 +494,7 @@ def layout(): mask_holder = st.empty() uploaded_masks = st.file_uploader( - "Upload Mask", accept_multiple_files=False, type=["png", "jpg", "jpeg"], + "Upload Mask", accept_multiple_files=False, type=["png", "jpg", "jpeg", "webp"], help="Upload an mask image which will be used for masking the image to image generation.", ) if uploaded_masks: diff --git a/scripts/imglab.py b/scripts/imglab.py index 99ed2e2..eb09c6a 100644 --- a/scripts/imglab.py +++ b/scripts/imglab.py @@ -149,7 +149,7 @@ def layout(): col1, col2 = st.columns(2) with col1: - st.session_state['uploaded_file'] = st.file_uploader("Choose an image or images", type=["png", "jpg", "jpeg"],accept_multiple_files=True,on_change=changeImage) + st.session_state['uploaded_file'] = st.file_uploader("Choose an image or images", type=["png", "jpg", "jpeg", "webp"],accept_multiple_files=True,on_change=changeImage) if 'previewImg' not in st.session_state: st.session_state['previewImg'] = st.empty() else: diff --git a/scripts/txt2vid.py b/scripts/txt2vid.py index 3db00a9..71f3cbd 100644 --- a/scripts/txt2vid.py +++ b/scripts/txt2vid.py @@ -548,7 +548,7 @@ def layout(): height = st.slider("Height:", min_value=64, max_value=2048, value=st.session_state['defaults'].txt2vid.height, step=64) cfg_scale = st.slider("CFG (Classifier Free Guidance Scale):", min_value=1.0, max_value=30.0, value=st.session_state['defaults'].txt2vid.cfg_scale, step=0.5, help="How strongly the image should follow the prompt.") - #uploaded_images = st.file_uploader("Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg"], + #uploaded_images = st.file_uploader("Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg", "webp"], #help="Upload an image which will be used for the image to image generation.") seed = st.text_input("Seed:", value=st.session_state['defaults'].txt2vid.seed, help=" The seed to use, if left blank a random seed will be generated.") #batch_count = st.slider("Batch count.", min_value=1, max_value=100, value=st.session_state['defaults'].txt2vid.batch_count, step=1, help="How many iterations or batches of images to generate in total.") diff --git a/scripts/webui_streamlit_old.py b/scripts/webui_streamlit_old.py index 372427f..ad1b9da 100644 --- a/scripts/webui_streamlit_old.py +++ b/scripts/webui_streamlit_old.py @@ -2432,7 +2432,7 @@ def layout(): image_holder = st.empty() uploaded_images = st.file_uploader( - "Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg"], + "Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg", "webp"], help="Upload an image which will be used for the image to image generation.", ) if uploaded_images: @@ -2443,7 +2443,7 @@ def layout(): mask_holder = st.empty() uploaded_masks = st.file_uploader( - "Upload Mask", accept_multiple_files=False, type=["png", "jpg", "jpeg"], + "Upload Mask", accept_multiple_files=False, type=["png", "jpg", "jpeg", "webp"], help="Upload an mask image which will be used for masking the image to image generation.", ) if uploaded_masks: