Fixes crash when requesting post-generation upscale/face restoration

- Moves the inpainting paste to before the postprocessing.
This commit is contained in:
psychedelicious 2022-11-02 11:13:26 +11:00 committed by Lincoln Stein
parent 6e33ca7e9e
commit 8d171bb044

View File

@ -668,6 +668,15 @@ class InvokeAIWebServer:
step_index = 1
nonlocal prior_variations
# paste the inpainting image back onto the original
if "init_mask" in generation_parameters:
image = paste_image_into_bounding_box(
Image.open(init_img_path),
image,
**generation_parameters["bounding_box"],
)
progress.set_current_status("Generation Complete")
self.socketio.emit("progressUpdate", progress.to_formatted_dict())
@ -756,14 +765,6 @@ class InvokeAIWebServer:
self.socketio.emit("progressUpdate", progress.to_formatted_dict())
eventlet.sleep(0)
# paste the inpainting image back onto the original
if "init_mask" in generation_parameters:
image = paste_image_into_bounding_box(
Image.open(init_img_path),
image,
**generation_parameters["bounding_box"],
)
# restore the stashed URLS and discard the paths, we are about to send the result to client
if "init_img" in all_parameters:
all_parameters["init_img"] = init_img_url