Closed Xynonners closed 6 months ago
Can you try whether the fix to DPM provided here: https://github.com/huggingface/diffusers/pull/5541 could help?
In my experience, #5541 helps but not completely. I just filed https://github.com/huggingface/diffusers/issues/5689 to document another issue we found.
@patrickvonplaten using euler_at_final with either default, use_karras_sigmas, or use_lu_lambdas does help the issue slightly, but it is still very apparent.
use_karras_sigmas tends to be less noisy than default, while use_lu_lambdas tends to have larger but less splotches.
hi @Xynonners
sorry I can't reproduce this. I tried this script - think euler indeed looks better but I would say dpm output is more or less within the expected range, unlike the output you provided. Did I miss anything here?
import torch
from diffusers import StableDiffusionXLPipeline, DPMSolverMultistepScheduler, EulerAncestralDiscreteScheduler
pipeline = StableDiffusionXLPipeline.from_pretrained("KBlueLeaf/kohaku-xl-beta7.1", torch_dtype=torch.float16)
pipeline.enable_model_cpu_offload()
generator = torch.Generator(device="cuda").manual_seed(42)
ims = pipeline(prompt="realistic car 3 d render sci - fi car and sci - fi robotic factory structure in the coronation of napoleon painting and digital billboard with point cloud in the middle, unreal engine 5, keyshot, octane, artstation trending, ultra high detail, ultra realistic, cinematic, 8 k, 1 6 k, in style of zaha hadid, in style of nanospace,", num_inference_steps=30, generator=generator)
ims.images[0].save("euler.png")
pipeline.scheduler = DPMSolverMultistepScheduler.from_config(pipeline.scheduler.config)
generator = torch.Generator(device="cuda").manual_seed(42)
ims = pipeline(prompt="realistic car 3 d render sci - fi car and sci - fi robotic factory structure in the coronation of napoleon painting and digital billboard with point cloud in the middle, unreal engine 5, keyshot, octane, artstation trending, ultra high detail, ultra realistic, cinematic, 8 k, 1 6 k, in style of zaha hadid, in style of nanospace,", num_inference_steps=30, use_lu_lambdas =True, euler_at_final = True, generator=generator)
ims.images[0].save("dpm.png")
euler
dpm
@yiyixuxu I narrowed it down to the guidance_scale parameter, it seems like DPM is unstable at high guidance scale.
import torch
from diffusers import StableDiffusionXLPipeline, DPMSolverMultistepScheduler, EulerAncestralDiscreteScheduler
pipeline = StableDiffusionXLPipeline.from_single_file("UpDraft/models/kohakuXLBeta_beta71.safetensors", torch_dtype=torch.float16)
pipeline.enable_model_cpu_offload()
generator = torch.Generator(device="cuda").manual_seed(42)
ims = pipeline(guidance_scale=14.0, prompt="realistic car 3 d render sci - fi car and sci - fi robotic factory structure in the coronation of napoleon painting and digital billboard with point cloud in the middle, unreal engine 5, keyshot, octane, artstation trending, ultra high detail, ultra realistic, cinematic, 8 k, 1 6 k, in style of zaha hadid, in style of nanospace,", num_inference_steps=30, generator=generator)
ims.images[0].save("euler.png")
pipeline.scheduler = DPMSolverMultistepScheduler.from_config(pipeline.scheduler.config)
generator = torch.Generator(device="cuda").manual_seed(42)
ims = pipeline(guidance_scale=14.0, prompt="realistic car 3 d render sci - fi car and sci - fi robotic factory structure in the coronation of napoleon painting and digital billboard with point cloud in the middle, unreal engine 5, keyshot, octane, artstation trending, ultra high detail, ultra realistic, cinematic, 8 k, 1 6 k, in style of zaha hadid, in style of nanospace,", num_inference_steps=30, use_lu_lambdas =True, euler_at_final = True, generator=generator)
ims.images[0].save("dpm.png")
Also, the introduction of accelerate also, while making the model much slower, also seems to serve to destabilize it a larger amount. dpm: dpm + accelerate:
lowered to 15, seems like euler even has noise issues at this point (cfg 14) dpm: euler:
@yiyixuxu can you look into this to see if it has been fixed?
Gentle re-ping
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.
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.
cc @Beinsezii here since you have been testing our schedulers is this still an issue?
DPMSolverMultistep
has been my default ever since I added ZSNR and I've never once seen images like that across a fair variety of XL models. Closest I can think of is running a funky noise schedule directly on bf16 but that should be fixed forever since I added an upcast in step()
with #7097
@Xynonners should probably try again on the latest pytorch/diffusers.
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.
closing this for now! feel free to re-open if you continue to see issue
Describe the bug
The model KohakuXL in diffusers, seems to run into a massive noise/stability issue that doesn't seem to be present within ComfyUI/AUTO1111, on UniPC/DPM schedulers (possibly more) that doesn't go away with high step counts. At 15S: At 30S: Euler A 30S:
Reproduction
Logs
System Info
diffusers
version: 0.22.0.dev0Who can help?
@yiyixuxu @patrickvonplaten