Sana icon indicating copy to clipboard operation
Sana copied to clipboard

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

Open RageshAntonyHM opened this issue 1 month ago • 6 comments

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.

RageshAntonyHM avatar Jan 10 '25 13:01 RageshAntonyHM