โจโ๐ข Anything to Int
Force a strict INT socket to accept whatever you've got
- anything
- integer
Bjornulf's pack leans hard on wildcard (*) types - list loopers, variable nodes, and converters all tend to output "anything" rather than a specific type, which keeps the pack flexible but breaks the moment you try to plug that value into a ComfyUI input that insists on a strict INT: steps, batch size, an index. This node closes that gap. Whatever comes in, it comes out as a real INT.
How it works
One wildcard input, one INT output - the node doesn't do anything more elaborate than converting whatever type actually arrived into an integer. It's a type adapter, not a math node: no rounding rules exposed, no clamping to a range, no validation beyond the conversion itself. It exists purely to satisfy ComfyUI's strict socket typing when the value flowing through your graph is already the right number, just wrapped in the wrong type.
The situations where this comes up are predictable: a value coming out of a loop node, a Select from List node, or one of the pack's other wildcard converters, headed toward a KSampler's steps, a batch count, or an index field like the one on Select an Image, Pick. Any of those refuse a wildcard connection outright; this node is the one-hop fix.
The inputs and outputs that matter
anything(required, wildcard*) - connect whatever you've got.- Output
integer(INT) - the converted value, ready for any strict INT input.
That's the entire node. If the source value isn't cleanly numeric, the conversion is only as good as what came in - this node can't recover meaning from genuinely non-numeric text.
How to install it
ComfyUI Manager โ search Bjornulf_custom_nodes โ install โ restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
pip install -r Bjornulf_custom_nodes/requirements.txt
No special dependency - a pure type-conversion utility that loads regardless of what else in the pack you've installed.
Common issues & troubleshooting
The value downstream still looks wrong. Double-check that the node you're feeding is actually receiving this node's integer output, and not the original wildcard wire left connected in parallel - a common mistake when retrofitting this converter into an existing graph.
I expected an error but got a strange number instead. This converter doesn't validate that the input made sense as an integer - feed it something that isn't cleanly numeric and you may get a fallback value rather than a clear failure. If a number downstream looks off, trace it back with a Show node one step at a time rather than assuming this converter caught the mistake for you.
Do I actually need this, or can I wire directly? If your source node already outputs a proper INT, skip this entirely - it only earns its place where a wildcard-typed output meets a strictly-typed input and ComfyUI won't let you connect them directly.
Should I use this or Anything to Float? Match it to what the target socket wants. Whole-number inputs - steps, batch size, an index - want this one; continuous values like cfg or denoise want Anything to Float instead.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| anything | * | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| integer | INT | โ |