ComfyUI-PromptSwitch ✨ Dramatically Speed Up Your Prompt Workflow! ✨
A custom node that allows you to toggle prompts ON/OFF and adjust weights as intuitively as a checklist.
🎉 Welcome to PromptSwitch on GitHub!
This project builds upon the brilliant concept of Prompt Palette, focusing on comfort and efficiency in prompt management and node operation, with major enhancements.
This node uses the following marks to distinguish the origin of each feature:
- ⚡️ [Original]: Core functions inherited from Prompt Palette
- 🆕 [Switch]: Newly added or improved features unique to PromptSwitch
🚀 Main Features of PromptSwitch
The greatest strength of this custom node lies in its ability to operate each prompt line independently, along with detailed customization options.
Feature Overview and Operation 🎮
1. Super Intuitive! Interactive Prompt Management
When the node is in non-edit mode, each line of the prompt appears like a checklist.
- ⚡️ [Original] Toggle Lines ON/OFF (Activate / Comment Out) 🟢/⚫
- Simply click on a line to instantly enable or disable that prompt. Experimenting becomes super smooth!
- ⚡️ [Original] Easy Fine-Tuning of Prompt Weights ⚖️
- Click the
[+]/[-]buttons on the right of each line to adjust weights in increments ofCONFIG.WEIGHT_STEP(default 0.10). The current weight is shown beside the buttons.
- Click the
- ⚡️ [Original] Functions Remain Active in Edit Mode ✏️
- While in Edit Mode, the node still behaves like a normal prompt input node, allowing seamless switching between editing and execution.
- 🆕 [Switch] Separator Lines for Empty Rows ✅
- Thin horizontal lines are automatically drawn for empty lines to visually separate prompt blocks for better readability.
- 🆕 [Switch] Major Visual Improvements for Readability 👀
- Auto Text Truncation: Long lines are automatically shortened to prevent layout breaking.
- Improved Comment Visibility: Lines starting with
//are treated as comments with enhanced visibility://symbols are hidden- Comment font size and color are optimized to make active prompts stand out.
2. Node Mode Switching
- ✏️ Edit Mode
- Toggle visibility of the text input area using
F2,Ekey, or double-clicking the node’s border (left, bottom, or right).
- Toggle visibility of the text input area using
- 🆕 [Switch] Minimal Mode (Visible/Invisible)
- Toggle compact display with the
Vkey:- Normal Mode (Expanded): Displays all lines for full prompt editing.
- Compact Mode (Minimized): Hides inactive lines to save canvas space.
- Toggle compact display with the
🚀 Shortcuts for Blazing Fast Workflow 💨
A set of powerful keyboard shortcuts designed for productivity.
(All of the following are unique enhancements introduced in PromptSwitch!)
⚠️ Note: The images above may reference older versions. The R key has been updated to the Random Pickup feature described below.
| Shortcut | Function | Description |
|---|---|---|
| A | Toggle All ON/OFF | Toggles all prompt lines in the selected node at once. |
| Shift + A | Force Disable All Nodes 🚨 | Comments out all prompts in every PromptSwitch node on the canvas. [Exclude Tag: /a] |
| V | Toggle Compact Mode | Hides or shows disabled lines in the selected node. |
| Shift + V | Toggle Compact Mode for All Nodes | Switches between compact/normal view for all nodes. [Exclude Tag: /v] |
| W | Reset All Weights | Resets all weights in the selected node to 1.0 (removes parentheses). |
| R | Random Pickup ✨ | Randomly activates prompts within sections separated by blank lines. Controlled by tags in the node title. |
| Shift + R | Global Random Pickup 🎲 | Executes the above random pickup for all nodes. [Exclude Tag: /r] |
| F1 | Show Help | Displays key shortcuts and exclusion tag rules for this node. |
📌 Exclusion Tag Rules & Random Pickup Extensions [Important]
- Add tags at the end of the node title to exclude it from batch operations or modify random behavior.
/a: Exclude fromShift+Abatch disable./v: Exclude fromShift+Vbatch visibility toggle./r: Exclude fromShift+Rglobal random pickup. (Bypassed/muted nodes also excluded)/R[n]: Controls the number of active items per random section for bothRandShift+R.- You can combine multiple tags, e.g.
/avR0-3.
Details for Random Pickup Count Control (
/R[n])
Tag Format Number of Active Elements Example & Behavior /R[n]Exactly nelements/R2→ Activates exactly 2 elements./R[n]-[m]Between nandmelements/R0-3→ Activates 0 to 3 elements randomly./R-[m]1 to melements/R-4→ Activates 1 to 4 elements randomly./R[m]-[n]Between nandmelements/R4-1→ Same as/R1-4(order ignored).
⚡️ [Original] Power of Text-Based Prompt Management
Prompt Palette’s text editor foundation enables powerful customization and flexibility in prompt editing.
1. Easy Import of Shared Prompts
After copying a prompt, use a text editor to replace commas with “comma + newline” before pasting into this node — instantly converting them into a line-based prompt list.
2. Using Prompt Websites + Chat AI
You can use Chat AI and prompt sharing websites to easily compile strong prompt lists and avoid repetitive searching.
- In your Chat AI, first enter the following (don’t press Enter yet):
Please extract the prompts and their comments in the format "Prompt // Comment". Insert a blank line between categories, and format it so it can be copied all at once. - Copy (
Ctrl + A,Ctrl + C) a prompt-sharing webpage’s text and paste it after the above input. - The AI will output a formatted list like “Prompt // Comment” with a one-click copy button.
- Paste that list into PromptSwitch to get an instant ready-to-use prompt set, avoiding the need to revisit websites.
🔧 Customization Options
You can tweak the behavior by editing the CONFIG object in web/index.js.
| Variable | Default | Description |
|---|---|---|
WEIGHT_STEP |
0.10 |
Weight adjustment step for [+]/[-] buttons. |
minWeight |
-1.0 |
Minimum weight limit. |
maxWeight |
2.0 |
Maximum weight limit. |
COMMENT_FONT_SCALE |
0.8 |
Font size ratio for comment lines relative to prompt lines. |
PROMPT_MAX_LENGTH_DISPLAY |
30 |
Max characters displayed before truncation. |
COLOR_PROMPT_ON |
"#FFF" |
Color for active prompts. |
COLOR_COMMENT_ON |
"#ADD8E6" |
Color for comments attached to active prompts. |
COLOR_PROMPT_OFF |
"#AAAAAA" |
Color for inactive (commented) prompts. |
COLOR_COMMENT_OFF |
"#AAAAAA" |
Color for comments attached to inactive prompts. |
⚠️ Note: Removed unused options (
ENABLE_SHIFT_A_CONFIRMATION,ENABLE_R_KEY_RESET,ENABLE_DBLCLICK_TOGGLE,COMMENT_COLOR,COMMENT_FONT_SIZE) and matched variable names to the actual implementation.
🛠️ Installation & Update
Currently pending registration for ComfyUI Manager.
Until then, please manage manually using the Git commands below.
1. Manual Installation (Git Clone)
- Navigate to your ComfyUI installation’s
custom_nodesfolder:cd /path/to/ComfyUI/custom_nodes - Clone the repository:
git clone https://github.com/Boba-svg/ComfyUI-PromptSwitch.git - Restart ComfyUI — done!
2. Update (Git Pull) 🆕
To get the latest features or fixes:
- Completely close ComfyUI.
- Navigate to the
custom_nodesfolder. - Enter the
ComfyUI-PromptSwitchdirectory:cd /path/to/ComfyUI/custom_nodes/ComfyUI-PromptSwitch - Pull the latest changes:
If you encounter overwrite errors, delete temporary files or reset with:
git pullgit reset --hard - Restart ComfyUI — update complete!
💡 How to Use
- Open the node menu (right-click or
Ctrl + Space) and locate the node under utils. - Press
F1while the node is selected to display detailed help and shortcuts.
💡 Update History
- 25/10/16 Initial release
- 25/10/17 Added exclusion tags (
/a,/v) for batch operations; removed older exclusion methods. - 25/10/20 Fixed issue where weight markers remained after reset.
- 25/10/20 Unified behavior of weight operations (with/without commas).
- 25/10/20 Removed all unnecessary flag toggling logic.
- 25/10/30 R key → Random Pickup: Added R/Shift+R random selection; moved weight reset to W key.
- 25/10/30 Extended Random Pickup: Added
/R[n]tags to specify number/range of random activations.
💡 Upcoming Features
- Exclude newline characters for empty prompt lines.
- Option to disable trailing line breaks for clean output formatting.
- Add Shift+E to open all nodes in edit mode (for browser search support).
- Fix bug preventing random behavior when multiple tags exist in node title.
🌟 Credit & Thanks 🙏
This project, ComfyUI-PromptSwitch, is an extended and enhanced version of
ComfyUI-PromptPalette
originally developed by kambara.
Huge thanks to the original author and their brilliant work!
📝 License
This project is released under the MIT License, same as the original.
See the LICENSE file for details.

