Uminosachi / sd-webui-inpaint-anything

Inpaint Anything extension performs stable diffusion inpainting on a browser UI using masks from Segment Anything.
Apache License 2.0
1.14k stars 102 forks source link

Cuda out of memory and not freeing memory after error #64

Open Arctomachine opened 1 year ago

Arctomachine commented 1 year ago

I tried to run large model and then base model, but they both only return "cuda ouf of memory" error. On top of that they are not freeing taken memory and not resetting segmentation process, so I have to restart both server and interface to recover from error. How to make it work without error?

Uminosachi commented 1 year ago

I've added code that prints an error message, clears the cache, and returns from the function if a CUDA out-of-memory error occurs during SAM generation.