Extensions/ComfyUI-Role-Master
ComfyUI Extension

ComfyUI-Role-Master

A set of custom nodes for ComfyUI that allows you to manage, save, and load system prompts (roles) easily.

By laolaoruqin·Created 8 months ago·Updated 8 months ago· 0
laolaoruqin/ComfyUI-Role-Master
Nodes
On cloudLocal install
Stars0
Updated8 months ago
Readme

ComfyUI Role Master

A set of custom nodes for ComfyUI that allows you to manage, save, and load system prompts (roles) easily.

Features

  • 💾 Role Saver: Save your favorite system prompts with a custom name.
    • Overwrite Protection: Prevents accidental overwrites unless explicitly enabled.
    • Auto-Trim: Automatically removes leading/trailing spaces from names.
  • 📂 Role Loader (A-Z): Load saved roles sorted alphabetically.
  • 🕒 Role Loader (Time): Load saved roles sorted by creation time.
    • Ghost Text Input: Clean UI with placeholder text.
    • Flexible Outputs: Returns the combined prompt, just the role, or just the user input.
  • 🗑️ Role Deleter: Delete unwanted roles directly from the node.

Installation

  1. Navigate to your ComfyUI custom_nodes directory.
  2. Clone this repository.
    git clone https://github.com/laolaoruqin/ComfyUI-Role-Master.git
    
  3. Restart ComfyUI.

Usage

  1. Saving a Role:

    • Add the Role Saver node.
    • Enter a name and your prompt.
    • Set save_trigger to Save (default is On) and queue the prompt.
    • Enable overwrite_existing if you want to update an existing role.
  2. Loading a Role:

    • Add Role Loader (A-Z) for alphabetical sorting OR Role Loader (Time) for insertion order.
    • Select a role from the dropdown.
    • (Optional) Enter additional text in the user_input box.
    • Connect the final_prompt output to your CLIP Text Encode node.
  3. Deleting a Role:

    • Add the Role Deleter node.
    • Select the role to delete.
    • Set delete_trigger to Delete and queue the prompt.

File Structure

  • __init__.py: Entry point for ComfyUI.
  • role_nodes.py: Core logic for the nodes.
  • roles.json: Stores your saved roles.

License

MIT