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-Anima-Prompt-Rewriter > Anima LLM Prompt Rewriter

ComfyUI Node: Anima LLM Prompt Rewriter

Class Name

AnimaLLMPromptRewriterHybrid

Category
Anima Generator/Text
Author
sinanzoo2nd (Account age: 299days)
Extension
ComfyUI-Anima-Prompt-Rewriter
Latest Updated
2026-05-19
Github Stars
0.0K

How to Install ComfyUI-Anima-Prompt-Rewriter

Install this extension via the ComfyUI Manager by searching for ComfyUI-Anima-Prompt-Rewriter
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Anima-Prompt-Rewriter 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

Anima LLM Prompt Rewriter Description

Rewrites image-generation tags into prose using a local or server LLM, with manual fallback.

Anima LLM Prompt Rewriter:

AnimaLLMPromptRewriterHybrid turns grouped image-generation tags into a natural-language prompt using a language model. It can work with a local GGUF model or a running llama-server, and it automatically uses the server when one is detected to avoid loading another model into GPU memory. If you prefer to write the prompt yourself, you can bypass rewriting entirely. When rewriting cannot run or fails, the node falls back to your manual text or the original tags, helping your workflow continue without losing the prompt content.

Anima LLM Prompt Rewriter Input Parameters:

enable_llm

Controls whether the node attempts language-model rewriting. The default is True. Set it to False to bypass both the server and local model: the node returns manual_prompt as the final prompt and passes through the three character and background tag groups after removing surrounding whitespace. When it is True, the node attempts rewriting and uses fallback text only if the selected method is unavailable or fails.

manual_prompt

A multiline text field for a prompt you write yourself; its default is an empty string. With enable_llm set to False, its contents become the final prompt exactly as entered. When rewriting is enabled, it is not sent to the language model; instead, it becomes the fallback if an error occurs and it contains non-whitespace text. If it is empty or only whitespace during fallback, the node joins the supplied tag groups and scene text with commas.

model_choice

Selects the language-model source. The available options are [API] LLAMA-SERVER (127.0.0.1:8080) and any .gguf files found under configured LLM folders, displayed as paths such as LLM/Gemma/gemma.gguf. No fixed default is specified in the source. If a llama-server responds at 127.0.0.1:8080, the node uses it even when you selected a local file. If no server is detected, an API selection triggers fallback, while a local-file selection makes the node try to load that GGUF model.

temperature

Adjusts variation in the language model’s response: lower values generally favor more consistent wording, while higher values allow more variation. The default is 0.1, the minimum is 0.0, the maximum is 2.0, and the adjustment step is 0.05. It is sent to both server and local rewriting requests; it has no effect when rewriting is bypassed or when fallback text is used.

top_p

Controls how broadly the language model considers possible next words when generating text. The default is 0.9, the minimum is 0.0, the maximum is 1.0, and the adjustment step is 0.05. Lower values narrow the model’s choices; changing it may affect wording alongside temperature. It is sent to both server and local rewriting requests, but does not alter bypass or fallback text.

system_prompt

A multiline instruction for the language model; its default text is You are a strict prompt translator.... Use it to tell the model how to turn the supplied tags into a prompt, including any style or fidelity requirements you want it to follow. It is sent as the system message in both server and local modes. It is not used when rewriting is disabled or the node returns fallback text.

char_1_tags

A multiline field for the first character’s tags; its default is empty. If it contains text, the node removes surrounding whitespace and sends it to the model under Character 1 Tags:. The trimmed value is also available as char_1_raw when rewriting is bypassed or falls back. Leave it empty when there is no first character to describe.

char_2_tags

A multiline field for the second character’s tags; its default is empty. If it contains text, the node removes surrounding whitespace and sends it to the model under Character 2 Tags:. The trimmed value is also available as char_2_raw when rewriting is bypassed or falls back. You can leave it empty for a single-character scene.

background_tags

A multiline field for setting or background tags; its default is empty. If it contains text, the node removes surrounding whitespace and sends it to the model under Background Tags:. The trimmed value is also available as background_raw when rewriting is bypassed or falls back, so you can keep the setting tags separate from the final prompt.

scene_and_action

A multiline field for scene and action text; its default is empty. If it contains non-whitespace text, the node trims it and sends it to the model under Scene & Action Tags:. It is also included when the node builds a tag-based fallback prompt. Unlike the character and background groups, it has no separate raw output socket, and it is not used in the final prompt when rewriting is disabled.

Anima LLM Prompt Rewriter Output Parameters:

final_prompt

