Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-PromptEditor > Prompt Editor

ComfyUI Node: Prompt Editor

Class Name

XAI_PromptEditor

Category
utils/text
Author
daemonsk (Account age: 0days)
Extension
ComfyUI-PromptEditor
Latest Updated
2026-11-03
Github Stars
0.0K

How to Install ComfyUI-PromptEditor

Install this extension via the ComfyUI Manager by searching for ComfyUI-PromptEditor
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-PromptEditor in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Prompt Editor Description

Switches between local and connected prompts, retains history, and uses local text as a fallback.

Prompt Editor:

XAI_PromptEditor lets you write a prompt locally or use text supplied by another node while keeping both sources available in your workflow. You can switch between manual and connected text without disconnecting the text source. The node also supports stored history for reviewing earlier text; viewing or editing that history does not, by itself, change the active prompt. This makes it useful when you want to compare a prompt you wrote with one generated elsewhere and send the selected text onward.

Prompt Editor Input Parameters:

source_mode

Selects which text source is active. Set it to MANUAL to use the local prompt, or LLM to use the connected text when a value is available. The default is MANUAL. The mode check ignores surrounding spaces and letter case for LLM; any other value is treated as MANUAL. Minimum and maximum values do not apply to this text setting.

current_prompt

The local prompt text. It becomes the active prompt in MANUAL mode and also serves as the fallback in LLM mode when no connected text value is available. The default is an empty string. There is no minimum or maximum text length specified in the source.

last_manual_input

A stored manual-prompt history value. It is retained for the editor interface but is not read when the node chooses its output, so changing it alone will not change the active prompt. The default is an empty string. There is no minimum or maximum text length specified in the source.

last_llm_input

A stored connected-text history value. It is retained for the editor interface but is not used as a substitute for the current connected text during execution. Changing it alone will not change the active prompt. The default is an empty string. There is no minimum or maximum text length specified in the source.

has_last_manual

Indicates whether a manual history value has been stored, including a value that is empty. The default is false; the available values are true and false. This history flag does not determine the active output.

has_last_llm

Indicates whether a connected-text history value has been stored, including a value that is empty. The default is false; the available values are true and false. This history flag does not determine the active output.

text

An optional connection for an upstream STRING value, such as text from another text node or an LLM node. In LLM mode, an available value becomes the active prompt; in MANUAL mode, it does not affect the output. If no value is available in LLM mode, the node uses current_prompt instead. The default is no connected value, represented in the source as None. There is no minimum or maximum text length specified.

Prompt Editor Output Parameters:

prompt

The active STRING prompt to pass to the next node. In MANUAL mode, it contains current_prompt. In LLM mode, it contains text when that value is available; otherwise, it contains current_prompt. An empty connected string is still a value, so in LLM mode it produces an empty output rather than triggering the fallback. History values do not directly change this output.

Prompt Editor Usage Tips:

  • Keep a useful prompt in current_prompt when working in LLM mode so the node has a fallback if connected text is unavailable.
  • Connect a text-producing node to text, then switch source_mode between MANUAL and LLM to compare the local and connected prompts without changing the connection.
  • Use MANUAL mode when you want the result to depend on your local prompt rather than the connected text. The node requests its lazy text input when LLM mode needs that value.
  • If you are inspecting stored history, check the active mode and prompt separately. last_manual_input, last_llm_input, and their flags do not select the output.

Prompt Editor Common Errors and Solutions:

No node-specific error message is defined in the provided source

  • Explanation: The supplied implementation does not define a custom error message, so the entries below describe possible symptoms rather than quoting errors guaranteed to appear.
  • Solution: If execution fails, read the message shown by the node supplying text or by the workflow, and check that the connected source provides a STRING.

The output shows my manual prompt instead of connected text

  • Explanation: MANUAL mode always uses current_prompt. LLM mode also falls back to current_prompt if no connected text value is available.
  • Solution: Set source_mode to LLM and check that the upstream node is connected to text and provides a value.

The output is empty in LLM mode

  • Explanation: A connected empty string counts as an available value. The node outputs that empty string instead of falling back to current_prompt.
  • Solution: Check the text produced upstream. To use your local prompt instead, switch to MANUAL mode or change the upstream value.

Changing a history value does not change the output

  • Explanation: The history fields and flags are retained for the editor interface but are not used to select the active prompt during execution.
  • Solution: Edit current_prompt for manual text, or change the value connected to text for connected text. Then select the corresponding source_mode.

An unexpected source mode behaves like MANUAL

  • Explanation: Only LLM, ignoring letter case and surrounding spaces, selects connected-text mode. Every other mode value is treated as MANUAL.
  • Solution: Set source_mode to LLM to select connected text, or MANUAL to select the local prompt.

Prompt Editor Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-PromptEditor
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Prompt Editor