Variable builder [darkilNodes]
A text variable with a switch, a name, and real placeholder logic
- INPUT_VAR
- VAR
- ❓help
ComfyUI's stock text node is a box you type in. This one is a box you type in and then control: a Variable builder that lets you name the value, feed in other variables, and fill the text with {{placeholders}} that resolve at run time - including random variants and date/time stamps. If you've ever wanted one text node that produces "the same prompt with the day's date and one randomly chosen style", this is it.
What you feed it
switch(BOOLEAN, default true) - master enable. When off, the node produces nothing (or just help text, depending onout_val_by_switch).out_val_by_switch(BOOLEAN, default false) - when true andswitchis off, the value output empties out.var_name(STRING) - the variable's name. If you set one, the output becomesname = value; leave it blank and you get the raw value.var_value(STRING) - the template text.INPUT_VAR(optional, BOOLEAN/INT/FLOAT/STRING/COMBO) - extra variables defined asname=valuelines. A line without=becomes the "default" value.
The placeholder language
Inside var_value you get a compact but real template syntax:
{{variable}}- inserts the resolved value of a variable defined inINPUT_VAR.{{DATE}}/{{TIME}}- current date (YYYYMMDD) and time (HHMMSS), e.g.20260816.{{IF:cond:true:false}}and{{IFNOT:cond:true:false}}- conditional text wherecondis a boolean literal, a variable name, or an expression.{{var??"fallback"}}- usevarif it resolves to something non-empty, otherwise the fallback.- Random variants: put
Hello|Hi|Heyas a variable's value and one is chosen at random each run.
Comments (#) get stripped from the template before processing, and cyclic references are detected and resolved to empty rather than hanging your graph.
The outputs
VAR(STRING) - the assembled value (name = valueor raw).❓help(STRING) - the node's own usage doc, live on a socket, which is the signature touch of this whole pack.
Where people get burned
The switch/out_val_by_switch pair confuses everyone once. switch on/off is the enable; out_val_by_switch only decides whether an off switch produces an empty string or keeps emitting help text - it's not a second enable. Also remember INPUT_VAR values are re-evaluated each run, so the random variant means every queue run may differ; if you need reproducibility, don't rely on | variants in a seed-sensitive workflow.
Installing
Part of pytraveler/comfyui-darkil-nodes. ComfyUI Manager search ComfyUI-darkil-nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/pytraveler/comfyui-darkil-nodes
Restart ComfyUI. No Python deps, no models - pure text logic.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| switch | BOOLEAN | true | — |
| out_val_by_switch | BOOLEAN | false | — |
| var_name | STRING | variable_name | — |
| var_value | STRING | — | |
| INPUT_VARopt | BOOLEAN,INT,FLOAT,STRING,COMBO | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| VAR | STRING | — |
| ❓help | STRING | — |