Skip to content

SanaSprintPipeline: Intermediate timesteps for SCM is not supported when num_inference_steps != 2Β #11136

@nitinmukesh

Description

@nitinmukesh

Describe the bug

Documentation says 1-4 inference steps, but using 4 steps throws error

achieving high-quality generation with 1-4 inference steps

https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/sana/pipeline_sana_sprint.py#L413

if intermediate_timesteps is not None and num_inference_steps != 2:
            raise ValueError("Intermediate timesteps for SCM is not supported when num_inference_steps != 2.")

Reproduction

from diffusers import SanaSprintPipeline
import torch

pipeline = SanaSprintPipeline.from_pretrained(
    "Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers",
    torch_dtype=torch.bfloat16
)
pipeline.to("cuda:0")
prompt = "a tiny astronaut hatching from an egg on the moon"

image = pipeline(prompt=prompt, num_inference_steps=4).images[0]
image.save("test_out.png")

Logs

(venv) C:\aiOWN\diffuser_webui>python Sana_Sprint.py
Loading checkpoint shards: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00,  3.07it/s]
Loading pipeline components...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00,  1.08s/it]
Traceback (most recent call last):
  File "C:\aiOWN\diffuser_webui\Sana_Sprint.py", line 14, in <module>
    image = pipeline(prompt=prompt, num_inference_steps=4).images[0]
  File "C:\aiOWN\diffuser_webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "C:\aiOWN\diffuser_webui\venv\lib\site-packages\diffusers\pipelines\sana\pipeline_sana_sprint.py", line 725, in __call__
    self.check_inputs(
  File "C:\aiOWN\diffuser_webui\venv\lib\site-packages\diffusers\pipelines\sana\pipeline_sana_sprint.py", line 414, in check_inputs
    raise ValueError("Intermediate timesteps for SCM is not supported when num_inference_steps != 2.")
ValueError: Intermediate timesteps for SCM is not supported when num_inference_steps != 2.

System Info

Build from source

Who can help?

No response

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