comfyui-prompt-library
A template-based prompt library and weighted prompt editor for ComfyUI.
ComfyUI Prompt Library
A template-based prompt library and weighted prompt editor for ComfyUI. Designed and tested with Comfy Desktop.
Features
- Enable/disable prompt lines.
- Weight controls in 0.1 increments, with weighted output such as
(red hair:1.2). - Dynamic
STRINGinputs for chaining multiple Prompt Library nodes. - Create, rename, duplicate, overwrite, and delete templates.
- Create, rename, and delete folders.
- Hierarchical library view, search, favorites, and recent templates.
- Collapsible prompt groups.
- Drag-and-drop line and group reordering and group reassignment.
- Import existing prompt text with selectable delimiters.
- Simple
(text:1.2)weight normalization. - Leading
//imports as disabled lines. - Unsupported/advanced syntax is kept as raw text instead of being force-converted.
- JSON + matching TXT export whenever a template is successfully saved.
- TXT contains the exact Prompt Library output generated at save time.
- Unsaved-state indicator and internal editing history.
Installation
Copy the comfyui-prompt-library folder into:
ComfyUI/custom_nodes/
Then completely restart Comfy Desktop.
Templates are stored in:
ComfyUI/custom_nodes/comfyui-prompt-library/templates/
Templates and backup
Each template uses a JSON file plus a matching TXT file:
templates/
└── characters/
├── girl.json
└── girl.txt
The JSON is the editable source of truth. The TXT is a one-way, human-readable export of the exact generated prompt at save time.
Editing a TXT file outside ComfyUI does not update the JSON automatically. To restore from TXT, use Import, then save the resulting template.
Import
Choose a delimiter:
- Newline — one physical line becomes one Prompt Library line; commas remain part of the text.
- Comma — commas split entries; newlines remain part of an entry.
- Comma + Newline — either delimiter splits entries.
- Space — whitespace splits entries.
- None — the entire input becomes one line.
Leading // marks an imported line as disabled.
Simple explicit weights such as (red hair:1.2) are normalized into the line text and weight fields. Advanced/nested prompt syntax such as ((red hair)) is intentionally not parsed. When an explicit weight expression cannot be interpreted safely, the original input is preserved as-is.
Credits
Author: Anonymous contributor
AI development partner: OpenAI ChatGPT
This project was developed collaboratively with ChatGPT. The anonymous contributor is the publisher/maintainer; ChatGPT is credited as the AI development partner.
Release
Version 1.0.0, based on the tested v43 implementation.
License
MIT License. See LICENSE.txt.