-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Artifacts with DPM++ 2M SDE Karras, even when using use_lu_lambdas
#6295
Comments
I second this. Was short of submitting an issue myself. Interestingly KDPM2AncestralDiscreteScheduler and DPMSolverSDEScheduler (edit: At twice the cost, mind you) are not as bad as other schedulers for SDXL, both close to the original Katherine Crowson implementation. Fooocus, Comfy, Auto1111 all have crisp output using dpmpp_2m variants |
Likely the same isssue + investigation + proposed fix Any chance we could just get the original k_samplers ported as diffusers schedulers or does that come with any legal issues? |
Cc: @LuChengTHU @yiyixuxu |
Hey there - Have been looking into this as well Shouldn't the argument be |
Here is what I got with from diffusers import AutoPipelineForText2Image
from diffusers.schedulers import DPMSolverMultistepScheduler
import torch
model_id = "frankjoshua/juggernautXL_version6Rundiffusion"
pipeline = AutoPipelineForText2Image.from_pretrained(
model_id,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True,
).to("cuda")
pipeline.scheduler = DPMSolverMultistepScheduler.from_config(
pipeline.scheduler.config,
algorithm_type="sde-dpmsolver++",
euler_at_final=True,
)
prompt = "Adorable infant playing with a variety of colorful rattle toys."
results = pipeline(
prompt=prompt,
guidance_scale=3,
generator=torch.Generator(device="cuda").manual_seed(42),
num_inference_steps=25,
height=768,
width=1344)
results.images[0].save("yiyi_test_9_out.png") |
You can use k samplers in diffusers with https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py |
would you be able to share your auto1111 setting exactly as it is? We looked into the difference between auto1111 and diffusers before and concluded the same issue for DPM exists in auto1111/k-sampler. However, the output you provided here is a lot better than what we would generate with |
@yiyixuxu I used:
![]() |
I am having the same problem, Automatic's version of schedulers greatly outperforms HF. I wanted to use DPM++ 2M SDE Karras to generated photorealistic results but it yields unrealistic results with less detail. The updates provided in old pr's does not fix this issue. Sadly this makes it less appealing to use diffusers with SD XL. |
About this issue, here are some recap, thoughts, and experiments:
We thought that the k-diffusion samplers could fix the problem or, at least, reduce the quality gap. |
@amlarraz |
Hey @yiyixuxu sorry for my late response. Amazing!!! I've checked your code and I've left some comments, your code and ours are mostly the same |
Describe the bug
The results obtained using DPM++ 2M SDE Karras contain artifacts that suggest there is some bug. This happens across different XL models, although is not so visible in the base SDXL. Using Automatic1111 with the same models and the same kind of scheduler results in high-quality results, and it seems impossible to achieve the same quality using the
diffusers
equivalent.An image generated using Automatic1111 DPM++ 2M SDE Karras with the Juggernaut XL v6 model

An image generated using the equivalent scheduler from

diffusers
:The artifacts are very visible in the last image.
The following didn't help:
use_karras_sigmas=False
use_karras_sigmas=False
anddpmsolver++
euler_at_final=True
anduse_lu_lambdas=True
I see this happening clearly at least with the following models:
frankjoshua/juggernautXL_version6Rundiffusion
Lykon/dreamshaper-xl-1-0
Reproduction
I've created a github repo to help reproducing the problem. Also, a simpler code snippet is provided below:
Logs
No response
System Info
diffusers
version: 0.24.0Who can help?
@yiyixuxu @patrickvonplaten
The text was updated successfully, but these errors were encountered: