diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-04-29 06:17:35 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-04-29 06:17:35 +0000 |
commit | 101a18fc8466577501b57eac6a4b5d07351c9ec6 (patch) | |
tree | 468875ffb7b0c673b31e2413aa7f614349342d19 /modules/api/api.py | |
parent | 22bcc7be428c94e9408f589966c2040187245d81 (diff) | |
download | stable-diffusion-webui-gfx803-101a18fc8466577501b57eac6a4b5d07351c9ec6.tar.gz stable-diffusion-webui-gfx803-101a18fc8466577501b57eac6a4b5d07351c9ec6.tar.bz2 stable-diffusion-webui-gfx803-101a18fc8466577501b57eac6a4b5d07351c9ec6.zip |
bump gradio to 3.27
Diffstat (limited to 'modules/api/api.py')
-rw-r--r-- | modules/api/api.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/api/api.py b/modules/api/api.py index 518b2a61..5ed670e9 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -6,7 +6,6 @@ import uvicorn import gradio as gr from threading import Lock from io import BytesIO -from gradio.processing_utils import decode_base64_to_file from fastapi import APIRouter, Depends, FastAPI, Request, Response from fastapi.security import HTTPBasic, HTTPBasicCredentials from fastapi.exceptions import HTTPException @@ -395,16 +394,11 @@ class Api: def extras_batch_images_api(self, req: ExtrasBatchImagesRequest): reqDict = setUpscalers(req) - def prepareFiles(file): - file = decode_base64_to_file(file.data, file_path=file.name) - file.orig_name = file.name - return file - - reqDict['image_folder'] = list(map(prepareFiles, reqDict['imageList'])) - reqDict.pop('imageList') + image_list = reqDict.pop('imageList', []) + image_folder = [decode_base64_to_image(x.data) for x in image_list] with self.queue_lock: - result = postprocessing.run_extras(extras_mode=1, image="", input_dir="", output_dir="", save_output=False, **reqDict) + result = postprocessing.run_extras(extras_mode=1, image_folder=image_folder, image="", input_dir="", output_dir="", save_output=False, **reqDict) return ExtrasBatchImagesResponse(images=list(map(encode_pil_to_base64, result[0])), html_info=result[1]) |