Nodes/ComfyUI-Loop-image/Single Image Loop Open🐰
ComfyUI Node

Single Image Loop Open🐰

Run the same image through N passes

By WainWong·Created 2 years ago·Updated about a year ago· 44
Single Image Loop Open🐰
  • image
  • mask
  • FLOW_CONTROL
  • current_image
  • current_mask
  • max_iterations
  • iteration_count
max_iterations5

Where CyberEve_BatchImageLoopOpen is about processing different regions of an image, Single Image Loop Open is about processing the same image repeatedly - feeding each pass's result back in as the next pass's input. If you've ever chained three FaceDetailer nodes in a row because one pass wasn't enough to close the gap to your target, this node is the loop version of that instinct: instead of hand-copying your processing chain N times, you build it once and let the loop run it N times.

What it's actually for

The README lists progressive upscaling, iterative style transfer, multiple denoising passes, and gradual detail optimization as the intended cases, and they all share the same shape: each pass should build on the last, not start fresh. That's the meaningful difference from just cranking up steps or strength on a single pass - a loop lets you re-run the entire chain (sampler, detailer, color correction, whatever) multiple times, with each iteration seeing the previous iteration's actual output rather than the original.

It pairs with CyberEve_SingleImageLoopClose. Everything you wire between Open and Close runs once per iteration; Close is what tells the loop when to stop and hands you the final result.

Inputs and outputs

Required:

  • image - the starting image for iteration 0.
  • max_iterations (INT, default 5, range 1–100) - how many passes to run. This is the one knob you're actually setting by hand here, unlike the batch pipeline where iteration count gets computed for you.

Optional:

  • mask - if your processing needs to stay confined to a region across every pass (say, only refining a face over multiple detailer passes rather than the whole image), wire it in here. It carries through the loop the same way the image does.

Outputs:

  • FLOW_CONTROL - wire to CyberEve_SingleImageLoopClose's flow_control input; this is what drives the loop.
  • current_image - the image for this pass: your original image on iteration 0, and whatever the loop body produced last time on every pass after that.
  • current_mask - the mask for this pass, if you provided one.
  • max_iterations / iteration_count - pass through and current position (starting at 0), mainly useful for feeding CyberEve_LoopIndexSwitch if you want different behavior on different passes.

A trick worth knowing

iteration_count is just a plain integer output. If what you actually want out of a loop is N variations rather than N refinements - say, five different seeds of the same prompt instead of five progressive passes - you don't need a switch node at all. Convert your sampler's seed widget to an input and wire iteration_count straight into it. Each pass gets a different, deterministic seed for free, with no extra plumbing.

Installing it

Comes with the full ComfyUI-Loop-image pack. Via ComfyUI Manager: search "ComfyUI-Loop-image", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/WainWong/ComfyUI-Loop-image

No model downloads - this is control flow, so it's free to install and doesn't touch VRAM on its own. Find it under CyberEveLoop🐰 after restarting.

Common issues

The loop only runs once. Same root cause as the batch version: FLOW_CONTROL needs to actually reach CyberEve_SingleImageLoopClose. If it's dangling, you get one pass and nothing more, no matter what max_iterations says.

Results don't seem to be building on each other. Check that current_image - not the original image input - is what feeds your processing chain, and that whatever comes out the other end of your chain is what flows into CyberEve_SingleImageLoopClose's current_image input. If Close is fed the original image instead of the processed one every time, you've accidentally built a loop that repeats the same pass N times instead of accumulating.

Don't cross the streams. Pair this Open with CyberEve_SingleImageLoopClose, not CyberEve_BatchImageLoopClose - the batch Close requires a mask on every pass, the single Close treats it as optional, and they're not interchangeable.

CategoryCyberEveLoop🐰

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
max_iterationsINT51–100
maskoptMASK

Outputs (5)

NameTypeDescription
FLOW_CONTROLFLOW_CONTROL
current_imageIMAGE
current_maskMASK
max_iterationsINT
iteration_countINT