Skip to content

Commit

Permalink
make #15334 work without making copies of images
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Mar 21, 2024
1 parent b80b1cf commit 57727e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions modules/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_images(extras_mode, image, image_folder, input_dir):
if parameters:
existing_pnginfo["parameters"] = parameters

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

scripts.scripts_postproc.run(initial_pp, args)

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

image_data.close()

devices.torch_gc()
shared.state.end()
return outputs, ui_common.plaintext_to_html(infotext), ''
Expand Down

0 comments on commit 57727e5

Please sign in to comment.