The main text to send to a downstream prompt-processing or image-generation node. On successful rewriting, it contains the language model’s response with surrounding whitespace removed. With rewriting disabled, it contains manual_prompt exactly as entered. If rewriting cannot complete, it contains a nonblank manual_prompt if available; otherwise, it contains the nonempty character, background, and scene inputs joined with , . If all fallback sources are empty, this output can be empty.

char_1_raw

The first character’s original tag text with surrounding whitespace removed. It contains that text when rewriting is disabled or falls back, allowing you to retain the separate tags for another connection. After a successful server or local rewrite, it is an empty string; an empty input also produces an empty string.

char_2_raw

The second character’s original tag text with surrounding whitespace removed. Like char_1_raw, it preserves the separate tags in bypass and fallback cases but is an empty string after a successful rewrite or when no second-character tags were supplied.

background_raw

The original background tag text with surrounding whitespace removed. It preserves the separate setting tags when rewriting is bypassed or falls back. After a successful rewrite, or if the background input was empty, this output is an empty string.

Anima LLM Prompt Rewriter Usage Tips:

  • For predictable tag-to-prose conversion, start with the default temperature of 0.1 and top_p of 0.9. Adjust one at a time if you want different wording, while keeping system_prompt clear about how faithfully the model should follow your tags.
  • Put character details in their corresponding character fields, setting details in background_tags, and interactions or movement in scene_and_action. The node labels these groups separately for the model, making your intended roles easier to distinguish.
  • If you want a prompt that works even when a model or server fails, fill in manual_prompt. Otherwise, the fallback will be a comma-joined version of the supplied tags rather than rewritten prose.
  • Set enable_llm to False when you want to use your manual prompt without waiting for model processing. In this mode, add any scene or action wording you need to manual_prompt itself: scene_and_action is not appended automatically.
  • If you have llama-server running at 127.0.0.1:8080, expect the node to use it regardless of which local GGUF file is selected. To use a selected local file, the server must not be detected at that address.
  • A successful rewrite leaves all three raw outputs empty. If a later part of your workflow needs those separate tags, keep their original connections available rather than relying on the raw outputs after rewriting.

Anima LLM Prompt Rewriter Common Errors and Solutions:

API server is off / 우회 파이프라인을 가동합니다

  • Explanation: You selected [API] LLAMA-SERVER (127.0.0.1:8080), but the node did not receive a successful response from its server health check. It returns fallback text instead of a rewritten prompt.
  • Solution: Start llama-server at 127.0.0.1:8080 and check that its health endpoint responds, or select an available local GGUF model. Add a manual_prompt if you want a readable fallback.

API 통신 중 에러 발생: ...

  • Explanation: The server was detected, but the chat request or its response failed. The node returns fallback text and preserves the three raw tag outputs.
  • Solution: Confirm that the server is running at 127.0.0.1:8080 and supports /v1/chat/completions. Check the console text after the colon for the specific cause, then retry once the server is ready.

Standalone 처리 중 에러 발생: ...

  • Explanation: Loading the selected local model or generating its response failed. The node returns fallback text, then attempts to release any local model resources it allocated.
  • Solution: Check that the selected .gguf file still exists and can be loaded, that the required local model software is installed, and that your machine has enough memory. The console text after the colon may identify the immediate problem.

LLM returned an empty string.

  • Explanation: The server or local model returned no usable prompt text. The node treats this as an error and uses its fallback.
  • Solution: Supply meaningful tags, review your system_prompt, and verify that the chosen model or server can produce chat responses. Keep manual_prompt filled in if an empty response would interrupt your workflow.

No module named 'llama_cpp'

  • Explanation: A local-model attempt cannot import the llama_cpp package, so standalone rewriting fails and the node falls back.
  • Solution: Install a compatible llama-cpp-python package in the Python environment running ComfyUI, or use a working llama-server instead.

Local model loading fails or reports insufficient memory

  • Explanation: The node loads a selected GGUF model with GPU-layer offloading requested. A model that is unavailable, incompatible with the local setup, or too large for available resources can cause a standalone error.
  • Solution: Verify the file path and try a smaller compatible GGUF model or free GPU memory. A working llama-server is another option; when detected, the node uses it instead of loading the local model.

final_prompt is empty or contains unrewritten tags

  • Explanation: Bypass mode returns manual_prompt even if it is empty. On failure, an empty manual prompt makes the node fall back to comma-joined tags; if those inputs are also empty, the result is empty.
  • Solution: Turn on enable_llm and resolve any model or server error if you want prose, and provide tags for rewriting. For a reliable bypass or fallback, enter the finished text in manual_prompt.

Anima LLM Prompt Rewriter Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Anima-Prompt-Rewriter
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.

Anima LLM Prompt Rewriter