b8c69428ad960f48b2695d13d35785ec9ede40f2
ComfyUI Custom Node: Prompt List JSON
This repository provides a custom node for ComfyUI that allows managing positive and negative prompts in a structured JSON format. The node supports adding, updating, and logging prompts, ensuring seamless integration into your workflow.
Features
- 📂 JSON-based prompt management: Prompts are stored in a single
list.jsonfile for easy editing and retrieval. - 🔄 Add or update prompts: Supports both creating new prompts and overwriting existing ones.
- 🖥️ Console logging: Optionally logs prompt details for debugging or verification.
- 🛠️ Automatic file management: Creates necessary directories and files automatically if they do not exist.
Installation
- Clone or download this repository to your ComfyUI custom node directory:
git clone https://github.com/TKRLAB/ComfyUI_Prompt_List_JSON.git - Restart ComfyUI to load the custom node.
Usage
Node Inputs
- Prompt Name (required): A unique name for the prompt.
- Positive Prompt (required for new prompts): The positive description of the prompt.
- Negative Prompt (optional): The negative description of the prompt.
- Overwrite (boolean, default
False): Whether to overwrite an existing prompt with the same name. - Console log (boolean, default
False): Prints prompt details to the console for debugging.
Node Outputs
- Positive Prompt: The saved or retrieved positive prompt.
- Negative Prompt: The saved or retrieved negative prompt.
Example Workflow
- Add or update a prompt with the following inputs:
- The prompt will be saved to the JSON file, and its details will appear in the console if logging is enabled.
File Structure
Prompts are stored in list.json in the following format:
{
"SunsetScene": {
"positive": "A breathtaking sunset over the mountains",
"negative": "Low quality, blurry"
}
}
Adding Prompts Programmatically
You can also use this node programmatically. Here's an example:
from your_module import ComfyUI_Prompt_JSON
manager = ComfyUI_Prompt_JSON()
positive, negative = manager.process(
**{
"Prompt Name": "SunsetScene",
"Positive Prompt": "A breathtaking sunset over the mountains",
"Negative Prompt": "Low quality, blurry",
"Overwrite": True,
"Console log": True
}
)
Error Handling
License
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Enjoy using the Prompt List JSON node with ComfyUI! 🎨
Languages
Python
100%



