Skip to content
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

ValueError: AutoPipeline can't find a pipeline linked to SanaPipeline for None #141

Open
RageshAntonyHM opened this issue Jan 10, 2025 · 6 comments
Labels
Answered Answered the question bug Something isn't working fixed fix a bug

Comments

@RageshAntonyHM
Copy link

RageshAntonyHM commented Jan 10, 2025

Since SanaPipline has been added to Diffusers as a custom pipeline it is possible to use SanaPipeline from diffusers.

But when trying to use AutoPipelineForText2Image which automatically selects the needed custom pipeline for a model ID, it fails to work by throwing an error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 256, in thread_wrapper
    res = future.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/user/app/check_app.py", line 176, in create_pipeline_logic
    b_pipe = AutoPipelineForText2Image.from_pretrained(
  File "/usr/local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/diffusers/pipelines/auto_pipeline.py", line 425, in from_pretrained
    text_2_image_cls = _get_task_class(AUTO_TEXT2IMAGE_PIPELINES_MAPPING, orig_class_name)
  File "/usr/local/lib/python3.10/site-packages/diffusers/pipelines/auto_pipeline.py", line 249, in _get_task_class
    raise ValueError(f"AutoPipeline can't find a pipeline linked to {pipeline_class_name} for {model_name}")'

ValueError: AutoPipeline can't find a pipeline linked to SanaPipeline for None

Codeblock:

    b_pipe = AutoPipelineForText2Image.from_pretrained(
        config["Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers"],
        torch_dtype=torch.bfloat16
    ).to("cuda")

What is the reason for this error ? Please help me.

@geronimi73
Copy link

Use SanaPipeline (or DiffusionPipeline)

import torch
from diffusers import SanaPipeline

b_pipe = SanaPipeline.from_pretrained(
    "Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers",
    torch_dtype=torch.bfloat16
).to("cuda")

@RageshAntonyHM
Copy link
Author

@geronimi73

Yes. I already did. But my question is, other pipelines such as FluxPipeline, SD3LargePipeline etc works with AutoPipelineForText2Image but why not Sana ?

@lawrence-cj
Copy link
Collaborator

lawrence-cj commented Jan 12, 2025

Will fix it soon.
huggingface/diffusers#10538
@RageshAntonyHM , Thanks for noticing.

@lawrence-cj lawrence-cj added bug Something isn't working Answered Answered the question working working on this issue labels Jan 12, 2025
@RageshAntonyHM
Copy link
Author

@lawrence-cj
ooh. Thanks.

@RageshAntonyHM
Copy link
Author

@lawrence-cj
it's merged. How to use it ? That is, do i need to wait for the next release ?

@lawrence-cj
Copy link
Collaborator

run pip install git+https://github.com/huggingface/diffusers and try it again.

@lawrence-cj lawrence-cj added fixed fix a bug and removed working working on this issue labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Answered Answered the question bug Something isn't working fixed fix a bug
Projects
None yet
Development

No branches or pull requests

3 participants