aboutsummaryrefslogtreecommitdiff
path: root/modules/postprocessing.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-04-29 11:58:54 +0300
committerGitHub <noreply@github.com>2023-04-29 11:58:54 +0300
commitf54cd3f1586ec8d20ffcaff184ba2e680bb8cb8b (patch)
tree7af57d3994e5db508c89f43858a67aefd917450b /modules/postprocessing.py
parent7fb72edaffd3d4f2336d2478a424fc455f2376a6 (diff)
parente55cb92067094564c259b515b8a6ec3869654083 (diff)
Merge branch 'dev' into torch
Diffstat (limited to 'modules/postprocessing.py')
-rw-r--r--modules/postprocessing.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/postprocessing.py b/modules/postprocessing.py
index 09d8e605..4dc1a2ab 100644
--- a/modules/postprocessing.py
+++ b/modules/postprocessing.py
@@ -18,9 +18,15 @@ def run_postprocessing(extras_mode, image, image_folder, input_dir, output_dir,
if extras_mode == 1:
for img in image_folder:
- image = Image.open(img)
+ 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'