ComfyUI Node

prompt - std

The prompt tidy-up node you'll actually reuse

By YMC-GitHub·Created 3 years ago·Updated about a year ago· 20
prompt - std
    • STRING
    text

    Every other node in this pack assumes your prompt is a tidy comma-separated tag list. Real pasted prompts are not. prompt - std ("std" = standardize) is the cleanup layer that makes that assumption true: it trims whitespace off every tag, squeezes runs of spaces inside a tag down to one, drops empty entries, and rejoins on commas.

    It's the most boring node in the ymc text family and the one you'll wire into the most workflows, because it's the front door. Put it right after a text input and everything downstream - dedupe, search, join, shuffle - behaves predictably.

    How it works

    For each comma-separated tag it does three things: strip leading/trailing whitespace, collapse multiple interior spaces to a single one, and skip the tag entirely if it's now empty. Then it joins the survivors with commas. That's all.

    The effect is more than cosmetic. On SDXL-lineage anime models, each tag is a vocabulary word, and long hair with a double space is a different token than long hair - so a sloppy paste genuinely degrades prompt adherence. Standardizing before encoding is free quality on that class of model.

    One thing it deliberately does not do: it doesn't touch weights, case, or newlines. (1girl:1.2) stays (1girl:1.2), LONG HAIR stays LONG HAIR. If you want weights stripped, that's prompt - unweight; this node is only about whitespace and empties.

    Inputs and outputs

    • text - the prompt to standardize
    • STRING output - the cleaned, comma-separated prompt

    Nothing else. Two connections and you're done.

    Installing it

    Part of ymc-node-suite-comfyui:

    • ComfyUI Manager → search ymc-node-suite-comfyui → Install → restart, or
    cd ComfyUI/custom_nodes
    git clone https://github.com/YMC-GitHub/ymc-node-suite-comfyui
    

    restart, and pip install -r requirements.txt on a manual clone (four yors_* helper libs; the pack's auto-install is commented out). No models, no GPU.

    Search prompt / std on the canvas or use the right-click ymc suite menu.

    Common issues

    • "It didn't clean my line breaks." Right - newlines are preserved as-is. If you're feeding multi-line text downstream and want newlines turned into commas, combine with the pack's prompt - join (which flattens its inputs) or a prompt - input that's fed line-by-line.
    • It won't fix your spelling or your grammar. It's a token cleaner, not a proofreader.
    • Near-duplicates stay near-duplicates. 1girl and 1girl become the same tag (good), but 1girl and 1girl, masterpiece stay separate - run prompt - dup after this if you want dedupe.
    • WAS Node Suite conflicts on the pack's io/save nodes can appear as Manager warnings if you run both packs - unrelated to this node.

    The pack's prompt - input node is basically std fused with a text box - if you want the cleanup to happen as you type or paste, use that instead and skip the extra node.

    Categoryymc suite/text

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING