Mpi Wan Seconds
The node that adds Wan's '+1' frame so you don't have to
- frames
- seconds
- fps
The most reliable beginner error in local Wan video generation is this: you want a 5-second clip at 16 fps, you type 80 frames into the sampler's latent, and you get a clip that's a hair under 5 seconds, or a latent that doesn't line up with the model's expectations. Wan wants fps × seconds + 1 frames - both endpoint frames count - so 5 seconds at 16 fps is 81, not 80. Mpi Wan Seconds is the node that does that addition for you, and it's the direction you actually want when building a workflow: you think in seconds, the model speaks frames.
Two inputs, three outputs:
seconds(INT, default 1, step 1) - how long you want the clip, in whole seconds.fps(FLOAT, default 16) - the playback rate.- Outputs:
frames(INT, computed asint(seconds × fps) + 1), plussecondsandfpspassed through untouched.
That's the entire mechanism - one formula, no model, no hidden state. Ask for 5 seconds at 16 fps and it hands you 81 frames, ready to feed the sampler or an empty-latent node. This is the frame math the Wan community actually runs on: 81 frames = 5 s, 113 frames = 7 s at 16 fps, because the +1 is baked into how Wan's frame grid is specified. The pack's own Mpi Wan Frames is the reverse - feed it a frame count and get the true duration - so the pair covers both directions of the same conversion.
Why is this worth a dedicated node and not just a mental note? Because in a Wan workflow the frame count goes into several places - the empty latent, any frame-conditioning node, the filename - and if you hardcode 80 because "5 × 16 = 80, obviously," you've introduced an error that's genuinely hard to spot later. The +1 is the entire value proposition. Wire one Mpi Wan Seconds as the single source of truth for the frame count, and every consumer gets 81.
A couple of honest caveats. The seconds input is an INT with step 1, so this handles whole seconds; fractional durations aren't its job. And frames is computed with int(), so at low fps the floor can matter - 1 second at 16 fps is 17 frames, which is exactly right for the endpoint-counting convention. It's not a bug, it's the Wan way.
Install - it ships in ComfyUi-MpiNodes. ComfyUI Manager → search "ComfyUi-MpiNodes" → Install, then restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
No pip dependencies, no models to fetch - pure arithmetic from the 100+ node Mad Pony Interactive pack, riding on nothing but a current ComfyUI.
If your Wan clips keep coming out a frame short, this is the node that fixes it without you ever touching a calculator again.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| seconds | INT | 11–18446744073709550000 | — |
| fps | FLOAT | 16.01–120 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| frames | INT | — |
| seconds | FLOAT | — |
| fps | FLOAT | — |