Nodes Browser
ComfyDeploy: How Prompt Format works in ComfyUI?
What is Prompt Format?
Add a button that formats the prompts in textfields
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
Prompt Format
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI Prompt Format
This is an Extension for ComfyUI, which helps formatting texts.
Features
This adds a button to the menu, Format, which when clicked will:
- ✅ Remove extra spaces and commas
- ✅ Fix misplaced brackets and commas
- ✅ (Optional) Remove duplicated tags found in the prompts
- Note: Only works for tag-based prompt, not sentence-based prompt
- eg.
1girl, solo, smile, 1girl
will become1girl, solo, smile
- eg.
a girl walking, a girl wearing dress
will not be changed
- eg.
- Note: Only works for tag-based prompt, not sentence-based prompt
- ✅ Respect line breaks
- Duplicates removal only checks within the same line
Configs
By default, this only processes the built-in CLIPTextEncode
node. You can add other custom nodes by adding an entry, promptFormat.settings, to the ~ComfyUI\user\default\comfy.settings.json
file.
Open a workflow
.json
to see the name for the nodes
The entries are in the format of "NodeType": ["property", dedupe?, [keep_keywords]]
- NodeType: The name of the node (eg.
"CLIPTextEncode"
) - property: The property to search for strings (Probably will always be
"widgets_values"
) - dedupe?: Should remove duplicates or not (
true
/false
) - [keep_keywords]: An array of special keywords to ignore when removing duplicates. If you have custom prompt nodes that use certain keywords, add them to the list to not get deleted.
- (eg. For
Automatic1111
, it would be["BREAK", "AND"]
as those are built-in keywords)
- (eg. For
{
"promptFormat.settings": {
"CLIPTextEncode": [
"widgets_values",
true,
[
"BREAK"
]
]
}
}