aboutsummaryrefslogtreecommitdiff
path: root/modules/extras.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/extras.py')
-rw-r--r--modules/extras.py18
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