Extract Widget From Node π
Reach into any node in the graph and read its widgets
- STRING
Extract Widget From Node is the pack's answer to a question ComfyUI doesn't answer well on its own: "what value is actually sitting in that other node's widget right now?" You type the class of a node - KSampler, LoraLoader, CLIPTextEncode - plus a comma-separated list of widget names, and it reaches into the graph's data and pulls the live values out as a multiline string.
The classic use is feeding a filename or metadata builder. Want your saved PNG named after the seed? Extract seed from KSampler, wire it into the saver. Want the model name in your metadata? Extract ckpt_name from your CheckpointLoaderSimple. Want the exact prompt that ran? Extract text from CLIPTextEncode. Because the values are read from the graph's own execution data at run time, they're always current - no hardcoding, no drift when you change the seed.
How it works. ComfyUI passes the full graph (prompt) plus node identity to nodes that ask for it via hidden inputs, and this node asks. It then matches nodes two ways: by class name (case-insensitive substring match - KSampler finds all KSamplers, extracting from every match) or by exact node ID with a # prefix (#10 targets one specific node). For each match it walks the node's inputs and pulls the requested widget values. The smart part is recursion: it digs into nested dicts, so it works with rgthree's Power Lora Loader (whose per-LoRA entries are nested dicts) and even JSON-stringified states - and it honors the on flag, skipping disabled entries. It's the same nested-structure handling the KB's plumbing doc describes for widget extraction in the rgthree era.
Inputs and outputs. Required: node_name (class name or #ID) and widget_names (comma-separated; leave empty to dump everything). One output, STRING - values joined by newlines, so one value per line when extracting multiple. The node declares always-changed, so it re-reads the graph every run rather than trusting the cache - cheap for a string read, and it means your filename gets the current seed, not a stale one.
Install.
cd ComfyUI/custom_nodes
git clone https://github.com/tetsuoo-online/Comfyui-TOO-Pack
or ComfyUI Manager β "Comfyui-TOO-Pack" β restart.
Where people trip. Widget names must match what the node actually calls its fields - for the standard LoraLoader that's lora_name and strength_model, not lora. The tooltips on the inputs give you the exact spellings for the common cases, and they're worth reading because the default in the box (lora, strength) targets the rgthree loader, not the stock one. Also, class matching is a substring match, so KSampler also matches KSamplerAdvanced; if that ambiguity bites, use the #ID form instead. For feeding dynamic values into names and metadata, this is the node that makes it click.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| node_name | STRING | Power Lora Loader | The class type of the node to extract from (e.g., 'Power Lora Loader', 'LoraLoader', 'KSampler') OR the node ID (e.g., '#180', '#42') |
| widget_names | STRING | lora, strength | Comma-separated list of widgets to extract. Examples: 'lora, strength' for Power Lora Loader (rgthree), 'lora_name, strength_model' for LoraLoader, 'seed, steps, cfg' for KSampler. Leave empty to extract all widgets. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |