diff options
author | Ilya Khadykin <mageofit@gmail.com> | 2023-04-09 19:33:09 +0000 |
---|---|---|
committer | Ilya Khadykin <mageofit@gmail.com> | 2023-04-09 19:33:09 +0000 |
commit | c19618f37059b425b1e53429ad8def2caa78cdec (patch) | |
tree | d939eb2045431f2cb6103e81c526046663ffba39 /modules/postprocessing.py | |
parent | 22bcc7be428c94e9408f589966c2040187245d81 (diff) | |
download | stable-diffusion-webui-gfx803-c19618f37059b425b1e53429ad8def2caa78cdec.tar.gz stable-diffusion-webui-gfx803-c19618f37059b425b1e53429ad8def2caa78cdec.tar.bz2 stable-diffusion-webui-gfx803-c19618f37059b425b1e53429ad8def2caa78cdec.zip |
fix(extras): fix batch image processing on 'Extras\Batch Process' tab
This change fixes an issue where an incorrect type was passed to the PIL.Image.open() function that caused the whole process to fail.
Scope of this change is limited to only batch image processing, and it shouldn't affect other functionality.
Diffstat (limited to 'modules/postprocessing.py')
-rw-r--r-- | modules/postprocessing.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/postprocessing.py b/modules/postprocessing.py index 09d8e605..c27ad8db 100644 --- a/modules/postprocessing.py +++ b/modules/postprocessing.py @@ -1,4 +1,6 @@ import os
+import tempfile
+from typing import List
from PIL import Image
@@ -6,7 +8,7 @@ from modules import shared, images, devices, scripts, scripts_postprocessing, ui from modules.shared import opts
-def run_postprocessing(extras_mode, image, image_folder, input_dir, output_dir, show_extras_results, *args, save_output: bool = True):
+def run_postprocessing(extras_mode, image, image_folder: List[tempfile.NamedTemporaryFile], input_dir, output_dir, show_extras_results, *args, save_output: bool = True):
devices.torch_gc()
shared.state.begin()
@@ -18,7 +20,7 @@ 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)
+ image = Image.open(os.path.abspath(img.name))
image_data.append(image)
image_names.append(os.path.splitext(img.orig_name)[0])
elif extras_mode == 2:
|