Nodes/comfyui_LLM_party/Interrupt Loop
ComfyUI Node

Interrupt Loop

The manual stop valve for an otherwise endless loop

By heshengtao·Created 2 years ago·Updated 6 days ago· 2,321
Interrupt Loop
  • any
  • any
is_enablefalse

ComfyUI graphs don't loop or branch on their own - every run is a straight line from start to finish. That's a problem the moment you're using this pack's iterator nodes (Excel Iterator, File Path Iterator), which happily signal is_end once they've run out of items, but do nothing to actually stop anything by themselves. Interrupt Loop is one of the pieces that closes that gap: wire a condition into it, and when it fires, it halts execution right there instead of letting the rest of the graph run.

It lives in comfyui_LLM_party's workflow category, next to Start Workflow and End Workflow - the pack's control-flow tools for graphs that need to behave less like a fixed pipeline and more like a program with an actual stopping condition.

How it works

The node passes its any input straight through to its any output - a no-op, normally. The behavior lives in is_enable: when that's true, the node interrupts execution at that point instead of just passing data through. Worth noting up front, because it's easy to miss: is_enable defaults to false here, unlike almost every other is_enable toggle in this pack, which defaults to true. That's deliberate - this node is inert until you explicitly arm it, because an interrupt node that fires by default in every graph it's dropped into would be a footgun.

The inputs and outputs that matter

  • is_enable (default false) - the actual switch. Leave it off and this node does nothing but pass data through; turn it on to make it actually interrupt.
  • any - the wildcard passthrough input. Typically wired from whatever condition or iterator output should trigger the stop.

Output: any - mirrors the input when the node isn't interrupting.

Where it fits

The natural pattern: an iterator (Excel Iterator, File Path Iterator) flips is_end once it's exhausted its items. On its own, nothing happens with that signal - a static graph just keeps re-running. Feeding that condition into this node's enable state, or into logic that flips it, is how you turn "the iterator says it's done" into "the workflow actually stops," rather than relying entirely on an external caller (an API script, a queue count) to know when to stop submitting runs.

How to install it

Search comfyui_LLM_party in ComfyUI Manager and install, then restart. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/heshengtao/comfyui_LLM_party.git

Run pip install -r requirements.txt from inside the pack's folder with ComfyUI's own Python, then restart. This node is control-flow logic with nothing of its own to install - the heavier dependencies in this large pack belong to its LLM, embedding, OCR, and TTS nodes elsewhere.

Common issues & troubleshooting

It's not stopping anything. Check is_enable first - since it defaults to false, a freshly dropped copy of this node does absolutely nothing until you flip it on or wire something into it that does.

It interrupts every single run, even when you didn't mean it to. If is_enable is being driven by an upstream boolean, confirm that value is actually what you think it is at the point this node reads it - a stray true further up the graph (a default you forgot to change, an iterator in the wrong mode) will trip this every time rather than only when you intend it to.

You wanted a soft branch, not a hard stop. This node interrupts execution - it doesn't reroute the graph down a different path. If what you actually need is conditional branching (do A instead of B based on an LLM's decision), that's a different problem than this node solves; look at how this pack's other routing-style nodes handle that instead.

Category大模型派对(llm_party)/工作流(workflow)

Inputs (2)

NameTypeDefaultDescription
is_enableBOOLEANfalse
any*

Outputs (1)

NameTypeDescription
any*