Closed pavankay closed 8 months ago
Hi @sayakpaul @yiyixuxu, I would like to work on this issue. Please let me know how can I start. Thanks
Same on my GTX 1660 Ti with CUDA 12.3.
Replace torch.float16
with torch.float32
to fix.
Same for webui using: webui.bat --no-half
Hi @CTimmerman, does this problem exists for torch.float16 on a windows system? Should the solution be crafted? Thanks
@Bhavay-2001 Yes: Edition Windows 11 Home Version 23H2 Installed on โ28-โ11-โ2022 OS build 22631.3007 Experience Windows Feature Experience Pack 1000.22681.1000.0
I think we need to discuss this with @sayakpaul @yiyixuxu and then I can contribute in this.
Enabling autocast is better than raising the error to the user and outputting black images, but i think that suddenly stopped working in my webgui until i started using --no-half
there.
Soo how can we make this change? Any helps will be appreciated.
We have made a number of fixes to the DPM schedulers. Could you try installing the latest version of diffusers
and check again?
Cc: @yiyixuxu
We have made a number of fixes to the DPM schedulers. Could you try installing the latest version of
diffusers
and check again?
Main doesn't look any different, and there are too many other branches to read. If this is not a problem limited to 16xx cards, then you can test it using my code by changing float32
back to float16
.
I'm already using the main branch:
how can I fix the problem though this has also been happening with the upscaler models too. When I run it in google colab it works.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Gently pinging @yiyixuxu.
I'm not sure what to do here other than use full precision It is a known issue with GTX 1660 https://github.com/huggingface/diffusers/issues/2153
I think I'm seeing this same issue with on a 4090 on ubuntu, using the train_text_to_image_lora_sdxl script
accelerate launch train_text_to_image_lora_sdxl.py --mixed_precision=fp16 --pretrained_model_name_or_path=$MODEL_NAME --train_data_dir=instance-imgs --dataloader_num_workers=8 --output_dir=outputxl --report_to=tensorboard --checkpointing_steps=500 --validation_prompt="some prompts" --seed=42 --train_batch_size=1 --learning_rate=1e-4
dropping lr to 1e-6 doesn't help. The images passed to tensorboard are black. Could be other default parameters are causing the issue. The same dataset works fine the the sd1.5 lora trainer.
You might want to use a more numerically stable VAE: "madebyollin/sdxl-vae-fp16-fix" and pass it to pretrained_vae_model_name_or_path
. I think we show this already from https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/README_sdxl.md.
Thanks @sayakpaul that solves the problem for me
ๆฉๆฃๆจกๅ็้ข่ฎญ็ปๆ้ๅจๆจ็ๆถไผๅ็ๅๅ๏ผ้ๆฐไธ่ฝฝ้ข่ฎญ็ปๆ้ๅณๅฏ่งฃๅณ้ฎ้ข
Just in case someone else chances upon this thread...
\Lib\site-packages\diffusers\image_processor.py:111: RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8")
Was able to avoid this by toggling rescale_betas_zero_snr
while using DDIMScheduler
Describe the bug
When running the stable-diffusion-2-1 I get a runtime warning "RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8")" and the image output is black.
Reproduction
My code: import torch from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
model_id = "stabilityai/stable-diffusion-2-1"
comment#Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config) pipe = pipe.to("cuda")
prompt = "a photo of an astronaut riding a horse on mars" image = pipe(prompt).images[0]
image.save("astronaut_rides_horse.png")
I got it from here: https://huggingface.co/stabilityai/stable-diffusion-2-1
Logs
System Info
diffusers
version: 0.26.0Who can help?
No response