Nodes/Customizable API Call Nodes by BillBum/Regular ResponseText to 1linePrompt Node
ComfyUI Node

Regular ResponseText to 1linePrompt Node

When your LLM answers like a poet and you need a one-line prompt

By AhBumm·Created 2 years ago·Updated 3 months ago· 11
Regular ResponseText to 1linePrompt Node
    • formatted_text
    remove_thinkingfalse
    remove_lora_namefalse
    input_text

    LLM-powered prompt generation has a dirty secret: models don't answer in prompt format. You ask for "a prompt for a cyberpunk street scene" and they give you a paragraph with bullet points, em-dashes, and italics - and if you shove that straight into a CLIP encoder, you get mush. This node is the blunt instrument that fixes it. It takes whatever text an LLM spat out and flattens it into a single comma-separated line you can actually feed into a prompt.

    It's dead simple, and that's its virtue. Where similar tools are polite and configurable, this one is aggressive on purpose: it's built to produce one-line prompts, full stop.

    How it works

    The mechanism is three regex passes, in order:

    1. remove_thinking - if enabled, it strips everything up to and including the first </think> tag. That's the reasoning block that Qwen, DeepSeek, and other thinking models wrap around their answers. You almost always want this on when you're talking to a reasoning model; otherwise your "prompt" starts with ten paragraphs of the model reasoning about whether a cyberpunk street has good lighting.
    2. Flatten - newlines become nothing (not spaces), and every period becomes a comma. So a sentence ends and your prompt just keeps going. Brutal, but that's the intent.
    3. Character whitelist - everything outside a-z A-Z 0-9 spaces / < > ( ) , ' - is deleted. No quotes, no colons, no em-dashes, no stray Unicode.
    4. remove_lora_name - if enabled, strips anything in <...> angle brackets - i.e. LoRA tags. This is the setting for when you want a clean prompt line without <lora:foo:0.8> noise, but note it also nukes any other angle-bracket syntax.

    Output is formatted_text (STRING).

    The inputs that matter

    Only three, and all three are optional-ish:

    • input_text - whatever the LLM gave you.
    • remove_thinking (boolean, default off) - kill <think> blocks. Turn it on for reasoning models.
    • remove_lora_name (boolean, default off) - strip <...> tags.

    Installing it

    It ships in AhBumm/ComfyUI_BillBum_APIset_Nodes. ComfyUI Manager → search "billbum" → install "Customizable API Call Nodes by BillBum", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AhBumm/ComfyUI_BillBum_APIset_Nodes.git
    cd ComfyUI_BillBum_APIset_Nodes
    pip install -r requirements.txt
    

    Restart ComfyUI. No dependencies beyond the pack's standard set; nothing to download.

    Common issues

    • It will mangle text you wanted to keep. Dots become commas, every piece of punctuation not on the whitelist disappears, and everything ends up on one line. If your downstream needs structure (a JSON block, a sentence, a filename), this is the wrong node. It's for prompts, and only prompts.
    • remove_thinking matches greedily to the first </think>. Multiple thinking blocks are handled awkwardly - the regex strips up to the first close tag. For most reasoning models that's the whole block, so in practice it's fine.
    • It's a one-way door. There's no "un-clean" - run the LLM again if you need the original.

    Honestly, this is a "nice to have" node: you could replicate it with a regex or two, but it's already here, it does exactly one thing, and it does it without ceremony. In a workflow that chains LLM → RegText → CLIP Text Encode, it's the difference between a garbled prompt and a usable one.

    Categorytext_processing

    Inputs (3)

    NameTypeDefaultDescription
    remove_thinkingBOOLEANfalse
    remove_lora_nameBOOLEANfalse
    input_textSTRING

    Outputs (1)

    NameTypeDescription
    formatted_textSTRING