Skip to content

download_from_original_stable_diffusion_ckpt does not load SDXL checkpoints without specifying pipeline_class #4488

@allenbenz

Description

@allenbenz

Describe the bug

94b332c changed a hardcoded class reference of StableDiffusionXLPipeline to pipeline_class, pipeline_class defaults to StableDiffusionPipeline so it tries to load the SDXL checkpoint as a SD checkpoint.

Providing the argument pipeline_class=StableDiffusionXLPipeline to the download_from_original_stable_diffusion_ckpt works around the issue.

Reproduction

from diffusers.pipelines.stable_diffusion.convert_from_ckpt import download_from_original_stable_diffusion_ckpt

download_from_original_stable_diffusion_ckpt(
    checkpoint_path="E:/models/sd_xl_base_1.0_0.9vae.safetensors",
    original_config_file="E:/models/sd_xl_base_1.0_0.9vae.yaml",
    from_safetensors=True
)

Logs

Traceback (most recent call last):
  File "E:\tmp\repro.py", line 3, in <module>
    download_from_original_stable_diffusion_ckpt(
  File "E:\tmp\venv\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 1592, in download_from_original_stable_diffusion_ckpt
    pipe = pipeline_class(
TypeError: StableDiffusionPipeline.__init__() got an unexpected keyword argument 'text_encoder_2'

System Info

  • diffusers version: 0.20.0.dev0
  • Platform: Windows-10-10.0.19045-SP0
  • Python version: 3.10.7
  • PyTorch version (GPU?): 2.0.1+cu118 (True)
  • Huggingface_hub version: 0.16.4
  • Transformers version: 4.31.0
  • Accelerate version: 0.21.0
  • xFormers version: 0.0.20
  • Using GPU in script?: yes
  • Using distributed or parallel set-up in script?: no

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