Nodes/comfy-ovum/Widget To Int Ovum
ComfyUI Node

Widget To Int Ovum

Read any node's widget as a clean integer

By sfinktah·Created about a year ago·Updated 10 months ago· 7
Widget To Int Ovum
  • any_input
  • INT
id
widget_name
return_allfalse
node_title

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.97), 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_input link - wire anything from the target into any_input and 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, default false); 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.

Categoryovum/KJNodes

Inputs (5)

NameTypeDefaultDescription
idSTRING
widget_nameSTRING
return_allBOOLEANfalse
any_inputopt*
node_titleoptSTRING

Outputs (1)

NameTypeDescription
INTINT