Skip to content

[SDXL-lightning Inference] diffusers inference result is different with webui #7142

@ApolloRay

Description

@ApolloRay

Describe the bug

截屏2024-02-29 11 24 55
I use diffuser to generate the image with dreamshaper_lightning model, but the result is really strange.
Model url:https://civitai.com/models/112902?modelVersionId=354657

Reproduction

`import torch
from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler, DPMSolverMultistepScheduler
from transformers import CLIPTextModel

base_model_path = "dreamshaperXL_lightningDPMSDE.safetensors"

pipe = StableDiffusionXLPipeline.from_single_file(base_model_path,torch_dtype=torch.float16, variant="fp16")
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, use_karras_sigmas=True, algorithm_type="dpmsolver++")
pipe = pipe.to("cuda")

prompt = "a girl"
negative_prompt = "NSFW,"
generator = torch.Generator(torch.device("cuda")).manual_seed(-1)
num_inference_steps = 4
guidance_scale = 2
image = pipe(prompt=prompt,
negative_prompt=negative_prompt,
width=512,
height=512,
num_inference_steps=num_inference_steps,
guidance_scale=guidance_scale).images[0]
image.save("a girl.png")
`

Logs

No response

System Info

  • diffusers version: 0.24.0
  • Platform: Linux-4.14.0_1-0-0-45-x86_64-with-glibc2.18
  • Python version: 3.10.13
  • PyTorch version (GPU?): 2.0.1+cu117 (True)
  • Huggingface_hub version: 0.20.1
  • Transformers version: 4.30.2
  • Accelerate version: 0.21.0
  • xFormers version: 0.0.20

Who can help?

@yiyixuxu

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions