SparkDiffusion Text To Video
5-second Wan clips from a prompt, in three steps
- runtime
- profile
- video
- frames
- video_path
- metadata
Wan 2.1/2.2 is still the open video base everyone builds on - frozen since July 2025, Apache 2.0, and the thing the community actually runs. The knobs you'd normally reach for to make it fast are distillation LoRAs like CausVid and Lightx2v, which get you to 2–8 steps at CFG 1 but draw the well-earned complaint that they flatten composition and motion. SparkDiffusion is a different bet: instead of bolting a speed LoRA onto a dense model, it ships retrained checkpoints with RoLA sparse attention and a distilled few-step schedule baked in. This node is the front door for the text-to-video half of that.
Upstream's headline is up to 265× versus a 50-step CFG'd baseline. The pack's author didn't reproduce that (he didn't run the dense baseline at all) and says so in the README, which is refreshing. His own numbers are the ones to plan around: 14B 720P 3-step at 20.0 s of warm denoise on a 5090, and 1.3B 480P 4-step at 1.78 s.
How it works
The node does almost nothing. It packages your prompt, seed, frame count and aspect ratio into a job, hands it to the isolated runtime you configured on the Runtime node, and reads back an MP4 plus a metadata JSON. The generation itself is the official upstream SparkDiffusion inference, unmodified, wrapped by a launcher that verifies on every run that the path was real: RoLA active on every transformer block, the top-k ratio matching the profile, the exact CrossDistill timesteps hitting the DiT, FP8 module count, fused kernels, torch.compile. If a check fails, the run is reported as an error rather than as a SparkDiffusion result.
The inputs that matter
Wire runtime and profile in from those two nodes and you're basically done. Then:
- prompt - multiline, defaults to "A cat playing in the garden under the sun." Standard Wan prompting applies: describe motion and camera, not just subject.
- num_frames - default 81, range 5–161, stepping by 4. This is the field that trips people up, and the tooltip spells out why: 4k+1 frames at 16 fps, with 81 = 5 seconds, the length these checkpoints were distilled for. Frame counts that aren't 4k+1 are rejected.
- aspect_ratio - 16:9, 9:16, 1:1, 4:3, 3:4. Cheap to change, changes nothing about runtime cost per frame.
- seed and filename_prefix - seed has the usual control-after-generate widget; the prefix defaults to
sparkdiffusion/SparkWan.
One optional field earns its place: num_videos (1–16) generates that many videos in one runtime process, with seeds seed, seed+1, and so on. Since loading and compiling are paid per process, this is the cheapest speedup in the whole pack. Pair it with torch_compile on the Runtime node or don't bother compiling at all. load_frames decodes every frame into the IMAGE output and is memory-heavy; off gives you the first frame only.
Outputs
Four: video (a ComfyUI VIDEO object), frames (IMAGE - first frame, or all of them), video_path (STRING, the MP4 on disk), and metadata (STRING, the full JSON including the verification results and timings). The node is an output node, so it shows a video preview in the graph. The metadata output into a Note or text-save node is how you confirm afterward that you really got RoLA and FP8 and not a silent fallback.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/hiroki-abe-58/ComfyUI-SparkDiffusion
or ComfyUI Manager → search SparkDiffusion → Install → restart. Nothing lands in ComfyUI's Python. You then need the runtime environment (separate venv, CUDA PyTorch, Triton ≥ 3.4) and the model files:
python scripts/download_models.py --profile wan2.1-t2v-1.3b-480p-s90-4step --model-root D:/AI/models/spark
There are ready-made workflows in workflows/ - drag sparkdiffusion_1p3b_t2v.json onto the canvas for the minimal Runtime → Profile → Text To Video graph.
Where people get burned
Every run reloads the umT5 encoder (15–65 s) and, for 14B, the checkpoint plus FP8 conversion - one process per run is the pack's known limitation, not a misconfiguration. On Windows, FP8 needs backend=wsl2 or fp8_compat=auto; hit "Rowwise scaling is not currently supported on your device" and that's the fix. And don't expect a LoRA slot: RoLA replaces the attention, so ComfyUI samplers and LoRAs can't be combined with it. If you wanted to stack a speed LoRA on top, this isn't the path - SparkDiffusion already made that decision for you inside the checkpoint.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| runtime | SPARKDIFFUSION_RUNTIME | — | |
| profile | SPARKDIFFUSION_PROFILE | — | |
| prompt | STRING | A cat playing in the garden under the sun. | — |
| seed | INT | 00–4294967295 | — |
| num_frames | INT | 815–161 | 4k+1 frames at 16 fps; 81 = 5 s (the length the checkpoints were distilled for). |
| aspect_ratio | COMBO | 16:9 | 5 options: 16:9, 9:16, 1:1, 4:3, 3:4 |
| filename_prefix | STRING | sparkdiffusion/SparkWan | — |
| load_framesopt | BOOLEAN | false | Decode every frame into the IMAGE output (memory heavy). Off = first frame only. |
| num_videosopt | INT | 11–16 | Videos generated in ONE runtime process with seeds seed, seed+1, ... (upstream NUM_SAMPLES). Loading and torch.compile are paid once, so extra videos are cheap. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |
| frames | IMAGE | — |
| video_path | STRING | — |
| metadata | STRING | — |