Nodes/Mickmumpitz-Nodes/Iter Seed Batch
ComfyUI Node

Iter Seed Batch

Give every video iteration its own seed

By mickmumpitz·Created 9 months ago·Updated 3 days ago· 54
Iter Seed Batch
    • seed_batch
    ◄num_fields4►
    ◄seed_1-1►
    ◄seed_2-1►
    ◄seed_3-1►
    ◄seed_4-1►
    ◄seed_5-1►
    ◄seed_6-1►
    ◄seed_7-1►
    ◄seed_8-1►
    ◄seed_9-1►
    ◄seed_10-1►
    ◄seed_11-1►
    ◄seed_12-1►
    ◄seed_13-1►
    ◄seed_14-1►
    ◄seed_15-1►
    ◄seed_16-1►
    ◄seed_17-1►
    ◄seed_18-1►
    ◄seed_19-1►
    ◄seed_20-1►
    ◄seed_21-1►
    ◄seed_22-1►
    ◄seed_23-1►
    ◄seed_24-1►

    In iterative video generation, each pass over the timeline is a fresh generation with its own random seed - and if every iteration rolls the same seed, you get repeating patterns that look like the video is stuttering on a loop. Iter Seed Batch exists so each iteration gets a different seed, set up front, all in one tidy node.

    It's the seed cousin of the pack's String Batch node. You set num_fields (how many seeds you need, 1 to 24, default 4) and the corresponding number of seed_N widgets appear. Out the other end comes a single seed_batch - a SEED_BATCH tuple that the pack's iteration machinery consumes.

    How it works

    The batch is just an ordered tuple of your seeds. The interesting behavior is what -1 means. The pack's slicer nodes (ControlImageSlicer, MultiChannelSlicer) and the _select_iter_seed helper treat -1 as "unset": when iteration N asks for a seed and that slot is -1, they fall back to the last valid (≥ 0) seed from a previous iteration. So you can seed iteration 0 with a fixed number for reproducibility, leave the rest at -1, and every later iteration will reuse it - or set a handful of explicit seeds and let the rest ride on the most recent one.

    That's genuinely useful. For a deterministic look you lock one seed and let everything follow it. For a "keep changing it up" look you fill each slot with a fresh number. Either way, you're not hardcoding seeds deep in a sampler or typing them per-iteration.

    Inputs

    • num_fields (INT, 1–24) - controls how many seed_N widgets show. Bump it when you add iterations.
    • seed_1 … seed_24 (INT) - per-iteration seeds. Default is -1 (unset → inherit previous valid seed).

    Where it fits

    Wire seed_batch into a slicer in the pack's iterative video loop - the one that pulls the current iteration's seed out of the batch and feeds the sampler. If you're using IterPromptBuilder to drive per-iteration prompts, think of Iter Seed Batch as its numeric twin: prompts change per iteration, seeds change per iteration, both driven by the same index.

    Installing

    One install for the whole pack - ComfyUI Manager, search "Mickmumpitz", install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes
    

    Light deps only (numpy, Pillow, opencv-python); nothing to download.

    Gotchas

    The two things that trip people up: forgetting that -1 means "inherit" rather than "randomize" - if your later iterations all look identical, check you didn't leave everything at -1 when you meant to vary it - and the off-by-one between iteration count and num_fields. If you generate 6 iterations but num_fields is 4, iterations 4 and 5 inherit the last valid seed instead of getting their own. Set num_fields to match your real iteration count and it all stays predictable.

    CategoryMickmumpitz/video/iteration

    Inputs (25)

    NameTypeDefaultDescription
    num_fieldsINT41–24—
    seed_1optINT-1-1–18446744073709550000—
    seed_2optINT-1-1–18446744073709550000—
    seed_3optINT-1-1–18446744073709550000—
    seed_4optINT-1-1–18446744073709550000—
    seed_5optINT-1-1–18446744073709550000—
    seed_6optINT-1-1–18446744073709550000—
    seed_7optINT-1-1–18446744073709550000—
    seed_8optINT-1-1–18446744073709550000—
    seed_9optINT-1-1–18446744073709550000—
    seed_10optINT-1-1–18446744073709550000—
    seed_11optINT-1-1–18446744073709550000—
    seed_12optINT-1-1–18446744073709550000—
    seed_13optINT-1-1–18446744073709550000—
    seed_14optINT-1-1–18446744073709550000—
    seed_15optINT-1-1–18446744073709550000—
    seed_16optINT-1-1–18446744073709550000—
    seed_17optINT-1-1–18446744073709550000—
    seed_18optINT-1-1–18446744073709550000—
    seed_19optINT-1-1–18446744073709550000—
    seed_20optINT-1-1–18446744073709550000—
    seed_21optINT-1-1–18446744073709550000—
    seed_22optINT-1-1–18446744073709550000—
    seed_23optINT-1-1–18446744073709550000—
    seed_24optINT-1-1–18446744073709550000—

    Outputs (1)

    NameTypeDescription
    seed_batchSEED_BATCH—