CivArchive
    ComfyUi Advansed Prompting - v1.67
    Preview 150008669

    ComfyUI-CLIPTextEncodePro

    A smarter prompt box for ComfyUI. CLIP Text Encode (Pro Editor) is a drop-in replacement for the stock CLIP Text Encode node with a toolbar for searching the prompt, highlighting repeated tags, removing duplicates, commenting tags out with Ctrl+/ and (experimental) sorting tags by category.

    It is a new node: the stock CLIP Text Encode is not modified, so you can use both side by side.

    English documentation. The node UI is also in English.



    Features at a glance

    Feature What it does Status πŸ” Prompt search Find text in the prompt, highlight all matches, jump between them Stable 🎨 Duplicate highlighting Repeated tags (comma-to-comma / period-to-period) get a color per group Stable βœ‚ Remove duplicates One click removes repeated tags, keeping the first one Stable πŸ’¬ Comments (Ctrl+/) Comment tags in/out like in a code editor; commented tags never reach the model Stable πŸ“ Min width / height Set a minimum node width and prompt-field height Stable πŸ’Ύ Per-workflow settings Toolbar settings are saved inside the workflow; "Save as default" for new nodes Stable πŸ”Œ Autocomplete friendly The prompt field is the stock ComfyUI textarea, so autocomplete add-ons keep working Stable β‡… Sort by category Groups tags: quality β†’ subject β†’ clothing β†’ pose β†’ … πŸ§ͺ Beta


    Installation

    1. Download the repository as a ZIP.

    2. Extract it so that the folder ComfyUI-CLIPTextEncodePro ends up inside ComfyUI/custom_nodes/.

    The final layout should look like this:

    ComfyUI/
    └── custom_nodes/
        └── ComfyUI-CLIPTextEncodePro/
            β”œβ”€β”€ __init__.py
            β”œβ”€β”€ nodes.py
            β”œβ”€β”€ prompt_tools.py
            β”œβ”€β”€ categories.json
            └── js/
                └── clip_text_encode_pro.js
    

    Finish

    1. Restart ComfyUI.

    2. Hard-refresh the browser tab (Ctrl+F5 / Cmd+Shift+R) so the new JavaScript is loaded.

    3. Double-click the canvas, search for CLIP Text Encode (Pro Editor) and add it.

    Requirements: a recent ComfyUI with its current frontend. No extra Python packages are needed.


    Quick start

    1. Add CLIP Text Encode (Pro Editor).

    2. Connect your CLIP (from the checkpoint loader) to the clip input.

    3. Connect the conditioning output to your sampler's positive (or negative) input, exactly like the stock node.

    4. Type your prompt in the big text box.

    5. Use the toolbar above the text box:

    You want to… Do this Find a word in a long prompt Type it in the πŸ” search box, press Enter for the next match See repeated tags Just type: repeats are highlighted automatically, and ⚠ N shows how many groups repeat Remove repeated tags Click βœ‚ Dupes Temporarily disable a tag Put the cursor in it and press Ctrl+/ Make the node bigger by default Set Min W / Min H in the second toolbar row



    🎨 Duplicate highlighting & removal

    What counts as a tag? Everything between two commas or two periods (a line break can also be a separator - see the setting). Periods inside numbers like 1.2 are not separators.

    What counts as a duplicate? Two tags that are identical after normalization:

    • case is ignored (optional),

    • underscores = spaces (long_hair = long hair),

    • weights and brackets are ignored (optional): (red hair:1.2) = red hair.

    Each group of identical tags gets its own color, and all occurrences are highlighted.

    retro, 1girl, retro artstyle, (smile:1.1), retro, Smile
     ^^^^^                         ^^^^^^^^^   ^^^^^  ^^^^^
     'retro' Γ—2 (one color)        'smile' Γ—2 (another color)
    

    Click βœ‚ Dupes to remove repeats - the first tag of each group stays:

    before: retro, 1girl, retro artstyle, (smile:1.1), retro, Smile
    after : retro, 1girl, retro artstyle, (smile:1.1)
    

    Good to know:

    • βœ‚ Dupes uses exactly the same rules as the highlight, so what you see highlighted is what gets removed.

    • Fragments cut out of the middle of a bracket group, like (a, b:1.2), are never touched, so brackets can't be broken.

    • BREAK is ignored. Commented tags are ignored too.

    • Hover the ⚠ N counter to see which tags repeat.


    πŸ’¬ Comments (Ctrl+/)

    Comment tags in and out like in a code editor (Cmd+/ on macOS). Works on a non-Latin keyboard layout too (it listens to the physical / key).

    before:  1girl, red dress, smile
    Ctrl+/:  1girl, /* red dress */, smile      ← cursor was inside "red dress"
    Ctrl+/:  1girl, red dress, smile            ← toggled back
    

    Situation Result No selection The tag under the cursor is toggled Several tags selected All tags touched by the selection are toggled Selection mixes commented and normal tags Everything becomes commented (press again to uncomment all) /* a, b */ or // … comments you typed yourself Treated as one commented tag; Ctrl+/ uncomments it

    Commented tags never reach the model:

    • The node strips /* … */ and // comments itself before encoding and tidies the leftover commas (a, /* b */, c β†’ a, c). Recent ComfyUI frontends also strip them from dynamic-prompt text boxes when queueing.

    • The text output returns the already cleaned prompt.

    • In the editor commented tags get a gray background (the text color itself can't be changed inside a textarea).

    • Commented tags are ignored by duplicate detection, and they stay intact when sorting.

    [!NOTE] Because // starts a line comment, avoid writing things like http://… inside a prompt.


    πŸ§ͺ Sorting by category (BETA)

    [!WARNING] Sorting is a BETA feature and still a work in progress. It is based on a keyword list, not on AI, so it will sometimes put a tag in a debatable place or push unknown tags to the end. We recommend keeping it turned off (leave auto_sort on off and don't use the β‡… button) unless you are happy to review and tune the result. Everything else in this node works without it.

    How it works

    1. The prompt is split into tags by commas and line breaks. Commas inside (), [], {}, <> and inside comments do not split a tag, so (masterpiece, best quality:1.2) and <lora:name:0.8> stay whole. If the prompt contains BREAK, each block is sorted separately.

    2. Each tag is normalized for matching (brackets and trailing weight removed, _ β†’ space, lowercase). The tag in the output keeps its original look.

    3. The tag is assigned to the first category in categories.json that has a matching keyword. Matching is by whole word/phrase: dress matches red dress but not address.

    4. Unmatched tags go to other, at the end.

    5. Inside each category the original order is preserved.

    Category order in the result:

    LoRA / embeddings β†’ quality β†’ subject β†’ clothing β†’ expression β†’ appearance β†’ pose β†’ background β†’ lighting β†’ camera β†’ style β†’ other

    before: red dress, 1girl, smile, masterpiece, long hair, sitting, <lora:x:0.8>, forest, best quality, from above
    after : <lora:x:0.8>, masterpiece, best quality, 1girl, red dress, smile, long hair, sitting, forest, from above
    

    πŸ“ Layout settings

    • Min W - the node can't be made narrower than this (default 380).

    • Min H - the prompt text box can't be shorter than this (default 160).

    Both are in pixels, saved with the workflow, and can be made the default with πŸ’Ύ Save as default in βš™.


    Autocomplete compatibility

    The prompt field is the stock ComfyUI multiline widget. The node never replaces, re-creates or re-parents it. Tag-autocomplete add-ons therefore see a perfectly normal prompt field, whether they attach through the widget API or watch the page for text areas.

    The toolbar is a separate widget above the field, and the highlight layer is a separate element that exists only while there is something to highlight (repeats, search matches or comments). It also checks itself: if it ever ends up covering the text, it switches itself off, so your prompt always stays visible.



    Description

    # CLIP Text Encode (Pro Editor) - a smarter prompt box for ComfyUI

    A drop-in upgrade for the stock CLIP Text Encode node. Search your prompt, see repeated tags highlighted, remove duplicates in one click, comment tags out with Ctrl+/, save reusable snippets, go back through your prompt history, and set your quality tags once so they are always added on top.

    It is a new node, so the stock CLIP Text Encode is not touched. You can use both side by side.

    No extra Python packages. Works with tag autocomplete add-ons.

    ---

    ## ✨ What it does

    πŸ” Prompt search

    Type in the search box above the prompt: all matches are highlighted and the current one is orange. Enter = next match, Shift+Enter = previous, Esc = clear. A counter shows 3/7.

    🎨 Repeated tag highlighting

    Tags (everything between two commas, or two periods) that repeat get a color, one color per group, on all occurrences. Case, underscores, weights and brackets are ignored, so (red hair:1.2) and red hair count as the same tag. A ⚠ N counter shows how many groups repeat, and hovering it lists them.

    βœ‚ One-click duplicate removal

    The Dupes button removes repeated tags and keeps the first of each. It uses exactly the same rules as the highlight: what you see highlighted is what gets removed.

    πŸ’¬ Comments with Ctrl+/

    Comment tags in and out like in a code editor (Cmd+/ on Mac). Works on non-Latin keyboard layouts too.

    1girl, red dress, smile -> 1girl, /* red dress */, smile

    Commented tags never reach the model, show with a gray background, and are ignored by duplicate detection. Select several tags to comment them all at once.

    Q Quality tags - set once, always on top

    Open the settings (βš™), paste your usual quality tags once masterpiece, best quality, ...). From then on they are added to the top of the prompt in every Pro node. Your prompt box stays clean. Each node has a Q button to switch them off, for example on a negative-prompt node.

    πŸ“‘ Snippets

    Select a block of tags (or save the whole prompt), give it a name, and insert it later with one click, at the cursor, with commas handled for you. Great for standard negatives, style blocks, characters. Insertion is undoable with Ctrl+Z.

    πŸ•˜ History

    The last 30 versions of each prompt, ready to restore. A version is saved a few seconds after you stop typing and right before Dupes / snippet insert / restore. Handy for "how was it before my edits?". The current text is saved before every restore, so you can always go back.

    πŸ“ Layout

    Minimum node width and prompt-field height are in the settings (βš™).

    ---

    ## πŸ”Œ Autocomplete friendly

    The prompt field is the stock ComfyUI text box. The node does not replace it, so tag autocomplete add-ons see a normal prompt field and keep working. The toolbar is a separate row above it. The highlight layer appears only when there is something to highlight, and it switches itself off if it ever covers the text, so your prompt always stays visible.

    ---

    ## πŸ“¦ Installation

    1. Download the ZIP from this page.

    2. Extract it so that the folder ComfyUI-CLIPTextEncodePro is inside ComfyUI/custom_nodes/.

    3. Restart ComfyUI and hard-refresh the browser Ctrl+F5).

    4. Double-click the canvas, search for CLIP Text Encode (Pro Editor), add it.

    Requirements: a recent ComfyUI with its current frontend. No extra Python packages.

    ---

    ## πŸš€ How to use

    1. Add the node and connect clip from your checkpoint loader.

    2. Connect conditioning to your sampler's positive or negative input, like the stock node.

    3. Open βš™ and paste your quality tags once.

    4. Type your prompt. Repeated tags light up; click βœ‚ Dupes to clean them.

    5. Press Ctrl+/ on a tag to disable it without deleting it.

    6. Use πŸ“‘ to save and insert reusable blocks, and πŸ•˜ to go back to an earlier version.

    Toolbar: πŸ” search β—€ β–Ά ⚠ repeats βœ‚ Dupes πŸ’¬ comment Q quality on/off πŸ“‘ snippets πŸ•˜ history βš™ settings

    Outputs: conditioning (same as the stock node) and text (the final prompt that was actually encoded: quality tags on top, comments removed).

    ---

    ## πŸ’‘ Good to know

    - Turn the Q button off on negative-prompt nodes. Quality tags are on by default for every Pro node.

    - Quality tags, snippets and history are stored in your browser (not in the workflow file), so they are not shared between browsers or machines, and clearing site data removes them.

    - // starts a line comment, so avoid raw URLs like http://... inside a prompt.

    - Changing your quality tags changes the encoded prompt, so dependent nodes re-run. Other toolbar settings do not invalidate ComfyUI's cache.

    - Nodes 2.0 support is best-effort. If something misbehaves there, please tell me your ComfyUI frontend version in the comments.

    ---

    ## 🐞 Feedback

    Bug reports and ideas are very welcome in the comments. Please include your ComfyUI frontend version and, if possible, a screenshot.

    Version 1.0: prompt search, repeated-tag highlight, one-click dedupe, Ctrl+/ comments, global quality tags, snippets, history, min size settings.

    Other
    Anima

    Details

    Downloads
    30
    Platform
    CivitAI
    Platform Status
    Available
    Created
    11/23/2026
    Updated
    11/24/2026
    Deleted
    -

    Files

    ComfyUI-CLIPTextEncodePro.zip

    Mirrors