Widget To Int Ovum
Read any node's widget as a clean integer
- any_input
- INT
Your KSampler's steps widget is set to 30, and now your filename formatter needs to know that 30 - or a repeat node needs it, or a math step does. Retyping it is how drift starts. Widget To Int Ovum reads any widget off any node in your workflow and outputs its value as INT. It's the integer member of the WidgetTo trio in sfinktah's comfy-ovum pack, all three modeled on KJNodes' WidgetToString (the category is ovum/KJNodes), differing only in output type.
Where this one earns its keep: steps, seed-as-int, batch counts, any whole-number parameter that lives on one node and gets mirrored into text, math, or a loop. It's the "don't repeat yourself" move for graph editors - the value exists once, and you read it where you need it.
How it works
It digs through your workflow's serialized data (via the pack's MetadataProcessor) to find the target node, pulls the widget value, and casts it to int. The cast is tolerant: floats truncate (7.9 → 7), booleans become 0/1, numeric strings parse, and anything already an int passes through untouched.
Finding the node works three ways, and this applies to the whole trio:
- By
id- exact, but ids are only visible after you enable node-id display (Manager badge menu, per the author's notes). - By
node_title- only matches titles you set manually; auto-generated ones don't work. - By the
any_inputlink - wire anything from the target intoany_inputand it uses that link's origin. This is the recommended approach because the input doubles as an execution anchor: it guarantees the source node has run before this one reads its widget.
Inputs and output
id- STRING (required).widget_name- STRING (required).return_all- BOOLEAN (required, defaultfalse); on, returns all the node's widget values cast to int.any_input-*(optional).node_title- STRING (optional).- Output:
INT.
Install
Manager: search comfy-ovum, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart. No model downloads; nothing special in the pack's requirements for this node.
Gotchas
Leave both id and node_title blank and any_input becomes your only lookup path - unplugged, there's nothing to read. And keep the any_input connected even when you've filled in an id; its real purpose is execution ordering, and without it you can read a stale value on a rerun. Hook it up and this is one of the more reliable small nodes in a pack that doesn't always aim for reliable.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| id | STRING | — | |
| widget_name | STRING | — | |
| return_all | BOOLEAN | false | — |
| any_inputopt | * | — | |
| node_titleopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |