π’ CR Trigger
Fire a boolean when your loop hits a specific index
- index
- trigger
- show_help
If you're running a loop or batch and need something to happen only once - save a grid image once every frame has rendered, fire a final step only on the last iteration - you need a boolean that flips on at exactly the right moment. CR Trigger is that node: feed it your current loop index and a target value, and it hands back a boolean you can wire into whatever needs gating.
How it works
index is your running loop position, and trigger_value is the point you want the trigger to fire at. The node compares the two and outputs trigger as the boolean result. Alongside it, index also passes straight through as its own output - a small convenience so you don't need a separate splitter node if something downstream wants both the raw index and the trigger boolean from the same source.
Because the exact comparison behavior isn't spelled out anywhere beyond the node itself, the honest advice is: wire it up, feed it a couple of test values, and check the trigger output with a preview or print node before trusting it in a long unattended run. Don't assume the comparison rule and find out the hard way three hours into a batch.
Where it actually plugs in
Comfyroll's own CR XY From Folder node - the one that assembles a folder of already-rendered images into a labeled grid - has an optional trigger boolean input, and it's a natural fit for what CR Trigger produces: rig CR Trigger to fire once your last sweep image is expected to exist, and gate the grid assembly on that, rather than triggering it prematurely on an incomplete set. The same pattern applies anywhere else in your graph that has a "only run this once, at this point" need - an index-driven trigger like this is the standard way to express that in ComfyUI without a full conditional-execution system.
The inputs and outputs that matter
index(0β9999) - your current loop position.trigger_value(0β10000) - the target you're comparing against.
Outputs: index (passthrough), trigger (BOOLEAN), plus show_help.
How to install it
ComfyUI Manager - search "Comfyroll Studio", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git
then restart. No models, no dependencies.
Common issues
Trigger never fires, or fires at the wrong time. As above, verify the comparison behavior with a test run rather than assuming - preview the trigger output across a few index values before wiring it into something with real consequences (a save, an expensive downstream node).
index isn't actually moving. This node doesn't generate or increment the index itself - it just compares whatever you feed it. If it's wired to a static widget instead of an actual loop counter (like CR Index with "control after generate" set to Increment), you'll never see the trigger flip.
If none of Comfyroll's nodes load, that's a pack-wide import failure - check your ComfyUI console for Comfyroll Studio: Failed to load ... nodes, usually a Pillow version conflict from another custom node, and reinstall Pillow or update the pack through Manager.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| index | INT | 00β9999 | β |
| trigger_value | INT | 10β10000 | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| index | INT | β |
| trigger | BOOLEAN | β |
| show_help | STRING | β |