ComfyUI Node

PromptDecode

The same node as PromptDecode, under a second name

By morino-kumasan·Created 2 years ago·Updated a day ago· 1
PromptDecode
  • toml
  • STRING
  • STRING
  • STRING
  • INT
  • STRING
  • STRING
key_name_list
seed0

Search the node list in this pack and you'll find two entries that both display as PromptDecode: one registered as PromptDecode and one as TomlPromptDecode. There is no second node. Look at the pack's __init__.py and both registry keys point at the same Python class.

So this page is mostly a "don't go looking for a difference" page - but there is one real question it answers, and it's a practical one: which one do I have, and what happens when I share a workflow?

What's going on

The pack registers its classes twice:

NODE_CLASS_MAPPINGS = {
    "PromptDecode": PromptDecode,
    "TomlPromptDecode": PromptDecode,
}
NODE_DISPLAY_NAME_MAPPINGS = {
    "PromptDecode": "PromptDecode",
    "TomlPromptDecode": "PromptDecode",
}

The registry key is what a saved workflow writes into its JSON; the display name is what the node menu and the node's title bar show. Two keys with one display name means a workflow saved with either id loads fine, as long as this pack is installed - and the node behaves identically either way, because it is identical.

Why does the alias exist? Most likely because the pack's repo was renamed at some point (comfyui-utilscomfyui-toml-prompt, which is why the README's install block is still wrong) and an alias for the old id keeps previously-saved workflows working. This kind of thing is common in ComfyUI packs and completely invisible until something goes missing.

What that means for you

For daily use: pick either from the node menu, they're the same. If you're debugging a workflow that won't load with "node type not found" pointing at TomlPromptDecode, the answer is that the pack isn't installed - not that you need some other pack.

If you're writing a workflow that other people will run, the safe assumption is that the workflow needs this pack, whichever of the two names is inside it, and that any pack update could change either id. That's the ordinary ComfyUI distribution problem: a workflow is a graph of node-type ids, and ids belong to packs.

For what the node actually does with the TOML file - the _t blocks, $ substitution, the _k/_w/_r random controls, the key-list syntax, the LoRA tags, and the six outputs - see the PromptDecode page. Its inputs are the same three (toml, key_name_list, seed) and its outputs are the same six (positive, negative, LoRA list, seed, summary, exports), because it's the same code.

Install

Manager search for the pack, or:

cd ComfyUI/custom_nodes
git clone https://github.com/morino-kumasan/comfyui-toml-prompt

then restart ComfyUI. Nothing to pip install - the repo's requirements.txt is empty - but you need Python 3.11+ for the stdlib tomllib the pack uses to parse your prompt files, plus a PromptLoader on the toml input, since that socket is a PROMPT_FILE and won't take a plain string.

The one thing people actually get wrong

They install the pack twice - once under a comfyui-utils folder name from the old README, once under the correct name from Manager - and end up with duplicate node ids, a startup warning, and a coin flip over which copy's Python code is the one actually running. If you cloned the repo by hand after an earlier attempt, check custom_nodes/ for both folder names and delete the stale one.

Categoryutils

Inputs (3)

NameTypeDefaultDescription
key_name_listSTRINGSelect Key Name
seedINT00–18446744073709550000Random seed.
tomlPROMPT_FILETOML format prompt.

Outputs (6)

NameTypeDescription
STRINGSTRINGPositive prompt
STRINGSTRINGNegative prompt
STRINGSTRINGLoaded LoRA name list
INTINTRandom seed
STRINGSTRINGSummary
STRINGSTRINGExports