Closed nwam closed 1 year ago
Can you try running in float32 precision?
Hey that fixed it. I had a memory error with just the change to float32 and had to remove pipe = pipe.to("cuda")
in my above example to get it running. Similarly, in my code to run StableDiffusionControlNetPipeline I had to remove pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
to fix my memory error. Following the error's instructions and setting max_split_size_mb
to various values didn't do anything for me.
Memory error for those searching to fix a similar issue:
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 4.00 GiB total capacity; 3.33 GiB already allocated; 0 bytes free; 3.42 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
Hey that fixed it. I had a memory error with just the change to float32 and had to remove
pipe = pipe.to("cuda")
in my above example to get it running. Similarly, in my code to run StableDiffusionControlNetPipeline I had to removepipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
to fix my memory error. Following the error's instructions and settingmax_split_size_mb
to various values didn't do anything for me.Memory error for those searching to fix a similar issue:
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 4.00 GiB total capacity; 3.33 GiB already allocated; 0 bytes free; 3.42 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
where can I find ipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config) ?
timestep_spacing="trailing"
was the culprit for me
Describe the bug
Hey I'm having a very similar issue to #2153. I'm trying to run ControlNet, but weather I run StableDiffusionPipeline or StableDiffusionControlNetPipeline, I get a black output image.
The the only notable log is
C:\Users\nwam\AppData\Local\Programs\Python\Python311\Lib\site-packages\diffusers\image_processor.py:65: RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8")
I've tried with
runwayml/stable-diffusion-v1-5
too and I've tried with and without xformers as well. For reference, I'm able to run stable diffusion fine in AUTOMATIC1111 so it is possible with my setup.I've tried the optimizations suggested in #2153 with either errors or no success.
Reproduction
Logs
System Info
My GPU is Quadro T2000 (4gb). Here are my versions:
diffusers
version: 0.19.0.dev0Who can help?
No response