From 91bfc71261e160451e89f35a7c0eef66ff98877c Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Thu, 22 Sep 2022 12:11:48 +0300 Subject: A big rework, just what you were secretly hoping for! SD upscale moved to scripts Batch processing script removed Batch processing added to main img2img and now works with scripts img2img page UI reworked to use tabs --- modules/extras.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'modules/extras.py') diff --git a/modules/extras.py b/modules/extras.py index 96bd2118..92569cff 100644 --- a/modules/extras.py +++ b/modules/extras.py @@ -15,30 +15,22 @@ import piexif.helper cached_images = {} -def run_extras(image, image_folder, gfpgan_visibility, codeformer_visibility, codeformer_weight, upscaling_resize, extras_upscaler_1, extras_upscaler_2, extras_upscaler_2_visibility): +def run_extras(extras_mode, image, image_folder, gfpgan_visibility, codeformer_visibility, codeformer_weight, upscaling_resize, extras_upscaler_1, extras_upscaler_2, extras_upscaler_2_visibility): devices.torch_gc() imageArr = [] # Also keep track of original file names imageNameArr = [] - if image_folder is not None: - if image is not None: - print("Batch detected and single image detected, please only use one of the two. Aborting.") - return None + if extras_mode == 1: #convert file to pillow image for img in image_folder: image = Image.fromarray(np.array(Image.open(img))) imageArr.append(image) imageNameArr.append(os.path.splitext(img.orig_name)[0]) - - elif image is not None: - if image_folder is not None: - print("Batch detected and single image detected, please only use one of the two. Aborting.") - return None - else: - imageArr.append(image) - imageNameArr.append(None) + else: + imageArr.append(image) + imageNameArr.append(None) outpath = opts.outdir_samples or opts.outdir_extras_samples -- cgit v1.2.1