Nodes/Prompt PostProcessor/ACB PPP Select Variable
ComfyUI Node

ACB PPP Select Variable

Pull one variable out of the prompt and feed it to a detailer

By acorderob·Created 3 years ago·Updated 10 days ago· 54
ACB PPP Select Variable
  • variables
  • value
name
if_not_foundwarn
default

The ACB PPP Select Variable node is the output side of Prompt PostProcessor's variable system. The main node returns a PPP_DICT of every variable your prompt set; this node reaches into that dictionary and hands you back one value. It exists because of a genuinely clever ComfyUI pattern: build a variable inside the prompt, then reuse that exact text somewhere else in the graph.

The trick it enables

Say your prompt is a full scene with a few slots filled by wildcards:

__quality__, 1girl, ${head:__eyes__, __hair__, __expression__}, __body__, ...

The ${head:...} construct sets a variable called head to whatever those wildcards rolled. Wire the main node's variables output into this node, set name to head, and the value output gives you the resolved description - which you can feed straight into a detailer node's prompt for a face fix. The detailer only sees the head description, the main sampler sees the whole scene, and neither prompt gets cluttered with content that doesn't apply to it. That's the pattern the pack's own docs recommend, and it's the cleanest reason to install this node.

Inputs and behavior

  • variables (required) - the PPP_DICT from the main node's output.
  • name - which variable to pull. Here's the subtle bit: leave it empty and the node dumps every variable as name: value lines - a handy inspection tool. Fill it in and you get just that value.
  • if_not_found - warn (default) returns the default string with a console warning; stop raises an error instead.
  • default - the fallback value when the variable isn't in the dictionary.

The value output is untyped (*), so it plugs into most string inputs. If the input dictionary is empty or None, the node errors - so don't wire this to a disconnected main-node output and expect silence.

Install

Same pack. ComfyUI Manager → search "Prompt PostProcessor", or:

cd ComfyUI/custom_nodes
git clone https://github.com/acorderob/sd-webui-prompt-postprocessor

Restart ComfyUI. No model downloads; requirements are lark, numpy, ruamel.yaml, pydantic. MIT.

Common issues

The traps are mostly variable-naming ones. Variable names are case-sensitive and the pack reserves anything starting with an underscore for system variables (_input_seed, _modelname, _modelfullname, ...) - you can extract those too, which is how people grab the actual seed or model path that the run used. If you get a default back when you expected a value, the variable was never set: either the prompt text didn't contain the ${name:...} construct, or a conditional branch that set it didn't fire. And remember only variables that ended up in the final prompt text are reliably in the output dict - a variable set and then never echoed still appears, but a variable from a branch that was filtered out won't. Set debug_level above minimal once and read the log; it lists the system variables on each run, which beats guessing.

CategoryACB

Inputs (4)

NameTypeDefaultDescription
variablesPPP_DICTDictionary of variables to select from
nameoptSTRINGName of the variable to select
if_not_foundoptCOMBOwarnHow to handle the case when the variable name is not found in the input dictionary
defaultoptSTRINGDefault value if the variable is not found

Outputs (1)

NameTypeDescription
value*