ComfyUI Node Runs on cloud

GetAttribute

Pull a named value back out of a job step

By ali1234·Created 3 years ago·Updated 3 months ago· 130
GetAttribute
  • attributes
  • value
name

This is the node that closes the loop. You built a sequence, wrapped it into a job, ran it through JobToList to make ComfyUI actually iterate - and now you need the current step's seed, prompt, or CFG value handed back to a normal node, like a KSampler or a CLIP Text Encode, that has no idea what a "job" is. GetAttribute is that handoff.

How it works

It's a plain dictionary lookup: attributes[name]. Whatever value you stored under that name - an int from Range, a string from Literal, anything - comes back exactly as it went in, untouched. The output socket is typed as ComfyUI's wildcard *, using a small trick the pack's source calls out explicitly as a workaround for a known ComfyUI bug where wildcard outputs don't always connect cleanly to typed inputs (linked in the pack's own code as comfyanonymous/ComfyUI#770). If wiring this into a strictly-typed socket misbehaves on your ComfyUI build, that's exactly the situation the typed variants - GetAttributeInt, GetAttributeFloat, GetAttributeString - exist to sidestep.

The inputs and outputs that matter

  • attributes (ATTRIBUTES) - one step's worth of named values, from GetJobStep or a single item off JobToList's output.
  • name (STRING) - must match exactly what you named the attribute upstream, in MakeJob or EnumerateJob.

Output is a single value, wildcard-typed, ready to wire into whatever expects it.

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

KeyError and the run stops. This is, hands down, the most common way one of these workflows breaks. A name that doesn't exist in that step's dictionary - misspelled, mismatched case, or just never set upstream - raises immediately. Go back to whichever MakeJob or EnumerateJob node created the attribute and check the exact string you typed there matches what you typed here, character for character.

Wildcard output won't connect, or connects but the node downstream complains about the type. Some ComfyUI versions and some strictly-typed nodes are pickier about accepting a * connection than others. Swap in GetAttributeInt, GetAttributeFloat, or GetAttributeString instead - same lookup, just a fixed output type declared on the socket.

The value comes back as the wrong Python type for what you need. GetAttribute doesn't convert anything - you get back exactly what was stored. If a downstream node needs a float and your sequence gave you strings (say, from a Literal box typed without decimal points), fix the type at the source rather than expecting this node to coerce it.

Categoryali1234/job

Inputs (2)

NameTypeDefaultDescription
attributesATTRIBUTES
nameSTRING

Outputs (1)

NameTypeDescription
value*