First Int (else fallback) (obvpm)
One guaranteed whole number from several maybes
- int
Same node as First Float, one type over. Three integer candidates, a fallback, first one that isn't empty wins.
If you already read the First Float entry, the mechanism is identical - pins are walked in order 1 → 2 → 3, the first non-None value is returned, and if all three are empty you get the fallback widget. Here it's INT all the way through: int1, int2, int3 in, a single int out, and fallback is an integer with a 0 default.
Why integer versions earn their own node
Because steps, tile sizes, batch counts, image widths and seeds are integers, and they're exactly the values that arrive conditionally. You swap an upscale model and the tile size it wants changes. You flip to a distilled checkpoint and the step count drops from 28 to 8. Those numbers come from different branches, and whichever branch ran this time is the number you want.
The candidates are forceInput, so int1..3 are sockets - no typing numbers into them. fallback is the widget and it's always available as the floor, which is the useful part: on a run where nothing conditional fired, the graph still gets a step count instead of an error.
The behaviour to internalise
Pin order beats everything. It's not "the most recently produced value," it's "the lowest-numbered connected pin that isn't None." Your precedence is expressed by which branch you plug into which pin, so wire it deliberately and leave a comment node next to it.
Zero is a real value and will win. If int1 is connected and carrying 0 - a perfectly valid seed - it beats int2's 12345. Don't use zero as a stand-in for "unset."
Bypassed gates read as empty. This is the intended pairing. An optional gate in bypass mode emits None, which this node skips cleanly. A branch that was muted instead doesn't get to skip anything - the blocker kills the path before this node sees it - so if you want fan-in, use bypass.
The fallback range is wide (±2^53). That's the JS safe-integer limit, and you will never need it. But it does mean there's no clamping happening: nothing here will stop you feeding a steps input a value of four million. Blame yourself, not the node.
Types are checked. An INT socket won't take a LATENT or a MODEL, and mixing a float-valued wire in is the sort of thing that gets you a confusing coercion or a validation error rather than a helpful message. If the value is genuinely fractional - denoise, CFG, a scale factor - use First Float instead. Picking the wrong one of the pair is the single most common way to waste ten minutes here.
One adjacent trap worth flagging since these nodes tend to end up feeding a seed: if you're wiring the result into a KSampler's seed, the control_after_generate widget still fires on that node after the run. Set the global "widget control mode" to Before once in ComfyUI's settings, or you'll watch the seed you just carefully routed get overwritten by the thing that ran.
Install
Manager, search comfyui-obvpm. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/chanon/comfyui-obvpm
Restart ComfyUI afterward. Nothing else to install - this pack declares no Python dependencies on purpose, since everything it imports already ships with ComfyUI - and no models to download. Search obvpm in the node menu for the full set.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| fallback | INT | 0-9007199254740992–9007199254740992 | Output when none of the inputs carry a value. |
| int1opt | INT | Candidate 1: used when it is the first connected input with a value. Bypassed (None) inputs are skipped. | |
| int2opt | INT | Candidate 2: used when it is the first connected input with a value. Bypassed (None) inputs are skipped. | |
| int3opt | INT | Candidate 3: used when it is the first connected input with a value. Bypassed (None) inputs are skipped. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| int | INT | The first connected input that has a value, or the fallback. |