LC Widget To String
Read Any Widget as Text — Without Typing It Twice
- any_input
- STRING
Ever needed a value that lives inside another node's widget but has no wire out? A Load Video's filename, a KSampler's current seed, the prompt sitting in a CLIP Text Encode? LC Widget To String is the answer: it reads a widget off any node in your graph and hands it to you as a plain STRING, so you can stuff it into a filename prefix, a Show Text node, a saved log, whatever. You're basically asking ComfyUI "what is that box showing right now?" and getting the answer as text.
This is one node inside lonecatone23's big LC123 grab-bag (103+ Python nodes of "small tools that remove friction"), and honestly it's a niche one. It's not for everyone - but the day you need it, you need it. There's no other way to reach a widget value that the node doesn't already expose as a socket.
What it actually is
Straight from the source docstring: this is KJNodes' WidgetToString, re-named and re-worked. Kijai's original is the canonical version of this idea, and it's the node people in r/comfyui actually reach for when they want, say, the source video's filename turned into a filename_prefix for a Save Video node.
The LC fork's one real improvement over the original: in Kijai's node the any_input socket does nothing except pin execution order - you target a node by its numeric ID or its manually-edited title. Here any_input is genuinely functional. Wire any output of the node you want to read into it, and this node follows the link back to the source and reads its widgets. That's a friendlier workflow, because node IDs are invisible until you turn on the badge and titles only exist if you've edited them.
There's also a "dormant" safety: with no any_input wire, id at 0, and no title, the node returns an empty string without searching the graph - no errors, just silent nothing until you wake it up. Wire it (or set an id/title) and it starts reading.
The inputs that matter
Four things actually get you going:
any_input(*) - wire this to the node you want to read. It accepts any type, so just grab whatever socket the target has spare.widget_name(STRING) - the widget's internal name, likeseedorfilename_prefix. Comma-separate several names and you get each back asname: value. Get it wrong and you silently get"", so it pays to right-click the target → Convert widget to input once just to see the exact name.return_all(BOOLEAN) - dump every widget on the target asname: valuepairs instead of picking one.node_title(STRING) - target by a title you manually set, handy when the node's ID isn't stable across edits.
There's also id (INT, target by node number) and allowed_float_decimals (default 2) for float formatting. Title beats id beats any_input if you set more than one, by the way.
The single output is STRING - the raw value when you name one widget, formatted pairs otherwise.
How it works
When it wakes, it reads the live workflow structure and the executed graph the backend hands it, resolves which node is on the other end of your any_input wire (it even follows into subgraphs), then pulls that node's current widget values out of the prompt and formats them. Its IS_CHANGED returns NaN whenever it's awake, so it re-runs every queue and always reflects the value now - no stale string from last run.
A real use
Wire a Load Video's output into any_input, set widget_name to filename, and out comes the file name as text - feed that STRING into a text combiner or a Save Image prefix. Same trick grabs a seed for a batch log, or a model name for a "what made this" note. Because this node reads the typed widget value and not whatever wire feeds it, values that come in over a link (widgets you've converted to inputs) generally aren't readable here - there's nothing baked in to grab.
Install and gotchas
Install via ComfyUI Manager (search ComfyUI_LC123_nodes), or:
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
Then restart ComfyUI and confirm the console prints the [LC123] load line. No extra pip packages - it only needs ComfyUI's own Python env. The classic install trip-up: __init__.py must sit directly in custom_nodes/ComfyUI_LC123_nodes/, not in a nested ComfyUI_LC123_nodes/ComfyUI_LC123_nodes/ folder if you unzipped wrong.
If it returns "" and you expected a value, you're almost certainly still dormant - wire any_input or set an id/title, and make sure widget_name matches the widget's real internal name exactly.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| id | INT | 00–100000 | Target node id. 0 = unused (use any_input or title). |
| widget_name | STRING | Widget name, or comma-separated list. | |
| return_all | BOOLEAN | false | Dump every widget on the target as name: value. |
| any_inputopt | * | Wire this to the node you want to read. Required for dormant-until-wired behavior. Also used when id and title are empty. | |
| node_titleopt | STRING | Match a manually edited node title. | |
| allowed_float_decimalsopt | INT | 20–10 | Decimal places for floats. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |