Nodes/Chaosaiart-Nodes/🔶 Switch on Frame
ComfyUI Node

🔶 Switch on Frame

A one-time, permanent cutover at a chosen frame count

By chaosaiart·Created 2 years ago·Updated about a year ago· 117
🔶 Switch on Frame
  • activ_frame
  • source_before_frame
  • source_after_frame
  • SOURCE
â—„Switch_frame30â–º

Where chaosaiart_Any_Switch can alternate back and forth every frame or flip once and stay, this node only does the second thing - and it does it off an exact frame number you choose, rather than counting alternations. Below your chosen threshold it outputs one source; the moment the frame counter reaches or passes it, it switches to the other source and stays there for the rest of the run. Simple, one-directional, no going back.

That makes it the right tool for a hard cutover: run the first half of a long batch with one ControlNet image, one prompt, one anything, then switch cleanly to a different one exactly at frame 30 (or wherever you set it) for the rest. Compare that to Any_Switch's "Switch: 1-2-1-2.." mode, which alternates every single frame - if what you actually want is a single clean transition partway through a sequence rather than constant back-and-forth, this is the simpler node for it.

Inputs and outputs

  • activ_frame - required ACTIV_FRAME, the running counter from Chaosaiart's convert node.
  • source_before_frame, source_after_frame - required, wildcard * type. Whatever you're switching between - images, conditioning, a model, anything downstream expects.
  • Switch_frame - required INT, default 30, min 1. The frame count where the cutover happens.
  • Output: SOURCE - whichever of the two is currently active.

Since both sources are wildcard-typed, keep them the same actual type - the node won't stop you from mixing an image and a string, but whatever's downstream will.

Installing it

ComfyUI Manager: Install via Git URL → https://github.com/chaosaiart/Chaosaiart-Nodes, exactly the method the README documents. A title search for "Chaosaiart" should also find it.

Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/chaosaiart/Chaosaiart-Nodes

Linux (activate your venv first, if you use one):

pip install opencv-python
pip install tqdm

Windows: use the bundled Install_windows script instead. Restart ComfyUI afterward. No models to download - this node only routes existing data.

Common issues

It never seems to switch. Check Switch_frame against how many generations you're actually queuing in the batch - if it's set to 30 and you only ever run 15, source_after_frame never activates. Remember "frame" here means one queue run, not a point in a video timeline.

No restart input, unlike some of the pack's other switch nodes. Once it's crossed the threshold, there's nothing here to reset it back - if you need to run a fresh sequence that starts over at source_before_frame, that has to come from resetting whatever's feeding activ_frame upstream (typically via a RESTART signal into the counter logic before it), not from this node itself.

Whole-pack import failures. All ~20 Chaosaiart nodes share one Python module - a broken opencv-python/tqdm install takes the entire pack offline, this node included. Check your ComfyUI startup console for an import error before assuming the node itself is broken.

Category🔶Chaosaiart/switch

Inputs (4)

NameTypeDefaultDescription
activ_frameACTIV_FRAME—
source_before_frame*—
source_after_frame*—
Switch_frameINT301–18446744073709550000—

Outputs (1)

NameTypeDescription
SOURCE*—