GetAttributeString
GetAttribute with a STRING-typed socket — not a cast
- attributes
- value
The STRING-typed sibling of GetAttribute - same name-based lookup out of a job step's attributes, but with the output socket declared STRING so it plugs directly into text inputs (a CLIP Text Encode's prompt field, a filename prefix) without you needing to worry about a wildcard connection behaving oddly.
How it works
Straight from the source: this is GetAttribute with RETURN_TYPES set to ("STRING",) and nothing else changed. The lookup is the same plain attributes[name], and - this is the part worth remembering - it does not call str() on the value for you. If the attribute genuinely holds a string (prompt text pulled from a Literal list, or a filename stem from ModelFinder), this is exactly the right node. If it holds a number instead, you'll get that number back with a STRING label on the socket; some text nodes tolerate that without complaint, others don't. These typed getters were added specifically to dodge a known ComfyUI bug with wildcard-typed outputs not always connecting to typed inputs (the pack's own source cites comfyanonymous/ComfyUI#770) - they're a connectivity fix, not a formatter.
The inputs and outputs that matter
attributes(ATTRIBUTES) - one step's values.name(STRING) - the exact attribute name, set upstream in MakeJob or EnumerateJob.
Output is a single value, typed STRING.
Where this earns its keep over the plain wildcard GetAttribute is prompt sweeps specifically - wiring a job step's prompt attribute into a CLIP Text Encode node. Text-encoding nodes are almost always strictly typed on their text input, so a wildcard connection is exactly where you're most likely to hit the ComfyUI socket bug this family of nodes was built to route around.
How to install it
Via ComfyUI Manager: search comfyui-job-iterator, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ali1234/comfyui-job-iterator
then restart. No dependencies.
Common issues & troubleshooting
A number shows up where you expected text, or vice versa. No conversion happens here - check what's actually stored in the source sequence. If you need an actual string built out of several values (not just one attribute passed straight through), reach for FormatAttributes instead, which does run everything through Python's string formatting.
KeyError at queue time. The usual cause across every one of these Get* nodes: the name doesn't match an attribute that actually exists on this step. Trace it back to the MakeJob or EnumerateJob node that should have created it.
Model stems from ModelFinder plug in cleanly here. If you're sweeping checkpoints and want the bare filename (no path, no extension) as a caption or filename fragment, ModelFinder's stems output feeds straight into a job the same way any other sequence does - pull it back out per step with this node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| attributes | ATTRIBUTES | — | |
| name | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | STRING | — |