dreambooth-template
dreambooth-template copied to clipboard
Help users avoid CUDA errors when using oversized img2img inputs
When the image
input is supplied, the model attempts to create an output image of the same dimensions. Users should ideally be providing square images of smaller dimensions like 512x512, but if they use an arbitrary image like a photo they took on their phone, the dimensions will be way bigger and the model will run out of memory and crash with a CUDA error.
This is not a great experience, and it's totally unclear to the user what might have gone wrong.
Possible actions
In ascending order by effort:
- Update the description for the
image
input to give users a warning - Abort the prediction with an error if the image is too big, or not a square
- Automatically crop and resize the image
Related issues/PRs
- https://github.com/replicate/replicate-web/pull/3029
- https://github.com/replicate/replicate-web/issues/2769
cc @anotherjesse
As a user, I would want whatever processing we do to an image to be explained to me. So if we're resizing, we should say we've done that, so someone intentionally trying to put a large image in doesn't get confused about the behaviour.
@nutlope from Vercel just ran into this and got stuck.