huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
25.38k stars 5.26k forks source link

ValueError: Unhandled pipeline class: SDXLLongPromptWeightingPipeline #6731

Open calmiLovesAI opened 8 months ago

calmiLovesAI commented 8 months ago

Describe the bug

When running such code:

pipeline = SDXLLongPromptWeightingPipeline.from_single_file(pretrained_model,
                                                                    use_safetensors=True,
                                                                    load_safety_checker=requires_safety_checker).to(
            device)

An ERROR occurred:

Traceback (most recent call last):
  File "D:\AI\OpenSource\AIGC\scripts\text2image.py", line 100, in <module>
    main()
  File "D:\AI\OpenSource\AIGC\scripts\text2image.py", line 75, in main
    pipeline = Text2ImagePipeline(prompt=prompt,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI\OpenSource\AIGC\src\diffusion\txt2img_pipeline.py", line 84, in __init__
    self.pipeline = build_stable_diffusion_xl_pipeline(model_name, loras,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI\OpenSource\AIGC\src\diffusion\stable_diffusion.py", line 107, in build_stable_diffusion_xl_pipeline
    pipeline = SDXLLongPromptWeightingPipeline.from_single_file(pretrained_model,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Python\Lib\site-packages\huggingface_hub\utils\_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "E:\Python\Lib\site-packages\diffusers\loaders\single_file.py", line 223, in from_single_file
    raise ValueError(f"Unhandled pipeline class: {pipeline_name}")
ValueError: Unhandled pipeline class: SDXLLongPromptWeightingPipeline

Reproduction

pipeline = SDXLLongPromptWeightingPipeline.from_single_file(pretrained_model,
                                                                    use_safetensors=True,
                                                                    load_safety_checker=requires_safety_checker).to(
            device)

Logs

No response

System Info

diffusers: 0.25.1 python: 3.11.2

Who can help?

No response

calmiLovesAI commented 8 months ago

One of the solution is to rename the SDXLLongPromptWeightingPipeline in lpw_stable_diffusion_xl.py to StableDiffusionXLLongPromptWeightingPipeline

github-actions[bot] commented 7 months ago

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.

yiyixuxu commented 7 months ago

cc @DN6

github-actions[bot] commented 6 months ago

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.

DN6 commented 6 months ago

I think this PR: #7496 should help with the issue

github-actions[bot] commented 5 months ago

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.

github-actions[bot] commented 2 weeks ago

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.