ComfyUI Node

Searge LLM Node

Rewrite a rough prompt with a local LLM, no API key

By SeargeDP·Created 2 years ago·Updated 8 months ago· 162
Searge LLM Node
  • adv_options_config
  • generated
  • original
text
random_seed1234567890
model
max_tokens4096
apply_instructionstrue
instructionsGenerate a prompt from "{prompt}"

Feed it a rough idea, get back a fleshed-out prompt - and the whole thing runs on your own GPU. No OpenAI key, no Anthropic key, nothing phoning home. That's the real selling point of Searge_LLM_Node: a local LLM prompt-writer wired straight into ComfyUI, using llama-cpp-python to run a quantized GGUF model against whatever text you give it. If you've been pasting a rough idea into a chat app to get it "translated" into something a text encoder actually responds to - a genuinely common workflow now, not a novelty act - this collapses that step into the graph itself.

What it's actually doing

Under the hood it's a small wrapper around llama.cpp. You point it at a .gguf file sitting in ComfyUI/models/llm_gguf, it loads that model through llama-cpp-python, wraps your text input inside an instructions template, and runs generation. The default template is literally Generate a prompt from "{prompt}". Swap it for anything: "Add camera and lighting details to: {prompt}", "Rewrite as Danbooru tags: {prompt}". This is exactly the class of node the community's shift toward LLM-assisted prompting has been converging on - a local translation step between what you want and what the encoder actually responds to, instead of something you do by hand in a separate browser tab.

The inputs and outputs that matter

  • text - your rough prompt or description. Gets substituted into {prompt}.
  • model - a dropdown pulled from whatever .gguf files you've dropped into models/llm_gguf. Empty until you put one there.
  • instructions - the template, {prompt} placeholder included. Rewrite it to change what the model actually does with your text.
  • apply_instructions - on by default; going by the parameter's own name, switching it off skips the template and hands your raw text to the model with no framing. Leave it on unless you have a reason not to.
  • max_tokens (default 4096, up to 8192) and random_seed round out the required inputs - the seed matters once you're sampling above zero temperature, since it's what makes a given generation reproducible.

Two outputs: generated is the model's output - wire it into your CLIP Text Encode. original is a straight passthrough of your text input, handy for a side-by-side comparison. There's also an optional adv_options_config input; leave it unconnected for the pack's baked-in sampling defaults, or wire in a Searge Advanced Options Node to touch temperature, top-p, top-k, or repetition penalty.

Installing it

ComfyUI Manager: search "Searge-LLM for ComfyUI", install, restart. Or manually:

cd ComfyUI/custom_nodes && git clone https://github.com/SeargeDP/ComfyUI_Searge_LLM

Then the part people skip and immediately regret: you need an actual model. Make a llm_gguf folder inside ComfyUI/models, and drop a GGUF-format LLM in it. The author's tested default is Mistral-7B-Instruct-v0.3.Q4_K_M.gguf (4.37 GB) from MaziyarPanahi on HuggingFace - Q4_K_M is the well-known sweet spot for squeezing a 7B model onto a 12GB card without visible quality loss. The node only speaks GGUF and only works with models llama-cpp-python supports, so a random .safetensors LLM checkpoint won't show up in the dropdown.

Worth knowing: the author is the same SeargeDP behind the Searge SDXL workflow suite that was a fixture of the ComfyUI SDXL era back in 2023 - an established, responsive name here, not a drive-by repo. And to head off the obvious worry the "LLM" in the name might raise: this has had none of the trouble that torched ComfyUI_LLMVISION in 2024, a fake node that shipped an infostealer disguised as OpenAI/Anthropic API wheels. Searge-LLM makes no outbound API calls at all - everything runs against the GGUF file already sitting on your disk.

Common issues & troubleshooting

"llama-cpp not installed" on startup. The single most common complaint, and it's a Windows-and-wheels problem, not a bug in the node itself. llama-cpp-python has no official prebuilt wheel matching every Python/CUDA combo a ComfyUI install might run, so pip's normal resolution fails. The README's own fix for portable Windows installs is prebuilt CUDA wheels installed straight into python_embeded; people hitting this on the ComfyUI subreddit in 2025-2026 generally end up doing the same via JamePeng's llama-cpp-python releases, matching the wheel to their exact Python and CUDA version. If it still won't load, check the console at startup - it usually names the real missing piece (one user's actual blocker turned out to be a missing diskcache package, nothing to do with llama-cpp at all).

A newer GGUF model (Qwen3, etc.) "fails to load" when Mistral works fine. The node isn't locked to Mistral - any llama-cpp-python-compatible GGUF works - but newer model architectures need a newer llama-cpp-python build. If Mistral loads and a fresher model doesn't, that's your sign to upgrade the wheel, not switch nodes.

Output includes <think>...</think> tags. Happens with reasoning models like Qwen3, which emit their chain-of-thought by default; Searge just passes the raw generation straight through. Look for the "no-think" instruction that specific model documents (often something like /no_think in the prompt) rather than fighting it from the instructions field.

CategorySearge/LLM

Inputs (7)

NameTypeDefaultDescription
textSTRING
random_seedINT12345678900–18446744073709550000
modelCOMBO0 options:
max_tokensINT40961–8192
apply_instructionsBOOLEANtrue
instructionsSTRINGGenerate a prompt from "{prompt}"
adv_options_configoptSRGADVOPTIONSCONFIG

Outputs (2)

NameTypeDescription
generatedSTRING
originalSTRING