https://github.com/Haoming02/comfyui-prompt-format
An Extension for ComfyUI that helps cleaning up prompts
https://github.com/Haoming02/comfyui-prompt-format
comfyui stable-diffusion
Last synced: 6 months ago
JSON representation
An Extension for ComfyUI that helps cleaning up prompts
- Host: GitHub
- URL: https://github.com/Haoming02/comfyui-prompt-format
- Owner: Haoming02
- License: mit
- Created: 2023-12-11T10:23:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-20T04:29:03.000Z (9 months ago)
- Last Synced: 2024-12-18T06:33:39.513Z (6 months ago)
- Topics: comfyui, stable-diffusion
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 33
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-comfyui - **Prompt Format**
README
# ComfyUI Prompt Format
This is an Extension for [ComfyUI](https://github.com/comfyanonymous/ComfyUI), which helps formatting texts.## Features
This adds a button to the menu, **Format**, which when clicked will:- [x] Remove extra **space**s and **comma**s
- [x] Fix misplaced **bracket**s and **comma**s
- [x] **(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 become `1girl, solo, smile`
- **eg.** `a girl walking, a girl wearing dress` will not be changed
- [x] 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)*```json
{
"promptFormat.settings": {
"CLIPTextEncode": [
"widgets_values",
true,
[
"BREAK"
]
]
}
}
```