Easily replace variables like *obj or *style in your prompts using templates.
- Supports
*variablesyntax in positive/negative prompts - Two input modes:
- JSON (with custom UI: dynamic key/value fields + "Load from Prompt" button)
- Key=Value (simple multiline text)
- Auto-detects variables from prompt text
- Outputs both conditioning and raw prompts
- Navigate to your
ComfyUI/custom_nodesfolder - Clone this repository:
git clone https://github.com/DaniilVdovin/ComfyUI-prompt-templating.git- Restart ComfyUI
Add the MIM Prompt Template Json node
Write a prompt like: A *character in *outfit on *background
Add fields to json string
Connect to KSampler
Use MIM Prompt Template Key Value Enter variables as:
character=cyberpunk robotoutfit=neon armorbackground=city at night
Use MIM Prompt Template Constructor
Write a prompt like: A *character in *outfit on *background
Click "Load from Prompt" to auto-create fields for character, outfit, background
Issues: I can't display this node correctly in a smaller view; it only looks good in a larger view.
This node allows you to select a random set from a list of template parts and returns a string
Example Workflow:
JSON nodes can be freely combined with each other to get different results, such as different values for the same key, different keys for the same value, and so on. Here is a small example of implementation
(this also works with the constructor, as it is the same node as JSON but with an additional JS interface):
Example Workflows:






