diff options
Diffstat (limited to 'modules/postprocessing.py')
-rw-r--r-- | modules/postprocessing.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/postprocessing.py b/modules/postprocessing.py index c27ad8db..9cb80957 100644 --- a/modules/postprocessing.py +++ b/modules/postprocessing.py @@ -20,9 +20,15 @@ def run_postprocessing(extras_mode, image, image_folder: List[tempfile.NamedTemp if extras_mode == 1:
for img in image_folder:
- image = Image.open(os.path.abspath(img.name))
+ if isinstance(img, Image.Image):
+ image = img
+ fn = ''
+ else:
+ image = Image.open(os.path.abspath(img.name))
+ fn = os.path.splitext(img.orig_name)[0]
+
image_data.append(image)
- image_names.append(os.path.splitext(img.orig_name)[0])
+ image_names.append(fn)
elif extras_mode == 2:
assert not shared.cmd_opts.hide_ui_dir_config, '--hide-ui-dir-config option must be disabled'
assert input_dir, 'input directory not selected'
|