Prompt Edit ✏️
The pause button your ComfyUI workflow was missing
- edited_text
What it actually is
ComfyUI is fantastic at "run the whole pipeline" and genuinely bad at "hold on, let me look at this before you spend the next two minutes sampling." Prompt Edit is the fix for the second problem. It's a single-purpose human-in-the-loop node: text comes in over a wire, execution stops dead, an editor pops up, you tweak the string, hit continue, and the edited text flows out the other side to whatever's downstream.
Where it earns its keep is anything where the prompt reaching the sampler isn't something you typed yourself - an LLM-generated prompt, a captioned or style-transferred string from another node, a batch where you want to eyeball each prompt before committing to the expensive part. It's a quality-gate, not a convenience.
How it works
The mechanism is straightforward and it's all visible in the source, so none of this is guesswork. The text input is declared forceInput, meaning you must wire it - there's no typing into that socket. When execution reaches the node, the backend generates a session id, pushes a prompt_edit_session message over ComfyUI's WebSocket to your browser, and then sits in a polling loop, checking every 100ms until the front end confirms.
The bundled JS (web/prompt_edit.js) listens for that message, pops an 800×400 dialog, auto-saves your typing to /prompt_edit/update (debounced to 500ms so it doesn't hammer the server), and posts your final text to /prompt_edit/confirm when you hit continue. Cancel just closes the dialog - the workflow keeps waiting.
One quirk worth knowing: the node is declared OUTPUT_NODE (it's a UI endpoint, so ComfyUI treats it as a run-complete marker) but it still returns its string, so the edited text passes through normally. You wire it like any other node.
The inputs that matter
There are only three fields in the whole node, and you'll only touch two:
text- required, wired-only. Whatever upstream produced.edited_text_widget- the multiline box inside the node (200px). The dialog and this widget stay in sync in a browser run.edited_text- the STRING output. Wire it into your CLIP Text Encode positive (or negative) input.
The one trap: in the code, a non-empty widget beats the wired text - final_text is the widget's content if it has any, otherwise the input. The JS re-syncs the widget from the incoming text when a session starts, so in normal browser use you never notice. If you ever see a stale prompt come out the other side, this is why.
Installing it
Find it in ComfyUI Manager by searching "Comfyui_Prompt_Edit" (or "Prompt Edit") and hit Install, then restart ComfyUI. Or go manual:
cd ComfyUI/custom_nodes
git clone https://github.com/xuchenxu168/Comfyui_Prompt_Edit
then restart. Add it via right-click → Add Node → Ken-Chen → Prompt Edit ✏️. There's no requirements.txt and the pyproject declares zero dependencies - it's pure Python stdlib plus ComfyUI's own server module. No model files, no pip install, nothing that can quietly break your environment. That alone makes it a refreshingly safe install in an ecosystem famous for dependency hell.
The gotchas that will actually bite you
- It blocks the whole executor, not just this workflow. Everything else in your queue waits while you edit. Don't chain several of these into a queue you want to walk away from.
- It needs a browser. The dialog is delivered to the connected front end over WebSocket. If you queue a workflow through the API or run headless, no dialog ever appears and the run hangs until the 1-hour timeout kills it by raising an exception (the error text is Chinese: "编辑超时(1小时)"). Keep this node for sessions where you're sitting in front of the UI.
- The UI labels are Chinese by default - the dialog title is 编辑提示词 and the buttons read 继续执行 (continue) and 取消 (cancel). You'll figure it out in two seconds, but it's disorienting the first time.
Honest verdict
This is a small, exactly-right node for interactive work - a manual QA checkpoint between auto-generated text and the sampler. For anything unattended it's the wrong tool, and you'll curse the hour-long hang. But if you've ever sat watching a batch run and wished you could fix a prompt before the GPU wasted a minute on it, this is that wish, shipped as a node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| edited_text_widget | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| edited_text | STRING | — |