Iter Prompt Builder
A prompt per video iteration, plus where each one starts
- input_video
- string_batch
- iteration_start_frames
Long videos in ComfyUI aren't one generation - they're a chain of iterations, and each iteration usually wants its own prompt. Scene 1's prompt shouldn't still be running when you're two scenes deep. Iter Prompt Builder packages up to 24 per-iteration prompts into a single string_batch, and throws in a genuinely useful extra: it extracts the exact frame where each iteration's new content begins, so you can preview or condition on where the story actually shifts.
It belongs to the pack's video/iteration family and is the string-side twin of Iter Seed Batch (which does the same batching for seeds). Both feed the pack's slicer nodes, which hand the current iteration its prompt and seed.
How it works
Set num_fields (how many iterations, 1–24) and fill the matching string_N widgets. You also give it input_video (an IMAGE batch of your frames), plus two numbers that define the loop's rhythm:
frames_per_iteration- how long each iteration runs (default 81).num_start_frames- the overlapping frames carried from the previous iteration (default 1).
The node computes the new content step as frames_per_iteration - num_start_frames - the actual stride between iteration starts. It then pulls the frame at 0, step, 2*step, ... for each field and returns them as iteration_start_frames. Those are the frames where each iteration's fresh content begins: exactly what you'd preview to sanity-check your story beats, or feed as a context/conditioning reference for the next pass.
The string side is simpler: the strings become a STRING_BATCH in order. Downstream, Iter String Selector picks the current iteration's string (falling back to the last non-empty one, so blank fields don't kill the loop).
Inputs and outputs
input_video(IMAGE),frames_per_iteration(INT),num_start_frames(INT),num_fields(INT) - the rhythm and count.string_1…string_24(STRING) - the per-iteration prompts.- Outputs:
string_batch(STRING_BATCH) anditeration_start_frames(IMAGE).
Where it fits
Any iterative video loop where the prompt should change as the timeline advances. It's the author's own structure for his workflow videos - this pack is by Mickmumpitz, a YouTuber whose iterative-video and consistent-character workflows are the reason these nodes exist. If you're hand-stitching a growing video, this is the node that keeps prompts and timeline in the same rhythm.
Installing
ComfyUI Manager → search "Mickmumpitz" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes
Just numpy, Pillow, opencv-python; nothing to download.
Gotchas
The math only works if frames_per_iteration and num_start_frames match what your actual loop is doing - if your iterations run longer than frames_per_iteration, the extracted start frames drift off the real boundaries. Keep them in sync with the rest of the pack's iteration nodes. And num_fields defines both how many strings are batched and how many preview frames come out, so set it to your real iteration count rather than leaving it at the default 4.
Inputs (28)
| Name | Type | Default | Description |
|---|---|---|---|
| input_video | IMAGE | — | |
| frames_per_iteration | INT | 811–9999 | — |
| num_start_frames | INT | 10–999 | — |
| num_fields | INT | 41–24 | — |
| string_1opt | STRING | — | |
| string_2opt | STRING | — | |
| string_3opt | STRING | — | |
| string_4opt | STRING | — | |
| string_5opt | STRING | — | |
| string_6opt | STRING | — | |
| string_7opt | STRING | — | |
| string_8opt | STRING | — | |
| string_9opt | STRING | — | |
| string_10opt | STRING | — | |
| string_11opt | STRING | — | |
| string_12opt | STRING | — | |
| string_13opt | STRING | — | |
| string_14opt | STRING | — | |
| string_15opt | STRING | — | |
| string_16opt | STRING | — | |
| string_17opt | STRING | — | |
| string_18opt | STRING | — | |
| string_19opt | STRING | — | |
| string_20opt | STRING | — | |
| string_21opt | STRING | — | |
| string_22opt | STRING | — | |
| string_23opt | STRING | — | |
| string_24opt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| string_batch | STRING_BATCH | — |
| iteration_start_frames | IMAGE | — |