diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-22 09:11:48 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-22 09:11:48 +0000 |
commit | 91bfc71261e160451e89f35a7c0eef66ff98877c (patch) | |
tree | 1d06de00a8c94527f572c801bbfa2eefb24fb58e /modules/extras.py | |
parent | e235d4e691e81cc3628da762b3f4ace936a44036 (diff) | |
download | stable-diffusion-webui-gfx803-91bfc71261e160451e89f35a7c0eef66ff98877c.tar.gz stable-diffusion-webui-gfx803-91bfc71261e160451e89f35a7c0eef66ff98877c.tar.bz2 stable-diffusion-webui-gfx803-91bfc71261e160451e89f35a7c0eef66ff98877c.zip |
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
Diffstat (limited to 'modules/extras.py')
-rw-r--r-- | modules/extras.py | 18 |
1 files changed, 5 insertions, 13 deletions
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
|