Nodes/ComfyUI-Just-Nodes/Prompt Stack πŸ’Ž Just Nodes
ComfyUI Node

Prompt Stack πŸ’Ž Just Nodes

The five-second cleanup that keeps your prompts honest

By Arroz-11Β·Created 7 months agoΒ·Updated 3 days agoΒ· 0
Prompt Stack πŸ’Ž Just Nodes
    • STRING
    β—„textβ€”β–Ί

    Prompt Stack is the most boring node in the Just Nodes pack, and it's probably the one you'll reach for most. Feed it a block of multiline text and it strips every empty line, then hands you back the remaining lines joined with newlines. That's the whole job. It does not sort, dedupe, or rewrite a single word. One text input, one string output, done.

    Why bother? Because blank lines are the quiet saboteur of pasted prompts. Copy a prompt out of Civitai, a Discord message, or your own notes app and you're almost guaranteed to inherit stray empty lines. In ComfyUI those blanks become literal whitespace in what gets encoded - and when you're stacking tags in a structured block (the tag-block style the current anime models actually want), a stray linebreak can split a sequence you intended to keep together. Prompt Stack just refuses to let that happen. It's also the polite middleman for anything downstream that splits text on newlines: the Picker family in this same pack treats each line as a slot, and feeding it junk whitespace lines silently eats options.

    The mechanism is a two-liner, which tells you a lot about the author's approach - no hidden dependencies, no API, nothing to configure. It splits on \n, keeps lines that still contain text after a .strip(), and rejoins. A line with trailing spaces gets cleaned up; a line with actual content keeps its interior exactly as typed.

    In practice: wire the text input (multiline) to anything - a CLIP Text Encode node, another Prompt Stack, or a Picker - and feed the STRING output onward. If you want to see it working, paste ten lines with a few empty ones scattered in and watch them vanish on the next run.

    Installing it

    This whole pack installs the same way, no model downloads and no pip steps:

    • ComfyUI Manager β†’ search "Just Nodes" β†’ install β†’ restart.
    • Or manually: cd ComfyUI/custom_nodes && git clone https://github.com/Arroz-11/ComfyUI-Just-Nodes.git, then restart ComfyUI.

    It's MIT-licensed and pure Python on top of torch/PIL, which ComfyUI already ships - there is no requirements.txt and nothing heavy gets pulled in.

    Gotchas

    The honest caveat is that this node does exactly what it says. If you expected it to also trim internal whitespace, dedupe repeated tags, or merge lines, that's not here. And stripping blank lines is one-way: if a downstream node was relying on empty lines as separators (some wildcard-style tools do), this will quietly collapse them. If you need fancier text surgery, chain a Search & Replace node after it - they were built to work together. For a "just make my prompt clean" job, this is the smallest tool in the drawer and it fits.

    CategoryπŸ’Ž Just Nodes

    Inputs (1)

    NameTypeDefaultDescription
    textSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”