Sana
Sana copied to clipboard
ValueError: AutoPipeline can't find a pipeline linked to SanaPipeline for None
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.
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")
@geronimi73
Yes. I already did. But my question is, other pipelines such as FluxPipeline, SD3LargePipeline etc works with AutoPipelineForText2Image but why not Sana ?
Will fix it soon. https://github.com/huggingface/diffusers/pull/10538 @RageshAntonyHM , Thanks for noticing.
@lawrence-cj ooh. Thanks.
@lawrence-cj it's merged. How to use it ? That is, do i need to wait for the next release ?
run pip install git+https://github.com/huggingface/diffusers and try it again.