Nodes/ComfyUI AF - Pack-Prompt-Nodes/AF - Edit Generated Prompt
ComfyUI Node

AF - Edit Generated Prompt

A spot to actually read what your LLM wrote before it hits CLIP

By alFrame·Created 11 months ago·Updated 9 months ago· 4
AF - Edit Generated Prompt
    • STRING
    generated_prompt
    manual_or_paste_generated
    input_text

    If you've ever wired an LLM node - Ollama, a local model, whatever - straight into CLIP Text Encode, you know the problem this node exists for: the LLM writes your prompt, you never actually see it, and the first time you lay eyes on the text is in the output image. The AF - Edit Generated Prompt node is the checkpoint in the middle. It shows you exactly what your LLM produced, lets you tweak it, and then passes a text string on to whatever's next. LLM-assisted prompting is genuinely the way the community writes prompts now, but "have the model write it and run it blind" is the naive version. This is the "actually look at it first" version.

    How it works

    The node has two text fields stacked on top of each other. The upper one (generated_prompt) is a read-only display - grayed out in the UI, you can't type in it. That's where the LLM's output lands when you wire it in. The lower field (manual_or_paste_generated) is yours to edit, and it doubles as a paste target.

    The resolution order is the part to remember: if the lower field has anything in it, that wins. If it's blank, the node falls back to the optional input_text input. If both are blank, you get an empty string out. There's also a small button on the node - "Copy Generated Prompt for Editing" - which copies the generated prompt down into the editable field so you can modify it without retyping. The whole thing is an output node, so it marks your workflow complete and updates its display as it runs.

    The inputs and outputs that matter

    • generated_prompt - read-only display of the incoming LLM text. Not something you set; it's what you inspect.
    • manual_or_paste_generated - the field you actually edit. This is where your hands-on fix goes.
    • input_text - an optional second wired input. It exists so the node can pull from somewhere else (another node's output) when the manual field is empty.

    One output: a single STRING, which you wire straight into CLIP Text Encode (or into the AF - Save Prompt History node if you're archiving as you go).

    Where people get burned

    The manual-field-wins priority is a quiet trap. Leave a stale prompt sitting in the lower field and it will silently override your LLM's fresh output forever, and the node will happily keep passing the old text downstream. If generations stop tracking your LLM's changes, check that field first. Also: because it's an output node, an empty result here means an empty prompt going into CLIP - which is a valid graph that just renders garbage. Don't ask how I know.

    Install

    This is part of the AF - Pack Prompt Nodes suite, and the pack is refreshingly light: zero Python dependencies, no model downloads, nothing to configure. Through ComfyUI Manager, search for "AF - Pack Prompt Nodes" and install. Or the manual route:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/alFrame/ComfyUI-AF-Pack-Prompt-Nodes.git
    

    Then restart ComfyUI and you'll find it under AF - Nodes → AF - Prompt Pack. The pack ships example workflows (including one for this exact Ollama → Edit → CLIP chain) in Docs/example_workflows/ if you want a head start.

    The only real complaint worth having: it's a small single-purpose node, and if you've already got a text-editing node from another pack you don't strictly need it. But if you're running an LLM-in-the-loop workflow and you want one obvious place to review before encode, this is the one to reach for - simple, and it does exactly what the label says.

    CategoryAF - Nodes/AF - Prompt Pack

    Inputs (3)

    NameTypeDefaultDescription
    generated_promptSTRING
    manual_or_paste_generatedSTRING
    input_textoptSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING