dreambooth-template icon indicating copy to clipboard operation
dreambooth-template copied to clipboard

Help users avoid CUDA errors when using oversized img2img inputs

Open zeke opened this issue 2 years ago • 2 comments

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

zeke avatar Jan 23 '23 18:01 zeke

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.

erbridge avatar Jan 23 '23 18:01 erbridge

@nutlope from Vercel just ran into this and got stuck.

zeke avatar Feb 09 '23 22:02 zeke