LayerUtility: Integer
Integer — a plain integer, exposed as both a number and a string
- int
- string
About as simple as nodes get: you type a number, it comes out the other side as both an INT and a STRING. The reason this exists instead of just using ComfyUI's built-in primitive widget is that dual output - you get the same value in two types at once, which saves you a separate int-to-string conversion node every time you need to reuse a number both for math and for display or filename purposes.
It shows up more than you'd expect once you're building larger graphs. A single seed or count often needs to feed a numeric input (a width, a batch size, a loop counter) and a text input (a filename prefix, a debug label, a caption fragment) in the same workflow, and without a node like this you end up hunting for a separate cast node or routing through something that half-does the job. This one just does both from the start, so you wire it once and forget about it.
How it works
There's no logic beyond "hold a number." It's a constant/source node - set the value once (or drive it externally if your workflow rewires it), and both outputs stay in sync automatically, so there's no risk of the string drifting out of sync with the int the way it could if you maintained two separate widgets by hand.
The inputs and outputs that matter
int_value(default 0) - the number, with a genuinely enormous allowed range (roughly ±10^18), so it'll never actually clamp you in practice.
Outputs: int (the same value, typed for anything expecting a number - dimensions, seeds, loop counts, batch sizes) and string (the same value cast to text, typed for anything expecting a string - filename prefixes, concatenated captions, debug text). Because both fire on every execution, there's no cost to leaving one output unused if a given graph only needs the other.
How to install it
Search ComfyUI Layer Style in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
Restart; find it under 😺dzNodes → LayerUtility → Data. No dependencies to speak of.
Common issues
There's genuinely not much to go wrong with a constant node. The one thing worth knowing: if you're used to ComfyUI's native "Primitive" node auto-converting its type based on what it's plugged into, this one doesn't do that - it always outputs both an int and a string simultaneously, so if you only need one, just leave the other output unwired rather than expecting the node to reconfigure itself. Past that, it's exactly what it looks like - a typed constant, useful mostly for the convenience of not needing a separate cast node downstream, and cheap enough to sprinkle several through a graph without worrying about overhead.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| int_value | INT | 0-1000000000000000000–1000000000000000000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| int | INT | — |
| string | STRING | — |