If else with two int values
The integer twin of a handy little switch
- value
If you've met IfElseFloat from the comfyui_gvf pack, this is its integer twin: same idea, whole numbers instead of decimals. IfElseInt ("If else with two int values") returns one of two ints based on a boolean input. That's the entire feature list, and honestly that's fine - it's a utility, and utilities should be boring.
It takes three inputs: if_true (INT, default 1), if_false (INT, default 0), and boolean (BOOLEAN, default false). The output, value, is an INT equal to if_true when the boolean is true, if_false otherwise. That's literally the whole node - a one-line ternary wrapped in a ComfyUI interface.
What's it for? Integer-typed parameters are everywhere in ComfyUI: seed values, sampler steps, latent width and height, batch sizes, denoise step counts. That's where this shines - toggling between two step counts (say 20 for drafts and 40 for finals), switching batch size between 1 and 4, or flipping between two width/height presets. Pair it with any comparison node feeding the boolean, and you get conditional integer logic without building a branch-and-switch tower. The float version handles decimal parameters like CFG and denoise; this one covers the integer side. If you ever wire this into a float slot and get a type error, you grabbed the wrong twin.
One honest caveat: this is the least-used node in the pack (it has essentially zero search impressions, which tells you how many people actually reach for it), and it's a slightly silly thing to install a pack for on its own. But you'll already have the pack installed if you use any of the crop or loader nodes in it, so it costs nothing to have around. There's no comparison built in - bring your own boolean from a compare/control node or a manual toggle.
Same install as everything else here - ComfyUI Manager, search "comfyui_gvf", or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/gvfarns/comfyui_gvf
Restart and it appears under the "gvf" category. No dependencies, no model downloads, nothing to configure. It won't change your life, but on the day you need a togglable step count, it's the node you'll be glad is sitting there.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| if_true | INT | 1 | — |
| if_false | INT | 0 | — |
| boolean | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | INT | — |