ComfyUI Custom Node: Prompt List JSON版本v1.2 (ID: 1191535)

ComfyUI Custom Node: Prompt List JSON版本v1.2 (ID: 1191535)

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 creating new prompt lists, random prompt selection, and logging prompt details to the console for seamless integration into your workflow.

Features

- ? JSON-based prompt management: Prompts are stored in individual JSON files for easy editing and retrieval.

- ? Add or update prompts: Supports creating new prompt lists, updating existing prompts, and overwriting as needed.

- ? Random prompt selection: Choose a random prompt from an existing list with ease.

- ?️ Console logging: Optionally logs prompt details with formatted outputs for debugging or verification.

- ?️ Automatic file management: Ensures required directories and files are created automatically.

Installation

1. Clone or download this repository to your ComfyUI custom node directory:

   git clone https://github.com/TKRLAB/ComfyUI_Prompt_List_JSON.git

2. Restart ComfyUI to load the custom node.

Alternative Method

1. Install using the ComfyUI manager.

Usage

Node Inputs

- Prompt List: Select an existing prompt list or create a new one.

- New List Name: Specify the name for a new list (used when creating a new list).

- 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.

- Random (boolean, default False): Enable random selection of prompts from the list.

- 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.

- Full List: The entire prompt list as a JSON string.

Example Workflow

1. Add or update a prompt with the following inputs:

- Prompt List: test.json

- New List Name: test

- Prompt Name: girl on helmet

- Positive Prompt: concept art Girl in black thin, oily latex, black motorcycle helmet, black glass on helmet, pours a bucket of yellow paint on himself, paint dripping down his body, yellow silk long scarf, sexy, dynamics. Black mirrors in the background, reflections. digital artwork, illustrative, painterly, matte painting, highly detailed

- Negative Prompt: photo, photorealistic, realism, ugly

- Overwrite: True

- Console Log: True

- Random: True

2. The prompt will be saved to the specified JSON file, and its details will appear in the console if logging is enabled.

File Structure

Prompts are stored in individual JSON files 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, full_list = manager.process(
**{
"Prompt List": "New List",
"New List Name": "NaturePrompts",
"Prompt Name": "SunsetScene",
"Positive Prompt": "A breathtaking sunset over the mountains",
"Negative Prompt": "Low quality, blurry",
"Random": False,
"Overwrite": True,
"Console Log": True
}
)

Error Handling

- Raises a ValueError if a required field (e.g., Prompt Name or Positive Prompt) is missing.

- Displays detailed error messages for debugging in the console.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

Enjoy using the Prompt List JSON node with ComfyUI! ?

描述:

训练词语:

名称: comfyuiCustomNode_v12.zip

大小 (KB): 210

类型: Archive

Pickle 扫描结果: Success

Pickle 扫描信息: No Pickle imports

病毒扫描结果: Success

ComfyUI Custom Node: Prompt List JSON

ComfyUI Custom Node: Prompt List JSON

ComfyUI Custom Node: Prompt List JSON

ComfyUI Custom Node: Prompt List JSON

资源下载
下载价格VIP专享
仅限VIP下载升级VIP
犹豫不决让我们错失一次又一次机会!!!
原文链接:https://1111down.com/1178120.html,转载请注明出处
由于网站升级,部分用户密码全部设置为111111,登入后自己修改, 并且VIP等级提升一级(包月提升至包季,包季提升到包年 包年提升至永久)
没有账号?注册  忘记密码?

社交账号快速登录