Nodes/ComfyUI-Prompt-Manager/Prompt Generator Options
ComfyUI Node

Prompt Generator Options

Tune the local LLM that writes your prompts

By FranckyB·Created 10 months ago·Updated 8 days ago· 147
Prompt Generator Options
  • image2
  • image3
  • image4
  • image5
  • options
modelQwen3.5-9B-UD-Q4_K_XL.gguf
system_prompt_modeappend
system_prompt
use_model_default_samplingtrue
temperature0.70
top_k20
top_p0.90
min_p0.05
repeat_penalty1.00
context_size4096
show_everything_in_consolefalse
max_length512
gpu_device

Prompt Generator Options (class PromptGenOptions) is the control surface for the pack's Prompt Generator. The generator itself is a node that talks to a local LLM and writes or enhances prompts for you; this node is where you pick the model, the sampling parameters, the system prompt, and optionally feed it images. The two wire together - options out, generator in - and without this node the generator runs on whatever defaults the pack baked in.

The fun origin story: the author added the generator because standalone llama.cpp was noticeably faster than ComfyUI's own LLM implementations, and borrowed the system-prompt template idea from Z-Image Turbo's demo. So it's genuinely a "run a real LLM locally" setup, not a toy.

How it works

The backend is llama.cpp (default) or Ollama, configured in ComfyUI Settings under Prompt Manager. On the llama.cpp path, the pack talks to a local llama-server process and can auto-download the Qwen3.5-9B GGUF models from HuggingFace into your models/gguf folder - no manual download dance. The model dropdown lists local GGUF files first, then the downloadables, with sizes right in the tooltip: the default UD-Q4_K_XL is ~6GB, Q8_0 ~9.5GB, UD-Q8_K_XL ~13GB. On the Ollama path, the dropdown lists whatever you've ollama pulled.

The settings that matter:

  • system_prompt_mode and system_prompt - append adds your text after the built-in LLM instructions (which are tuned for detailed text-to-image prompts); replace throws the defaults away entirely. Leave it empty to use defaults.
  • temperature, top_k, top_p, min_p, repeat_penalty - standard LLM sampling knobs. Temperature 0.7 is the default; crank it down toward 0.4 if the generator keeps writing purple prose.
  • context_size - default 4096, and the pack picks a sensible default from your VRAM (bigger on 24GB+ cards). Bump it for vision models or long prompt sessions.
  • image2 through image5 - connect up to four more images for the Analyze Image modes (the generator's first image slot handles the fifth). These are required if you're analyzing images.
  • use_model_default_sampling - on by default, and it overrides all the sampling knobs. Turn it off before you start fiddling with temperature, or you'll wonder why nothing changes.
  • show_everything_in_console - prints the system prompt, user prompt, thinking, and raw response to the console. The debugger's best friend.

The single output is options, which feeds the Prompt Generator's options input.

Installing

The pack is the easy part:

cd ComfyUI/custom_nodes
git clone https://github.com/FranckyB/ComfyUI-Prompt-Manager.git
cd ComfyUI-Prompt-Manager
pip install -r requirements.txt

The generator additionally needs llama-server on PATH (Windows: winget install llama.cpp; Linux/macOS: brew install llama.cpp), or an Ollama install with models pulled. If you're using Ollama, the pack doesn't download models for you - that's ollama pull's job.

Where people get burned

Most "it doesn't work" reports trace back to llama-server not being installed or not on PATH - the generator will sit there and then error. Check show_everything_in_console before anything else when debugging; it shows you exactly what the model got and returned. And remember the Qwen models are vision-capable, but the mmproj vision file downloads alongside the main model, so the first generation after install can take a while as ~6GB lands. On a machine with less than ~16GB VRAM, drop to the Q4 and consider the CPU path - a 9B model at Q4 is heavy but usable.

CategoryPrompt Manager

Inputs (17)

NameTypeDefaultDescription
modeloptCOMBOQwen3.5-9B-UD-Q4_K_XL.ggufSelect model to use (local models listed first, then HuggingFace models) Download sizes: UD-Q4_K_XL ~6GB | Q8_0 ~9.5GB | UD-Q8_K_XL ~13GB
image2optIMAGEConnect an image (required for 'Analyze Image' and 'Analyze Image with Prompt' modes)
image3optIMAGEConnect an image (required for 'Analyze Image' and 'Analyze Image with Prompt' modes)
image4optIMAGEConnect an image (required for 'Analyze Image' and 'Analyze Image with Prompt' modes)
image5optIMAGEConnect an image (required for 'Analyze Image' and 'Analyze Image with Prompt' modes)
system_prompt_modeoptCOMBOappendreplace: the text below fully replaces the default LLM instructions append: the text below is added after the default LLM instructions
system_promptoptSTRINGCustom LLM Instructions (leave empty to use default) The default instructions are designed for generating detailed and imaginative prompts for text-to-image generation.
use_model_default_samplingoptBOOLEANtrueUse the model's default sampling parameters (overrides temperature, top_p, etc)
temperatureoptFLOAT0.700–2Controls randomness (0.0 = deterministic, 2.0 = very random)
top_koptINT200–100Sample from top K most likely tokens (0 = disabled)
top_poptFLOAT0.900–1Nucleus sampling: consider tokens with top_p probability mass
min_poptFLOAT0.050–1Minimum probability threshold relative to top token
repeat_penaltyoptFLOAT1.001–2Penalty for repeating tokens (1.0 = no penalty)
context_sizeoptINT4096512–32768Context size (increase for vision models or large prompts)
show_everything_in_consoleoptBOOLEANfalsePrint system prompt, user prompt, thinking process, and raw model response to console
max_lengthoptINT5121–32768Maximum number of tokens to generate when the Prompt Generator is connected to a CLIP/text encoder.
gpu_deviceoptSTRINGGPU device index for llama.cpp (e.g. '0', '1'). Leave empty to use the system default GPU. Useful with multi-GPU setups to control which GPU loads LLM weights.

Outputs (1)

NameTypeDescription
optionsOPTIONS