LLM Chat (llama.cpp, integrated)
A local LLM that writes your music prompts — no API key, no second node pack
- text
- status
- thinking
MiniMaxLLMChat is the brain of the MiniMax Music Production Toolkit: a self-contained llama.cpp chat node that turns the structured brief from the Song Prompt node into the full [Caption] / [Lyrics] / [Title] / [Image_Prompt] package that MiniMax Music 3 and your FLUX cover branch actually consume.
And here's the part that surprises people given the "MiniMax" in the name: it never calls a MiniMax API and needs no key. It's a local GGUF model running through llama-cpp-python, sitting entirely inside your ComfyUI graph. That's the same local-LLM pattern the image community settled on for prompt enhancement - a small obedient model on your own card is plenty for structured rewriting, and it costs nothing per call.
The pack used to punt this job to the external ComfyUI-LLM-Session nodes. Since v2.0.0 the chat is integrated here, so the example workflow is toolkit-plus-ComfyUI-core only.
How it works
The node loads a llama.cpp GGUF from models/llm, sends one system+user turn, and returns the assistant text. By default (reset_session ON) every run is a fresh single-turn chat - that's the recommended setting. Turn it OFF and llama.cpp session state is kept per session_id, so you can hold a multi-turn conversation. A new session_id value also busts ComfyUI's output cache, which is how you force a fresh creative pass on identical genre prompts in a batch.
Reasoning models are handled properly: with thinking set to off, the node asks the backend to skip reasoning and always splits any <think> blocks out of the answer, logging them separately. Your parser downstream only ever sees the clean answer - that matters, because leaked reasoning text is exactly the kind of junk that used to pollute generated prompts.
Inputs that matter
enabled- master switch. Set it false and the node returns empty text without loading any model, and the rest of the workflow falls back to manual fields. Great for testing without an LLM on the card.model- any GGUF inmodels/llm. The example nameQwen3.8-27B-UD-IQ3_XXS.ggufis always offered, but that file is not bundled - you provide it or configure a download URL.max_tokens(example 16384) andn_ctx(example 32768) - the generous defaults exist because one response has to fit a detailed caption, a long instrumental structure map, lyrics, a title and a cover prompt. Don't shrinkn_ctxcasually; the production system prompt eats a real chunk of it.chat_format-autopicks the verified template per model family (chatml for Qwen-style models, the model's own embedded template for Gemma). The author verified Qwen3.8-27B and Gemma 4 end to end;nonefalls back to the GGUF's own template.temperature/top_p/top_k/min_p- the LM Studio-style sampling set, defaults 0.7 / 0.8 / 40 / 0.n_gpu_layers(-1 = offload everything),seed(-1 = random each run), and the multi-GPU quartetsplit_mode,tensor_split(tryevenor fractions like2,3),main_gpu,tensor_parallel- only relevant with more than one GPU.
Outputs
text- the assistant response; wire it into the pack's parser node (MiniMaxParseExternalLLMOutputV16), which splits out Caption/Lyrics/Title/Image_Prompt.status- a one-line report (model, session mode, character count) for diagnostics and the production JSON.thinking- the split-off reasoning, if any.
Installing
Everything is in requirements.txt except one package. After cloning the pack you need llama-cpp-python in the same Python that runs ComfyUI:
python -m pip install llama-cpp-python
Then drop a GGUF in ComfyUI/models/llm. If llama-cpp-python is missing the node still registers - you only get a clear error at execution time, which is polite but means the failure happens mid-run, not at startup.
Where people get burned
The model file is the #1 stumble: the dropdown shows the example filename whether or not the file exists, and with auto_download ON it will only fetch a GGUF whose URL is actually configured in models_config.json. No URL configured means a clear error naming the expected location - read it before blaming the node. And budget your VRAM: a 27B-quantized GGUF shares the card with the MiniMax generation stage that runs next. That's not this node's job to solve - the integrated unload node exists for exactly that.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | BOOLEAN | true | Master switch for the LLM section. When disabled, the node returns empty text without loading any model and the parser node can fall back to its manual fields — so the LLM part of the workflow can be switched off without an error. |
| user_text | STRING | Assembled user prompt text, normally from the Structured Song Prompt node. | |
| system_prompt | STRING | System prompt text, normally from the Structured Song Prompt node or the LLM Prompt Library / Template node. | |
| session_id | STRING | Session/cache-buster string from LLM Session ID / Cache Buster. A new value makes the node generate a fresh response instead of reusing ComfyUI's output cache. | |
| model | COMBO | Qwen3.8-27B-UD-IQ3_XXS.gguf | llama.cpp-compatible GGUF from models/llm. The example workflow references the same example model as before; provide the file or configure a download URL in models_config.json. |
| max_tokens | INT | 163841–131072 | Maximum number of tokens the LLM may generate. The example workflow uses 16384 so complete Caption/Lyrics/Title/Image Prompt sections fit. |
| temperature | FLOAT | 0.700–2 | Sampling temperature. Lower values are more deterministic; the example uses 0.7. |
| top_p | FLOAT | 0.800–1 | Nucleus sampling threshold. The example uses 0.8. |
| n_gpu_layers | INT | -1-1–512 | Number of model layers offloaded to the GPU. -1 offloads as many as possible. The model is reloaded when this or n_ctx changes. |
| n_ctx | INT | 32768512–262144 | Context window size in tokens. The example uses 32768 for the long production system prompt plus response. |
| reset_session | BOOLEAN | true | When enabled, every run is a fresh single-turn chat (the recommended example setting). When disabled, llama.cpp session state is kept per session_id for multi-turn conversations. |
| auto_download | BOOLEAN | true | When enabled and a download URL is configured in models_config.json, a missing GGUF is downloaded automatically. Missing models without a configured URL always produce a clear error. |
| chat_format | COMBO | auto | Chat template applied to the conversation. auto picks the verified template for the model family (chatml for Qwen-style models with clean <think> handling, the model's own embedded template for Gemma); none uses the GGUF's own template; chatml/qwen/gemma/llama-3 pass the named template through. Models verified with auto: Qwen3.8-27B and Gemma 4. |
| thinking | COMBO | off | Reasoning/thinking output handling. off asks the backend to disable reasoning where supported and always splits any <think> blocks off the answer (they are logged and recorded separately); on/auto keep them. The parsed Caption/Lyrics/Title/Image_Prompt only ever see the clean answer. |
| top_k | INT | 401–1000 | Top-K sampling limit (LM Studio default 40). Restricts sampling to the K most likely tokens per step. |
| min_p | FLOAT | 0.000–1 | Minimum probability (Min-P) sampling; tokens below min_p times the top probability are excluded. 0 disables it (default). |
| repeat_penalty | FLOAT | 1.100–3 | Penalty applied to tokens that already appeared in the text (1.0 = off, 1.1 is the common default). |
| presence_penalty | FLOAT | 0.00-2–2 | Per-token penalty for any token that appeared at least once; discourages reuse (0 = off). |
| frequency_penalty | FLOAT | 0.00-2–2 | Per-token penalty proportional to how often a token appeared; discourages repetition (0 = off). |
| seed | INT | -1-1–2147483647 | Random seed for sampling; -1 uses a random seed for every run. |
| split_mode | COMBO | none | Multi-GPU distribution mode (default: none = no splitting). layer distributes whole layers sequentially across GPUs; row (a.k.a. split parallel) splits layer tensors row-wise across GPUs and can help with large contexts. Only relevant when more than one GPU is present. |
| tensor_split | STRING | VRAM distribution across GPUs. Empty = llama.cpp auto-distributes. 'even' = split evenly across all detected GPUs. Or give comma-separated fractions/weights (e.g. 2,3 or 0.4,0.6); weights are normalized to sum to 1. The resolved split is logged. | |
| main_gpu | INT | 00–16 | GPU index used for the intermediate results buffer when splitting across GPUs (normally 0). |
| tensor_parallel | BOOLEAN | false | Request true tensor parallelism across GPUs when the installed llama-cpp-python build supports it (0.3.48 does not; upgrade llama-cpp-python to use it). If unsupported, the node logs a warning and falls back to split_mode/tensor_split. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| status | STRING | — |
| thinking | STRING | — |