PromptDecodeV2
Keep your prompt library in a TOML file and roll a new look from one seed
- toml
- STRING
- STRING
- STRING
- INT
- STRING
- STRING
- LOAD_REFERENCES
PromptDecodeV2 is a prompt manager, not an encoder. You keep prompt fragments in a .toml file - hair colours, poses, locations, quality stacks, LoRA tags - and the node assembles the ones you asked for into two plain strings you feed a CLIP text encode. Ask it for a random variant and the same seed rolls the same one back.
The TOML is a small prompt library
The file is a tree of named fragments. _t is the text of a fragment; nested tables extend its path:
[base]
_t = "score_9, score_8_up, source_anime"
[base.girl]
_t = "1girl, detailed face, $base.girl.color hair"
color = ["blonde", "blue", "black"]
[base.girl.hair]
blonde = "blonde hair"
blue = "blue hair"
That $base.girl.color is the trick that makes the setup worth it: it resolves to one of the list entries, so one fragment gives you a different girl every run. LoRA tags work the same way. Write <lora:twintails.safetensors:1> in a fragment and it's pulled out into a separate LoRA list, with the tag replaced by whatever prompt you stored in the file's ["<lora>"] table - trigger words travel with the LoRA instead of being copy-pasted next to it. Best idea in this pack.
What you actually type: key_name_list
The multiline box whose tooltip says "Select Key Name" decides what gets assembled:
base.girl- that fragment plus everything above it, with duplicate text collapsed, so you can nest freely without repeating yourself.base.girl.?- one child at random (.?for a child of anything,.??for any descendant).base.girl+boy- two branches in one prompt, for building a scene out of unrelated fragments.{a|b|c}- inline pick, then<?route fix base girl>to pin it once you find a look you like.
Comment lines with //, # or /* */. The picks are seed-driven, so this is a controlled roll rather than a lottery - and there's far more syntax in the README.
The inputs that matter
Three, all required, no optional slots. toml is the PROMPT_FILE - wire it from the pack's PromptLoader, whose dropdown is built by walking custom_nodes/comfyui-toml-prompt/prompts/, and which only lists .txt, .toml, .yaml and .yml, so your file has to live in that folder. The pack ships a prompt.sample.toml as a template. key_name_list is the list above. seed drives every random pick: same seed, same file, same key list, same prompt.
The nine outputs, and where they go
Positive and negative STRINGs go into your text encode - core CLIPTextEncode, or the pack's MultipartCLIPTextEncode, which takes the LoRA list too and gives back MODEL/CLIP/CONDITIONING. The LoRA STRING also works with LoadLoraFromLoraList, and SplitLoraList handles Wan-style high/low noise splits.
The INT seed is echoed back out, so one number drives prompt and sampler together. STRING Summary is a readable receipt: exports, then the positive, negative and LoRA lines actually used. STRING Exports is the JSON form of your [_exports] table - wire it to the pack's KSamplerFromJsonInfo and steps, cfg, sampler and scheduler come off your prompt file too.
Then three IMAGE outputs, loaded by path from inside the TOML (<?load picture 1 input/ref.png>) - prompt, LoRAs, sampler values and the reference picture, all described by one file. Slots you didn't declare come out as None, so put NoneToEmptyImage in front of anything that insists on pixels.
Install
ComfyUI Manager: search comfyui-toml-prompt, or install it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/morino-kumasan/comfyui-toml-prompt
Restart fully - the pack registers a frontend extension. requirements.txt is empty and there are no models, so the README's pip line installs nothing. Two traps: the README still calls the repo comfyui-utils and gives an SSH clone URL that fails without keys (use the one above), and the code needs Python 3.12, so an old 3.10/3.11 venv won't import it at all.
Where people get burned
- Unknown key. A
key_name_listline naming a nonexistent fragment kills the run withVariable not found: base.hair. - LoRA paths. TOML strings eat backslashes: write
"dir\\lora.safetensors"or use forward slashes. Subfolder LoRAs are the usual culprit. - A seed you let randomize. With widget control mode on After, the box shows the next seed, not the one that made the image you liked. Copy it out of the Summary, or set the mode to Before.
- A forty-keyword negative doing nothing. At CFG 1, where distilled video and turbo models run, the negative output is never computed. Keep the tradition for SDXL-lineage anime checkpoints at CFG 4-9, where it does work.
- Black frames. The picture path is opened relative to ComfyUI's working directory, and a miss is silent: placeholder instead of error.
- The README documents the older
PromptDecode, still registered and still in the sample workflows. Same language; V2 adds the Summary/Exports split and the image slots.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| key_name_list | STRING | Select Key Name | |
| seed | INT | 00–18446744073709550000 | Random seed. |
| toml | PROMPT_FILE | TOML format prompt. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | Positive prompt |
| STRING | STRING | Negative prompt |
| STRING | STRING | Loaded LoRA name list |
| INT | INT | Random seed |
| STRING | STRING | Summary |
| STRING | STRING | Exports |
| LOAD_REFERENCES | LOAD_REFERENCES | References |