๐บ To Sparse Index Method
Turn a list of frame numbers into the sparse index string your Wan workflow wants
- sparse_method
If you've ever stared at a Wan video-edit or inpainting workflow and wondered where the "0,5,10,15" string is supposed to come from - this is the node that makes it. Wan video editing treats certain frames as reference points, and the workflows built around it (the Kijai WanVideoWrapper family most prominently) expect those keyframes as a sparse method plus a comma-separated list of frame indexes. This node is the "make that string" step. Feed it a list of integers, get a string like 0,5,10,15 on the other side.
The name is bigger than the job. Under the hood it's a one-liner: take the incoming ints, join them with commas, and hand back a string. The one subtlety is that the ints input is treated as a list - you want to wire it from something that outputs a list of INTs (like the pack's own ๐บ List of Ints, or any int-list source in your graph), not a single number. Feed it one int and you'll get a one-element string, which is probably not what a keyframe scheme wants.
Why bother? Because in Wan inpainting you often know exactly which frames you want to lock in - the first frame, a few midpoints, the last frame - and you want the model to treat everything else as fill. Hand-typing a comma string every time you change your mind is exactly the kind of fiddly error-prone step a node graph exists to kill. Swap in a List of Ints node, tweak the range, and the string regenerates itself.
Inputs and output
Only two things matter here:
- ints - a list of INTs (default
0). These are your frame indexes, in the order you want them emitted. - sparse_method (STRING output) - the comma-joined string, e.g.
0,5,10,15. Wire this straight into the sparse-method input of your Wan edit/inpaint node.
That's the whole node. No knobs, no options, nothing to misconfigure.
Installing it
This ships as part of Nilor Nodes (nilor-corp/nilor-nodes), so you're not installing just this node:
cd ComfyUI/custom_nodes
git clone https://github.com/nilor-corp/nilor-nodes
Or skip the terminal: ComfyUI Manager โ Install Custom Nodes โ search "Nilor Nodes" โ install, then restart ComfyUI. There are no model files to download. The pack does pull a heavy dependency list (boto3, fastapi, huggingface_hub, openexrโฆ) even for a node this simple, and the README lists Kijai's comfyui-kjnodes as a prerequisite - you'll want that for the int-list generators anyway.
Troubleshooting
Honest warning first: this pack has basically zero community footprint. No reddit threads, no template workflows, no one to ask - so the README and the source are your docs. The common failure mode here is not the node but what you feed it. If you wire a plain INT in, you get a one-frame string; check that your source is actually emitting a list. And remember the sparse-index string is consumed by whichever Wan workflow you're driving - the numbering is frame indexes, so keep it in range of your actual clip or you'll reference frames that don't exist.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| ints | INT | 0 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| sparse_method | STRING | โ |