Nodes/ComfyUI_TextRandomizer/🖥️ Log to Workspace Advanced
ComfyUI Node

🖥️ Log to Workspace Advanced

The same logger, with a prompt-cleanup pipeline attached

By fls-eugene·Created 2 months ago·Updated 2 months ago· 0
🖥️ Log to Workspace Advanced
    • text
    text
    remove_empty_commastrue
    remove_empty_linestrue
    collapse_spacestrue

    "🖥️ Log to Workspace Advanced" is Log to Workspace with a string-sanitizing pipeline bolted on. Same read-only on-canvas display, same always-runs output node behavior, but before the text is shown (and passed through), it gets scrubbed by three cleanup passes that default to on. And here's the part people miss: the output is the cleaned text, not the raw input. So this node is two things at once - a log display and an inline prompt sanitizer.

    The three toggles

    • remove_empty_commas (default on) - collapses runs like , ,, ,, down to a single comma, and strips leading/trailing commas from each line. This is the fix for the classic empty-wildcard artifact: a {choice|} bracket that picks the empty side and leaves ", ," scars in your prompt.
    • collapse_spaces (default on) - squeezes runs of spaces and tabs down to one space, so pasted text with ragged indentation comes out clean.
    • remove_empty_lines (default on) - drops blank lines, so a log that's half empty carriage returns reads as one tight block.

    Run order is fixed: commas first, then spaces, then lines. The whole thing is a regex pipeline, and it's fast enough to sit in a hot path without thinking about it.

    The inputs that matter

    • text - the string to clean and log.
    • remove_empty_commas / remove_empty_lines / collapse_spaces - the three toggles above, all default on. Flip any off to leave that kind of noise in.

    Output: text (STRING) - the cleaned string. Wire it into a CLIP encode or downstream sampler.

    Installing it

    Same trivial install as the rest of the pack: no requirements.txt, no models, pure Python plus the shared JS extension.

    ComfyUI Manager → Custom Nodes Manager → search "TextRandomizer" → Install → Restart
    

    or cd ComfyUI/custom_nodes && git clone https://github.com/fls-eugene/ComfyUI_TextRandomizer, then restart.

    When to reach for it

    The natural home for this node is after any randomizer that can produce empty bracket picks or pasted-messy text, before the sampler. Run the prompt through here, watch it get scrubbed live on the canvas, and hand the clean result downstream. If your text is already clean, plain Log to Workspace is enough and you skip the noise. If you're tired of "why is there a double comma in my prompt" archaeology, this is the node that makes the question go away.

    CategoryTextRandomizer/Debug

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING
    remove_empty_commasBOOLEANtrue
    remove_empty_linesBOOLEANtrue
    collapse_spacesBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    textSTRING