ComfyUI Adds Loop Nodes: Workflows Evolve from One-Way Graphs to Iterative Generation

ComfyUI's new loop nodes upgrade workflows from one-way flowcharts to programmable iterative systems.
ComfyUI has officially introduced general-purpose loop nodes, breaking the tool's long-standing "directed acyclic graph" execution model. Loop nodes allow workflows to repeat, feeding each round's output back as the next round's input — enabling use cases like incremental video extension and MLLM-driven automated image refinement. However, this capability significantly raises the complexity bar: users can no longer understand a workflow just by tracing connections, and must now reason about termination conditions, per-iteration state management, and backflow logic. The author sees loop nodes as a pivotal step in ComfyUI's evolution from a one-shot generator to a programmable iterative system.
ComfyUI has long been associated with the idea of a "one-way flowchart" — no matter how complex the nodes, you could generally follow the connections and understand what a workflow was doing. A newly introduced set of general-purpose loop nodes is now challenging that intuition.

What Loop Nodes Bring to the Table
The core capability of this node set is giving workflows "repeat execution" logic. The original post author used "generating the Fibonacci sequence in ComfyUI" as a tongue-in-cheek title, but the real point is this: tasks that previously required external scripts or manual repetition can now be completed entirely within the graph using core nodes.
Two immediate use cases illustrate this well:
- Video extension: Repeatedly extending a few seconds of generated video, then concatenating the results into a longer piece. The loop makes the pattern of "last output becomes next input" possible.
- Automated iterative image editing: Using a multimodal large language model (MLLM) to evaluate the quality of a generated image, then automatically revising it over and over until a condition is met.
This kind of "generate → evaluate → regenerate" closed loop is exactly where loop structures shine. It frees users from clicking "run" repeatedly and lets the workflow handle iteration on its own.
Why Loops Are Harder to Understand Than You'd Expect
The author specifically emphasizes that loops are harder to pick up than most features in ComfyUI.
The reason is that they fundamentally change how you read a workflow. Traditional ComfyUI graphs are directed and acyclic — data flows from inputs to outputs, and you only need to trace the direction of connections to understand the entire process. No matter how many nodes there are, it's essentially a linear chain of cause and effect.
Loops introduce "backflow." The output of a node gets fed back to an earlier point in the graph, serving as the input for the next iteration. This means the data on a given connection carries different meaning across different rounds, and the workflow is no longer a static structure you can grasp at a glance — it becomes a dynamic process with state and a time dimension. For users accustomed to linear thinking, this requires extra mental overhead to track "which iteration is this" and "which values persist between rounds."
In computer science, this type of structure is called a "directed cyclic graph" (the opposite of a DAG). Traditional ComfyUI workflows are strict Directed Acyclic Graphs (DAGs), where topological sorting guarantees each node executes exactly once in a uniquely determined order. Once loops are introduced, cycles appear in the graph, topological sorting breaks down, and the execution engine needs additional mechanisms to manage "how many times has this node been visited" and "when to stop." This is why loop nodes typically require companion counter nodes, conditional judgment nodes, and explicit exit signals — concepts that simply don't exist in acyclic workflows, but become elements that must be explicitly handled in looping scenarios.
Impact on the Community Workflow Ecosystem
The author expects that as loop nodes become more widespread, the community will see a growing number of workflows that leverage them. This is a trend worth watching.
Once loops become a common building block, the barrier to sharing and reusing workflows will rise accordingly — when you download someone else's workflow, you can no longer understand it just by "following the lines." You'll need to understand the loop's boundary conditions, termination logic, and state passing. To address this, the author has written a fairly detailed guide to help users avoid getting lost when they encounter loop-containing workflows. The guide is available on the loop-related pages at comfyui.nomadoor.net.
From a broader perspective, loop support marks ComfyUI's evolution from a "one-shot generator" toward a "programmable iterative system." Incremental video extension and automatic image refinement are both, at their core, about embedding AI generation capabilities inside a feedback-driven control flow. This aligns closely with the "agent loop" and "automated evaluation-correction" paradigms that have become prominent in AI applications — only here, it happens inside a visual node editor.
The "agent loop" is one of the core paradigms in modern AI application development: having a language or vision model repeatedly call tools, observe results, and decide on the next action until a goal is reached. ComfyUI's loop nodes essentially bring this paradigm into a visual node editor — the MLLM acts as the "evaluator," the image generation node acts as the "executor," and the loop structure connects them into an autonomously running closed loop. This is logically very similar to what frameworks like LangChain and AutoGen implement in code-based agent loops. The key difference is that ComfyUI provides a no-code visual path to building such systems, significantly lowering the barrier for non-developers.
Getting Started: Tips for New Users
For those who want to try it out, a few things are worth keeping in mind:
- Understand the termination condition first. The most common failure mode with loops is infinite loops or states not resetting correctly. Before you start building, think through when and how the loop stops.
- Distinguish between values that persist across iterations and those that reset. Which data needs to accumulate across rounds (like video segments being concatenated), and which needs to start fresh each round — this is the key question when designing a loop workflow.
- Start with simple cases. Don't jump straight into building a complex MLLM-driven auto-editing loop. Get familiar with loop node behavior using simple repetitive tasks first, then expand gradually.
The addition of loop nodes marks a significant step forward in ComfyUI's expressive power. While the learning curve is steeper, it also opens new possibilities for automation, long-form content generation, and intelligent feedback-driven workflows.
Related articles

Chain of Thought Isn't Just for AI: How Humans Can Use CoT to Improve Thinking Quality
Chain of Thought isn't just a prompt trick for large models. Starting from a Hacker News discussion, this article analyzes why CoT works for human thinking too, breaks down actionable ways to transfer it, and highlights the key differences between human CoT and machine CoT.
Cloudflare Teams Up with OpenAI: Closi…
Cloudflare Teams Up with OpenAI: Closing the Loop from Vulnerability Discovery to Defense with AI
Cloudflare uses OpenAI Daybreak to investigate security vulnerabilities and generate reviewable remediation plans, while developers use Codex to boost coding efficiency and quality.

Orca Multi-Agent Orchestration in Practice: A Guide to Parallel Collaboration with Claude and Codex
Orca is Stable AI's free open-source agent workbench supporting 34 agents like Claude Code and Codex in parallel. Learn its Git worktree isolation, multi-model orchestration, and mobile management.