🔶 One Time Number Switch
🔶 One Time Number Switch
- restart
- INT
- FLOAT
- Info
Frame one of a frame-by-frame animation is genuinely different from every frame after it - there's no previous frame to feed in, no prior latent to refine, nothing to img2img from. A lot of settings in Chaosaiart's system need to behave one way on that first pass and a different way for the rest of the run, and this node is the small utility that makes that switch happen automatically instead of you manually editing a value after frame one and re-queuing.
The name and field labels are a bit of a fossil worth flagging up front so you don't get thrown by them: the fields are literally called First_IMG and Rest_IMG, but they're both plain FLOAT type (default 0 and 1 respectively, range -50 to 50) - nothing image-specific about them despite the naming. Read past the labels and the behavior is straightforward: First_IMG is the value this node outputs on the first run, Rest_IMG is what it outputs on every run after that. Whether it's actually "the first run" is decided by the optional restart input, which needs to come from chaosaiart_restarter_advanced's RESTART output - without that wired in, this node has no way to know which state it's in.
A practical example of where this earns its keep: you might want a denoise value of something close to 1 on frame one (full generation from noise, since there's no starting image yet) and a much lower value on every subsequent frame (partial denoise, refining the previous frame's cached output). Wire this node's output into your sampler's denoise field instead of hardcoding one number, and that split happens for you every run without manual intervention.
Outputs come in three flavors of the same decision: INT and FLOAT versions of whichever value is currently active, so you can wire into either type of input without a separate converter node, plus Info, a text readout confirming which state (first run vs. rest) it thinks it's in - worth checking if a value doesn't seem to be switching the way you expect.
Install: search "Chaosaiart-Nodes" in ComfyUI Manager, or use "Install via Git URL" with https://github.com/chaosaiart/Chaosaiart-Nodes. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/chaosaiart/Chaosaiart-Nodes, then restart ComfyUI. On Linux, also run pip install opencv-python and pip install tqdm inside your venv.
The most likely thing to trip you up: without a live restart wire from chaosaiart_restarter_advanced, this node can't distinguish "first run" from "later run," and since it's an optional input rather than required, ComfyUI won't stop you from forgetting it - you'll just get one of the two values every single time instead of the switch you were expecting.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| First_IMG | FLOAT | 0.00-50–50 | — |
| Rest_IMG | FLOAT | 1.00-50–50 | — |
| restartopt | RESTART | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |
| FLOAT | FLOAT | — |
| Info | STRING | — |