Nodes/Bjornulf_custom_nodes/♻ Loop (Integer)
ComfyUI Node

♻ Loop (Integer)

Loop Integer (Bjornulf_custom_nodes) — ComfyUI Node Guide

By justUmen·Created 2 years ago·Updated about a year ago· 545
♻ Loop (Integer)
    • INT
    from_this0
    to_that10
    jump1

    The integer version of Bjornulf's range-loop nodes - good for anything you'd normally scrub through as a whole number: sampler steps, batch counts, a seed offset, anything on a KSampler or elsewhere that takes an INT widget. Set a start, an end, a step size, and let ComfyUI's execution engine run through every value in between.

    How it works

    from_this, to_that, and jump describe the range, and the node outputs it as a list of integers. Because ComfyUI treats a list output as "run everything downstream once per item," connecting this into, say, a KSampler's steps input means your workflow will render once at each step count in the range - no manual re-queuing between values.

    Inputs and outputs

    from_this (INT, default 0, 0–1000, step 1), to_that (INT, default 10, same range), jump (INT, default 1, same range). Output: an INT list. To actually wire this into a KSampler parameter, right-click the widget (steps, for example) and choose "Convert widget to input" first - plain number widgets in ComfyUI don't expose a socket until you do that.

    Installing it

    Ships with the rest of Bjornulf_custom_nodes. ComfyUI Manager → search the pack title → install → restart, or cd ComfyUI/custom_nodes && git clone https://github.com/justUmen/Bjornulf_custom_nodes and restart manually. No dependency specific to this node.

    Common issues & troubleshooting

    If you're using this to sweep steps on a KSampler for a quick "what step count is enough" comparison, know going in that the author's own README flags this specific use case as not optimized - the node itself is fine, but looping steps re-runs the entire sampling process from scratch at each value rather than reusing any work between them. It's genuinely useful for eyeballing results across a range, but don't expect it to be fast; treat it as "good enough for quick testing," which is the exact phrase the README uses, not a production-speed comparison tool.

    The usual list-loop budgeting applies: a wide range with a tight jump queues a lot of full runs. Sweeping steps from 10 to 50 by 1 is 41 complete generations. Start with a coarse step to find the interesting range, then narrow it if you need finer resolution.

    And the same seed-consistency note as the Float version applies here: a loop by itself keeps the same seed across every iteration, which is what you want for a fair steps-vs-quality comparison, but it means back-to-back outputs can look suspiciously similar if you were expecting variety rather than a controlled sweep. If you actually wanted different results each iteration, combine this with Bjornulf's Text with Random Seed node rather than assuming the loop alone randomizes anything.

    CategoryBjornulf

    Inputs (3)

    NameTypeDefaultDescription
    from_thisINT00–1000
    to_thatINT100–1000
    jumpINT10–1000

    Outputs (1)

    NameTypeDescription
    INTINT