Skip to content

Commit 57727e5

Browse files
committed
make #15334 work without making copies of images
1 parent b80b1cf commit 57727e5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

modules/postprocessing.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_images(extras_mode, image, image_folder, input_dir):
6666
if parameters:
6767
existing_pnginfo["parameters"] = parameters
6868

69-
initial_pp = scripts_postprocessing.PostprocessedImage(image_data.convert("RGBA")) if image_data.mode == "RGBA" else scripts_postprocessing.PostprocessedImage(image_data.convert("RGB"))
69+
initial_pp = scripts_postprocessing.PostprocessedImage(image_data if image_data.mode in ("RGBA", "RGB") else image_data.convert("RGB"))
7070

7171
scripts.scripts_postproc.run(initial_pp, args)
7272

@@ -122,8 +122,6 @@ def get_images(extras_mode, image, image_folder, input_dir):
122122
if extras_mode != 2 or show_extras_results:
123123
outputs.append(pp.image)
124124

125-
image_data.close()
126-
127125
devices.torch_gc()
128126
shared.state.end()
129127
return outputs, ui_common.plaintext_to_html(infotext), ''

0 commit comments

Comments
 (0)