Nodes/RF Nodes/Repeat (INT)
ComfyUI Node

Repeat (INT)

The batch-size glue node

By foxtrot-roger·Created 3 years ago·Updated 2 years ago· 2
Repeat (INT)
    • values
    start0
    step1
    count10

    The name is "Repeat (INT)", and once you get it, it clicks: this node exists to say "run this part of the graph N times." It takes a start, a step, and a count, and outputs a list of integers - which is exactly the shape of input a batch-capable sampler or a per-run loop wants to chew through.

    ComfyUI's whole trick is that a workflow is just a graph you rewire. Batch generation is the graph-iest thing you can do: instead of clicking generate 32 times, you feed a list into a node and let it run 32 times. The trick is getting that list. ComfyUI has no built-in "make me a sequence of numbers" primitive, so small utility packs like RF Nodes exist to fill that exact hole.

    How it works

    Under the hood it's literally Python's range(), called as range(start, start + count * step, step). That has one consequence worth burning in: count is how many numbers you get, not where you stop. start=0, step=1, count=10 gives you 0–9. Bump step to 2 and you get 0, 2, 4, 6, 8. Negative step counts down - start=10, step=-2, count=5 gives 10, 8, 6, 4, 2.

    The three inputs are all plain widgets:

    • start (default 0) - first number in the list
    • step (default 1) - how much each value jumps
    • count (default 10) - how many values, not the endpoint

    The single output, values, is an INT list. That's the wire to feed into whatever iterates a batch.

    Where you'd actually use it

    The classic move is seed variation: run the same prompt across a range of seeds to find the good ones, instead of rerolling by hand and forgetting what worked. Wire values into a seed input that accepts a list, and every element of the list becomes one run. The same pattern works for prompt lists - the KB's community threads on batch prompt variation are full of exactly this: batch 32, get 32 candidates, pick the winner. You can also use it as a poor man's counter for things like animation frame indices.

    Installing it

    It's part of the RF Nodes pack (foxtrot-roger/comfyui-rf-nodes). Easiest route is ComfyUI Manager - search "RF Nodes" and install. Or, by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/foxtrot-roger/comfyui-rf-nodes
    

    Then restart ComfyUI. The whole pack is pure Python stdlib - no requirements.txt, no pip installs, no model downloads. It's been sitting unmaintained since January 2024, but honestly there's nothing in it to rot.

    Gotchas

    • step can't be 0 - the node validates it and refuses, because range() with a 0 step is meaningless.
    • Don't confuse count with a stop value. People who read it as "range(0, 10)" get surprised when changing step changes the number of items.

    It's a tiny node, and that's the point - five seconds to drop in, one job, no surprises. If you're building any batch workflow, it's the glue you'll reach for.

    CategoryRF

    Inputs (3)

    NameTypeDefaultDescription
    startINT0
    stepINT1
    countINT10

    Outputs (1)

    NameTypeDescription
    valuesINT