Animation Builder (mtb)
Queue-driven frame counter for iterative animation
- frame
- 0-1 (scaled)
- count
- loop_ended
Before video models like AnimateDiff and Wan made animation a single-run affair, you built animations by running your graph over and over - frame by frame, nudging some parameter a little each time. Animation Builder is the node that drives that loop. It's a counter: every time you queue, it ticks forward and tells the rest of your graph "we're on frame N of M, here's how far along we are." You feed that progress into whatever you want to animate.
It's an older pattern, and honestly a bit fiddly, but it's still the clean way to do a deterministic parameter sweep - a zoom-in on a still image, a slow prompt interpolation, a controlled march through seeds. You get exact control over every frame, which the one-shot video models don't give you.
How it works
You set total_frames and loop_count, and the node maintains an internal counter across queue runs. It ships with its own Queue button that fires off total_frames × loop_count runs in one go, incrementing the counter each time, plus a Reset button to zero it. On each run it outputs where you are in the sequence, so downstream nodes can change their behavior per frame. String enough of these runs together and the saved frames become your animation.
The inputs and outputs that matter
total_frames(INT, default 100) - frames per loop.loop_count(INT, default 1) - how many loops to queue; total runs are the two multiplied.scale_float(FLOAT, default 1) - a convenience multiplier on the normalized 0–1 output, so you can rescale progress to whatever range your target wants.raw_iterationandraw_loop- the internal counter state. Leave them at 0; the node manages them.
Four outputs: frame (INT, the current index) for anything that wants a frame number; 0-1 (scaled) (FLOAT, normalized progress through the loop, times scale_float) which is the one you'll usually lerp with - feed it into a transform amount, a blend factor, a prompt weight; count (INT, the total); and loop_ended (BOOLEAN) to trigger something at the end of a loop.
How to install it
Via ComfyUI Manager: search MTB Nodes, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb
then restart. No models. The wiki has a worked example (search "nodes-animation-builder") if you want to see the wiring with a debug node.
Common issues & troubleshooting
The counter isn't advancing. Use the node's own Queue button, not ComfyUI's regular queue - the built-in one usually works too, but the node is designed around its own button and that's the reliable path. If the count is stuck or wrong, hit Reset to clear the internal state.
It queued way more runs than I expected. total_frames × loop_count. Set loop_count to 1 while you're testing so you're not sitting through 500 runs to check one thing.
Consider whether you even need it. For most modern animation you'd reach for AnimateDiff or a video model in a single run. Animation Builder earns its place when you specifically want per-frame determinism and control - a precise zoom, a parameter sweep - not for general "make it move."
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| total_frames | INT | 100 | — |
| scale_float | FLOAT | 1.00 | — |
| loop_count | INT | 1 | — |
| raw_iteration | INT | 0 | — |
| raw_loop | INT | 0 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| frame | INT | — |
| 0-1 (scaled) | FLOAT | — |
| count | INT | — |
| loop_ended | BOOLEAN | — |