Aller au contenu
Node packVérifiéExterne
Ouvrir la source

ComfyUI_Prompt_List_JSON

ComfyUI JSON-based prompt management tool

Mainteneur@TKRLABUnratedClasse

Profil du package

Statut
Vérifié
Éditeur
@TKRLAB
Source
GitHub

LIREMOI

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 (ComfyUI manager)

  1. Install using the ComfyUI manager.

ComfyUI manager

Alternative Method (comfy-cli)

  1. Install comfy-cli (read docs)
    install comfy-cli
    
  2. Install custome node
    comfy node registry-install comfyui_prompt_list_json
    

Usage

Node in menu

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

Node_prev_list

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

log

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

mana

Nœuds dans ce pack

Nœud 1
  • ComfyUI_Prompt_JSON

Sources

3 sources
GitHubSourceVersion 5a96c9a9925927cc935523c9ba2a987c498078ce
github.com/TKRLAB/ComfyUI_Prompt_List_JSON

Vérifié 8 oct.

GitHubSource
github.com/TKRLAB/ComfyUI_Prompt_List_JSON

Vérifié 21 oct.

Extraits de sources

1 extrait

Source context: Repo TKRLAB/ComfyUI_Prompt_List_JSON