Call LLM Advanced
Sampling sliders, penalties, and mirostat — for when Basic isn't enough
- LLM
- STRING
Call LLM Basic is fine until you need to steer the output. This is the steering wheel. Call LLM Advanced takes the same LLM plus prompt and returns the same STRING, but between them it exposes the full sampling toolset from llama.cpp - the same parameters llama.cpp's CLI and llama-cpp-python's create_completion accept. If you've ever tuned a local model, these names will be familiar; if not, here's the short version.
The inputs that matter
The core sampling trio, same as any local-LLM setup:
- temperature (0.8) - raw creativity dial.
- top_p (0.95) - nucleus sampling: only sample from tokens whose combined probability hits this threshold.
- top_k (40) - hard cap on candidate tokens per step. Between these three, temperature is the one you'll actually turn; top_p/top_k mostly sit at defaults.
Then the penalties, which are where you fix "the model won't shut up about the thing it likes":
- repeat_penalty (1.1) - punishes token repetition. Raise toward 1.2–1.3 if output loops or stutters.
- frequency_penalty (0) and presence_penalty (0) - OpenAI-style penalties that scale with how often a token has appeared, or whether it's appeared at all.
And the interesting niche stuff:
- min_p (0.05) - floor relative to the top token's probability; a cleaner modern alternative to top_k that a lot of people prefer.
- typical_p (1) - "typical sampling"; leave at 1 unless you're specifically experimenting.
- tfs_z (1) - tail-free sampling, another niche filter. 1 disables it.
- mirostat_mode / mirostat_tau / mirostat_eta - llama.cpp's adaptive sampling that adjusts temperature as it goes. Mode 0 (default) is off; 2 enables the actual Mirostat, with tau (5) as the target surprise and eta (0.1) as the learning rate. Worth a try if you want hands-off quality.
- echo (false) - whether to include your prompt in the returned string. Usually leave off.
- suffix - a string appended after the generation, for the rare "complete the text then add this" cases.
- seed (-1) - set it for reproducibility.
One output: STRING, the generated text. Same as Basic, same invisible-text trap - wire it into ShowText from ComfyUI-Custom-Scripts to actually see it.
What's disabled here
The README's known-issues list matters for this node specifically: stream, logprobs, stop, stopping_criteria, logits_processor, logits_bias, and grammar are all disabled. So no streaming output, no custom grammar (like GBNF), no stopping sequences. If you came here from a llama.cpp background expecting grammar=, that's the one real gap - you can't constrain output to JSON or a format without it. Plan your prompts around that.
Installing and troubleshooting
Standard pack install - Manager search "ComfyUI-Llama", or:
cd ComfyUI/custom_nodes
git clone https://github.com/daniel-lewis-ab/ComfyUI-Llama
with pip install llama-cpp-python for manual setups, GGUF models in ComfyUI/custom_nodes/ComfyUI-Llama/models, restart, then Ctrl+F5 to hard-refresh. Everything lives under the LLM menu.
One gotcha that bites new Advanced users: if the model starts repeating itself, everyone's first instinct is to crank repeat_penalty to 2.0. That over-corrects and makes output wooden. Move it in small steps (1.1 → 1.15 → 1.2) and watch the console - the pack's error handling is openly not mature, so the terminal is where failures actually show up. And remember the pack's no-loopback limitation: no known way to feed the model's own output back in for a dialogue. It's a one-shot generator, not a chatbot - use it that way and it works great.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| LLM | LLM | — | |
| prompt | STRING | — | |
| suffixopt | STRING | — | |
| max_response_tokensopt | INT | 16 | — |
| temperatureopt | FLOAT | 0.800–1 | — |
| top_popt | FLOAT | 0.95 | — |
| min_popt | FLOAT | 0.05 | — |
| typical_popt | FLOAT | 1.00 | — |
| echoopt | BOOLEAN | false | — |
| frequency_penaltyopt | FLOAT | 0.00 | — |
| presence_penaltyopt | FLOAT | 0.00 | — |
| repeat_penaltyopt | FLOAT | 1.10 | — |
| top_kopt | INT | 40 | — |
| seedopt | INT | -1 | — |
| tfs_zopt | FLOAT | 1.00 | — |
| mirostat_modeopt | INT | 0 | — |
| mirostat_tauopt | FLOAT | 5.00 | — |
| mirostat_etaopt | FLOAT | 0.10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |