ComfyUI Node

Prompt Editor

A prompt box with real undo, find/replace, and a switch between your text and the LLM's

By DaemonSK·Created a day ago·Updated a day ago· 1
Prompt Editor
    • prompt
    source_modeMANUAL
    current_prompt
    last_manual_input
    last_llm_input
    text

    The stock ComfyUI text box is a widget pretending to be a text editor. No find, no replace, no reliable undo, and the size of a Post-it. Prompt Editor is that box done properly - a real textarea with Ctrl+F/Ctrl+H, spellcheck and word count - plus one trick the core nodes lack: keep an upstream LLM wired in and still type your own prompt, switching between the two without touching a cable.

    Why you'd want it

    The case that actually bites is a prompt enhancer in the graph. You wire a local LLM or an API node into CLIP Text Encode, it rewrites your idea into something structured, and now the thing hitting your conditioning is text you never saw. llm-in-comfyui.md is blunt about how that goes wrong: enhancers emit preambles ("Here is your enhanced prompt:"), role delimiters, markdown - all of it becomes literal prompt tokens if nothing strips it. Prompt Editor's answer is to make that text visible and provisional. The upstream STRING lands in an editor you can read, and you decide whether it's what runs.

    How it works

    The backend is small on purpose, and the interesting part lives in the frontend. The node declares four widgets - source_mode, current_prompt, last_manual_input, last_llm_input - all marked hidden, and a DOM widget that draws the toolbar and textarea over the node. The JavaScript writes into those hidden widget values, which is how the mode and the three stored texts get serialized into your workflow and sent to the backend at execution.

    Execution itself is one branch. If source_mode is MANUAL, the output is current_prompt. If it's LLM and a text value arrived, the output is that. Toggling the mode changes the node's input fingerprint, so the graph re-runs rather than serving a cached result.

    The text input is also lazy, and the node only asks for it when the mode is LLM. Practical consequence: parked in MANUAL with a cable attached, the upstream LLM node isn't pulled into the run just to feed this node - handy when you want to iterate on your own wording without paying for an API call.

    One naming trap: LLM mode does not mean cloud. It means "the connected STRING wins." Point it at a Florence-2 captioner or a neighbouring editor and the light turns green all the same.

    Inputs and output

    • text - optional, connect any STRING producer: an LLM, a captioner, another text node.
    • source_mode - MANUAL or LLM. You flip it with the toolbar switch, not by editing the field.
    • current_prompt, last_manual_input, last_llm_input - the three stored buffers. Hidden; the UI owns them.
    • Output prompt (STRING) - the active text, and it goes anywhere a STRING goes: CLIP Text Encode, a second enhancer chained downstream, a filename builder. Viewing history never changes it.

    The thing people trip over is stated in the README's own bold text: the text you see isn't always the text that runs. Peeking at Last Manual or Last LLM is read-only until you click Use as current - and that click also drops you back to MANUAL.

    It's a plumbing node, not a prompt-engineering node: no weighting, no wildcards, no API calls, no key. Same category as core's PrimitiveStringMultiline (comfyui-node-plumbing.md), just built for editing.

    Install

    No pip packages, no models, no npm. The whole install is the clone.

    cd ComfyUI/custom_nodes
    git clone https://github.com/DaemonSK/ComfyUI-PromptEditor.git
    

    Restart ComfyUI and add Prompt Editor from utils/text (ComfyUI Manager: search the pack title Prompt Editor, registry publisher bonfire). One hard requirement: ComfyUI 0.34 or newer. The node is written against the V3 API (comfy_api.latest, with a v0_0_2 fallback), which is why you won't find a NODE_CLASS_MAPPINGS dict in its source - new authoring style, not a broken install (comfyui-ecosystem.md).

    Common issues

    Nothing appears after restart. Nine times out of ten your ComfyUI predates 0.34. Update and restart; the V3 import fails on older builds.

    The editor renders invisible or a sliver. This is a DOM-widget node, which is exactly the class of third-party UI that ComfyUI's Nodes 2.0 Vue frontend broke across the ecosystem in late 2025 - display widgets collapsing or losing their properties. If the textarea doesn't show up or only redraws when you resize the node, turn Nodes 2.0 off in settings. Worth knowing: the author's own docs/COMPATIBILITY.md is honest that verification covered backend import and unit tests and that the GUI was never click-tested, so the widget is the least-proven surface of the pack.

    The output is your old prompt, not what the LLM wrote. You're in MANUAL with the cable still connected - that's the whole design. The footer on the node always says what's being viewed versus what will run. Flip the switch, or click Use as current.

    Nothing streams. The editor refreshes when the node executes, so a streaming LLM node dumps its whole output at once. Expected, not a bug.

    It's a v0.1.1 pack from one author with essentially no community footprint yet, so you're an early adopter. The repo is tidier than most first releases - a unit-tested pure-Python state machine, a written compatibility matrix - so the risk is "one person's side project," not "abandonware."

    Categoryutils/text

    Inputs (5)

    NameTypeDefaultDescription
    source_modeSTRINGMANUALActive mode: MANUAL (local text) or LLM (connected STRING).
    current_promptSTRINGActive prompt used when no STRING is connected.
    last_manual_inputSTRINGStored last manual prompt (history buffer).
    last_llm_inputSTRINGStored last connected STRING (history buffer).
    textoptSTRINGConnect any upstream STRING (local or remote LLM, or any text node).

    Outputs (1)

    NameTypeDescription
    promptSTRINGActive prompt. Viewing or editing history does not change this.