Nodes/NX_PromptStyler/πŸ“„ Prompt Styler
ComfyUI Node

πŸ“„ Prompt Styler

Stop retyping style prompts, pick them from dropdowns instead

By Franck-DemonginΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 10
πŸ“„ Prompt Styler
    • positive
    • negative
    • resume
    β—„prompt_positiveβ€”β–Ί
    β—„prompt_negativeβ€”β–Ί
    β—„viewer_positiveβ€”β–Ί
    β—„viewer_negativeβ€”β–Ί
    β—„presetsnoneβ–Ί

    If you've ever kept a note file full of "Candlelit Scene", "Bokeh" and "Dodge and Burn" phrases to copy-paste into every prompt, this node is that note file, turned into dropdown menus. πŸ“„ Prompt Styler builds your prompt from a fixed order of categories - style, framing, camera, lighting, effects, composition, films, artists - where each category is a dropdown populated from a CSV file, and every choice maps to a ready-made prompt fragment. Pick "Action Photography" and it emits An action photography of; pick "Backlighting" and in goes Backlighting. No memory, no typos, no re-typing the same dozen style tokens per generation.

    It sits in the NX_Nodes category, and it's the only node in the pack. The whole thing is ~350 lines of Python stdlib (csv, json, math) plus a small JS front-end - no requirements.txt, no model downloads, no API calls. Franck-Demongin wrote it after being inspired by PCMonsterx's ComfyUI-CSV-Loader, with tweaks by Adel AI, and it shows its lineage: CSV-loaded prompts, plus per-category weights, presets, and a text preview bolted on.

    How it works

    At startup the node scans its own CSV/ folder for *.csv files, reads every row, and turns each file into a dropdown plus a weight slider. That's the whole trick. The order is hardcoded in the source: styles, then your typed prompt, then framing, cameras, lighting, effects, composition, films, artists. Extra CSV files you drop in get appended alphabetically, and positive.csv / negative.csv are pinned to the end. Every CSV must be UTF-8 with a header row of name,prompt,negative_prompt, comma-separated with " as the quote character - the negative column isn't used yet.

    Weights are the interesting bit. Set a category's slider away from 1.0 and the fragment gets wrapped as (fragment:1.3) - classic CLIP attention syntax, clamped to 0.1–5.0. That syntax is exactly what SDXL-lineage models (and only them) honor; on Flux or any LLM-encoded model the (x:1.3) wrapper is silently discarded. So treat this node as built for SDXL and its cousins (Illustrious, Pony, Juggernaut), which is also why the built-in vocabulary leans hard on photography terms and the summary output literally calls itself the "Styler SDXL resume."

    The inputs and outputs that matter

    The two inputs you always touch are prompt_positive and prompt_negative (both required, multiline) - your own prompt text, slotted between the styles and framing sections. The rest of the input surface is dynamic: every CSV category contributes its own dropdown and weight slider, and viewer_positive / viewer_negative are the preview fields you can type over. The presets dropdown (default "none") loads saved settings - save, edit, and delete favorites with the node's own buttons, which write to presets.json via /savepreset, /loadpreset, /deletepreset routes.

    The three outputs are positive, negative, and resume. Wire positive into a CLIP Text Encode node's positive slot and negative into the negative slot, and you're done. resume is a human-readable checklist of every category and what you picked - handy to shove into a text viewer to double-check the node did what you think. Note the node is flagged as an output node, so it also shows its strings as final results in the UI.

    Installing it

    ComfyUI Manager is the easy route - search "NX_PromptStyler" and install. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Franck-Demongin/NX_PromptStyler
    

    Restart ComfyUI and it appears under NX_Nodes. No pip step, no model files, nothing to download. The author warns it's only been tested on Linux, though it should behave on Windows and macOS. The one manual step that catches everyone: the CSV/ folder ships empty. Copy the starter files over before first use:

    cp -r NX_PromptStyler/CSV_default/* NX_PromptStyler/CSV/
    

    Where people get burned

    • The empty dropdown problem. Forget the copy step above and the node is just two text boxes and a preset menu, because there's nothing in CSV/ to build dropdowns from. It's not a bug; it's a missing copy.
    • CSV edits need a restart. Files are read once when the node class loads. Add a row or a whole new file and you have to restart ComfyUI to see it.
    • The viewer fields override everything. Per the README, if viewer_positive or viewer_negative contain anything at all, those exact strings are used as the output - your dropdown selections are silently ignored. Empty them (or regenerate) or you'll spend an hour wondering why changing the style dropdown did nothing.
    • Weights are SDXL-only. The (term:1.4) wrapper is dead weight on Flux-class models. Fine on SDXL lineage, pointless elsewhere.

    For a niche tool it's remarkably friction-free - no deps, no downloads, and the whole vocabulary is just text files you can edit or replace. If you batch-generate variations of the same subject across styles, it earns its keep.

    CategoryNX_Nodes

    Inputs (5)

    NameTypeDefaultDescription
    prompt_positiveSTRINGβ€”
    prompt_negativeSTRINGβ€”
    viewer_positiveoptSTRINGβ€”
    viewer_negativeoptSTRINGβ€”
    presetsoptCOMBOnone0 options:

    Outputs (3)

    NameTypeDescription
    positiveSTRINGβ€”
    negativeSTRINGβ€”
    resumeSTRINGβ€”