diff --git a/backend/invoke_ai_web_server.py b/backend/invoke_ai_web_server.py index 64304d395d..6dec3ae008 100644 --- a/backend/invoke_ai_web_server.py +++ b/backend/invoke_ai_web_server.py @@ -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