diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..947bfc9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Publish to Comfy registry + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "pyproject.toml" + +jobs: + publish-node: + name: Publish Custom Node to registry + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Publish Custom Node + uses: Comfy-Org/publish-node-action@main + with: + personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..40e1e52 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Cyberdelia (ComfyUI port) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index cc600db..c0ac5ea 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ # ComfyUI-PromptFormat +Prompt cleanup for ComfyUI. + +## Before / After + +One click on `✨ Format` turns this: + +![Before formatting — messy prompt with underscores and duplicates](examples/example01.png) + +...into this: + +![After formatting — underscores replaced, duplicates removed, spacing fixed](examples/example02.png) + +Note how `the_legend_of_zelda:_breath_of_the_wild` becomes `the legend of zelda:breath of the wild`, duplicates like `gloves` are removed, and colon spacing is tightened — without touching your tag weights or brackets. + ## What it does - **Dedupe tags** — removes duplicates, with optional regex-based aliases (e.g. `1girl: girl, woman, lady`). @@ -12,6 +26,8 @@ ### 1. The nodes — automatic formatting on run +![The two Cyberdelia nodes: Prompt Format and Prompt Format + Encode](examples/example03.png) + - **Prompt Format (Cyberdelia)** — string → string. Drop it between any text source and your text encoder. - **Prompt Format + Encode (Cyberdelia)** — string + CLIP → CONDITIONING. Combines formatting and CLIP encoding in one step. @@ -28,6 +44,8 @@ A `✨ Format` and `↶ Undo` button is injected into the stock text encoder nod Right-click for per-node-type toggles (dedupe / remove underscores / append comma), stored in localStorage. Exclusions and aliases aren't exposed on foreign nodes — if you need those, chain a `Prompt Format` node instead. +![Right-click context menu with Dedupe / Remove underscores / Append comma toggles](examples/example04.png) + Formatting is **not realtime** in either case. The button runs on click; the node runs on workflow execute. ## Installation diff --git a/__init__.py b/__init__.py index 15b34fc..77d7466 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,4 @@ """ComfyUI-PromptFormat — Cyberdelia -Port of sd-webui-prompt-format to ComfyUI. """ from .prompt_format import PromptFormatNode, PromptFormatEncodeNode diff --git a/examples/example01.png b/examples/example01.png new file mode 100644 index 0000000..2389408 Binary files /dev/null and b/examples/example01.png differ diff --git a/examples/example02.png b/examples/example02.png new file mode 100644 index 0000000..6491934 Binary files /dev/null and b/examples/example02.png differ diff --git a/examples/example03.png b/examples/example03.png new file mode 100644 index 0000000..46641a8 Binary files /dev/null and b/examples/example03.png differ diff --git a/examples/example04.png b/examples/example04.png new file mode 100644 index 0000000..ad8522b Binary files /dev/null and b/examples/example04.png differ