mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fixes silent crash when init image too large
To send the mask to the server, the UI rendered the mask onto the init image and sent the whole image. The mask was then cropped by the server. If the image was too large, the app silently failed. Maybe it exceeds the websocket size limit. Fixed by cropping the mask in the UI layer, sending only bounding-box-sized mask image data.
This commit is contained in:
parent
82dcbac28f
commit
21483f5d07
@ -573,11 +573,7 @@ class InvokeAIWebServer:
|
||||
)
|
||||
)
|
||||
)
|
||||
# crop the mask image
|
||||
cropped_mask_image = copy_image_from_bounding_box(
|
||||
mask_image, **generation_parameters["bounding_box"]
|
||||
)
|
||||
generation_parameters["init_mask"] = cropped_mask_image
|
||||
generation_parameters["init_mask"] = mask_image
|
||||
|
||||
totalSteps = self.calculate_real_steps(
|
||||
steps=generation_parameters["steps"],
|
||||
|
@ -101,7 +101,7 @@ const generateMask = (
|
||||
new Konva.Image({ image: image, globalCompositeOperation: 'source-out' })
|
||||
);
|
||||
|
||||
const maskDataURL = stage.toDataURL();
|
||||
const maskDataURL = stage.toDataURL({ ...boundingBox });
|
||||
|
||||
return { maskDataURL, isMaskEmpty };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user