Nodes/Folded prompts/FP Text Area Plus
ComfyUI Node

FP Text Area Plus

A prompt box with a before and after — the sandwich trick for stable prompts

By akawana·Created 9 months ago·Updated 8 days ago· 6
FP Text Area Plus
    • text
    text
    before_text
    after_text

    ComfyUI gives you plain text boxes and then expects you to keep three different prompts in sync by hand. FP Text Area Plus is the simple fix: one main text field with an optional before and an optional after, all joined into a single string on output. That's it - no parser, no tree, no magic. Just a prompt box that knows about sandwiches.

    Why bother? Because in real workflows there's a chunk of your prompt that never changes - the base quality tag, the character descriptor, the fixed style suffix - and a chunk in the middle that you edit every single generation. This node lets you separate the stable parts into before_text and after_text so you only touch the middle. Your hand stays on the interesting part, and the boilerplate sits visibly on the side instead of being buried somewhere in a 300-character line.

    It also plays nicely with the author's wider setup. In the same pack family he ships CLIP Text Encode Cached (in ComfyUI Utils Extra), which caches the last conditioning and skips a re-encode when only part of the text changed. With this node, before_text and after_text can stay put while you swap the middle - the stable sandwich pieces don't force the encoder to redo work they've already done.

    Inputs and output

    The schema is refreshingly short:

    • text - the middle of the sandwich. This is the field you actually edit between generations.
    • before_text - optional, prepended to the output.
    • after_text - optional, appended to the output.

    Both optional fields are marked force_input, meaning you can wire other nodes into them rather than typing - so you could drive a stable prefix from a group or a text file while the middle stays manual. The single output is a STRING named text: before_text + text + after_text, joined with newlines, with empty pieces skipped so you don't get stray blank lines.

    Wire the output straight into a CLIP Text Encode - it behaves exactly like any other prompt string.

    Installing it

    Same install as the rest of the pack - no dependencies, no model files, just the code. In ComfyUI Manager search "Folded prompts" and install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/akawana/ComfyUI-Folded-Prompts.git
    

    Restart ComfyUI and look under AK/Folded Prompts. One requirement worth repeating: this pack is written against the newer comfy_api.latest extension API, so a current ComfyUI is expected - on an old install the node won't even appear.

    The honest take

    This is a thin utility, and it knows it. If you need regional prompting, line weights, or a whole prompt library, get FP Folded Prompts instead. If you need multiple named prompts you can switch between, grab the sibling FP Tabbed Text Area. But for the plain, workhorse case - a stable prompt shell with a swappable middle - this is one of the simplest nodes in the pack, and sometimes the simplest tool is the one you actually reach for every day.

    CategoryAK/Folded Prompts

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    before_textoptSTRING
    after_textoptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING