Nodes/ComfyUI-PromptComment/Prompt Comment (Multi-Marker)
ComfyUI Node

Prompt Comment (Multi-Marker)

The version of Prompt Comment that recognizes three comment styles at once

By smartvain·Created 7 months ago·Updated 7 months ago· 0
Prompt Comment (Multi-Marker)
    • text
    text
    use_hashtrue
    use_double_slashfalse
    use_double_dashfalse
    remove_empty_linestrue
    trim_whitespacetrue

    The sibling node to Prompt Comment (Strip) does the same job - strip comment markers out of a prompt before it hits CLIP Text Encode - but it recognizes #, //, and -- at the same time instead of making you pick one. If you've ever opened a workflow from someone else and found half their prompt commented out in a syntax you weren't expecting, this is the node that shrugs and handles both.

    The use case is narrower than it sounds. You reach for Multi-Marker when your prompt genuinely mixes conventions: # for section labels on your main tag list and // for temporary notes, or when you're porting a prompt written in a style that uses -- as its comment character. The Strip node is a dropdown you switch; this one is a set of toggles you leave on. Same pack, same zero-dependency philosophy - one Python file, no requirements.txt, nothing to download.

    How it works

    Identical mechanism to Strip, with one extra step. On each line it checks every enabled marker, finds whichever appears earliest in the line, and cuts everything after that point. Enable all three and the earliest one wins per line. Then it strips whitespace, drops empty lines if requested, and rejoins - same pipeline, one added loop.

    The inputs that matter

    The interesting ones are the three booleans:

    • use_hash - # is a comment marker (default on)
    • use_double_slash - // is a comment marker (default off)
    • use_double_dash - -- is a comment marker (default off)

    Then the usual remove_empty_lines and trim_whitespace, both defaulting to on and both fine to leave alone. The output is a single text STRING, wired straight into CLIP Text Encode or any downstream text input.

    Where people get burned

    Two traps, both grounded in the source. First: if you switch all three toggles off, the node returns your text untouched - no error, just a silent pass-through. Easy to do if you're mid-experiment and confusing to diagnose. Second, and this one is amplified versus Strip: the more markers you enable, the more naive-string-search false positives you inherit. With use_double_slash on, any https:// URL in your prompt gets cut off at the slashes. With use_double_dash on, watch for text that legitimately contains a double hyphen. # in a hex color (#4a90d9) is a problem here exactly like it is in Strip. More markers on = more ways for an innocent string to look like a comment.

    Install

    Same pack as Strip, so if you already have Prompt Comment you already have this node. Via ComfyUI Manager, search "PromptComment"; by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/smartvain/ComfyUI-PromptComment
    

    Then restart ComfyUI. The README's clone command has a YOUR_USERNAME placeholder that's a typo - use the URL above. Both nodes live under text/utils in the node search once it's loaded.

    The honest take

    This is the variant you probably don't need on day one. If you only ever annotate with one marker, the Strip node is the simpler default - one dropdown instead of three toggles. Multi-Marker earns its place when you're reading or writing prompts that mix styles, or when you want // for throwaway notes alongside # for section headers without swapping a dropdown each time. It's a small, honest utility: no models, no dependencies, no surprises beyond the string-search caveats, and you can read all ~60 lines of it if you want to know exactly what you installed. For a tiny text-processing node, that's a genuinely clean bill of health.

    Categorytext/utils

    Inputs (6)

    NameTypeDefaultDescription
    textSTRING
    use_hashBOOLEANtrue
    use_double_slashBOOLEANfalse
    use_double_dashBOOLEANfalse
    remove_empty_linesBOOLEANtrue
    trim_whitespaceBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    textSTRING