Dragos Variable
The building block every Dragos scene is made of
- PROMPT_VAR
Dragos Variable is the smallest node in the Dragos Scene Builder pack, and it's the one you'll reach for whenever the dropdowns can't express what you need. In a pack that's all about building structured scene descriptions as JSON, this is the atom: it takes a name and a block of text and wraps them into a PROMPT_VAR - a little {"name": ..., "value": ...} object that every other Dragos node understands and passes along.
Why does that matter? Because the pack's nodes only talk to each other in PROMPT_VAR. The Structured Builder gives you preset dropdowns, but the moment you want a detail that isn't in its schema files - a specific prop, a mood, a plot point, anything free-form - this is how you inject it. Type it in, give it a name, and wire it into whatever else you're building.
How it works
The mechanism is honestly about ten lines of Python. You give it a var_name and some text; it returns a dict with those as the name and value. If you leave var_name empty it returns nothing at all, which is a silent failure mode worth knowing about - an unnamed variable just disappears from your scene instead of warning you.
The inputs that matter
Only two inputs exist, and you'll set both:
var_name(STRING, default"subject") - the key this value will get in the final scene JSON. This is the name other nodes and the compiler will see, so make it descriptive:prop,mood,lighting_note.text(STRING, multiline) - the actual content. Free text, however long you like.
The single output, PROMPT_VAR, carries your dict downstream. From here it typically feeds a Dragos Object (to group it with other variables), a Dragos Scene Compiler, or directly into a Structured Builder's input.
Where it sits in a workflow
Picture the full pipeline this pack is built around: you assemble scene data with Dragos variables/objects/structured builders, compile it into one JSON string, then hand that string to an LLM (via something like ComfyUI-Z-Image-Utilities) that converts it into a real image prompt for your model. Dragos Variable is how custom, schema-less detail enters that JSON. In practice you'll use a handful of these per scene - one per thing the dropdowns don't cover.
Installing the pack
Install the whole pack once - it ships all five nodes together:
cd ComfyUI/custom_nodes
git clone https://github.com/drago87/Dragos-SceneBuilder
Then restart ComfyUI. Or, easier, use ComfyUI Manager: search "Dragos Scene Builder" and install. There are no pip requirements - the pack is pure Python stdlib (json, os, re), so nothing extra gets installed and there are no bundled model files. That's refreshing for a custom node.
Common gotchas
- Empty
var_namesilently kills the node. It returnsNonerather than an error, so your scene just quietly misses that value. Always name your variables. - Duplicate names collapse downstream. Two variables with the same
var_namemerging into one scene means the later one wins when the compiler deep-merges. Unique names are cheap; use them. - It's not a magic text node. If you just want to feed a string into a sampler, any text node does that. This one earns its keep only when it's part of the Dragos
PROMPT_VARchain - outside that pipeline it's a very fancy label maker.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| var_name | STRING | subject | — |
| text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PROMPT_VAR | PROMPT_VAR | — |