π² LLM Sampling Options
Fine-grained sampling knobs for the LLM, without touching the server config
- server
- server
- options
The LLM Wildcard Manager pack works fine with just a π² LLM Server Config feeding the Manager and Resolver. LLM Sampling Options is the optional layer for when you want to tune how the model samples - top-k, top-p, min-p, repetition penalty, context size - without editing a config file or restarting anything. You drop it between the Server Config and the rest of the pack: LLMServerConfig β LLMSamplingOptions β Manager/Resolver. Its server output is still an LLM_SERVER, so it slots in anywhere the base server does.
It's the least documented node in the pack - it's not even in the README's node table - which is a shame, because it's the one that saves you when the wildcard resolver starts emitting weirdly repetitive values. That's a sampling problem as much as a prompt problem, and repeat_penalty is the lever for it.
What you can tune
temperature- override the server's value;-1keeps the server's.0.0is deterministic,2.0very random.top_k,top_p,min_p- the usual sampling controls.0means "not sent," so the server uses its own defaults.repeat_penalty- repetition penalty,1.0= off. Bump it when a category keeps producing near-identical values.context_size- token window in tokens;0= server default. Handy when you're running Ollama on a small card and want to cap the context so the model stays fast.use_model_default_sampling- the reset button: drop all overrides and let the model use built-in defaults. Temperature from the base server still applies.system_prompt- here's the catch worth knowing. This field is only honored if you wire the node into an external consumer that reads it - specifically the "Prompt Generator" node from ComfyUI-Prompt-Manager. The wildcard Manager and Resolver use their own per-step prompts and ignore it. So don't expect this to change wildcard behavior.show_everything_in_console- prints the system prompt, user prompt, sampling options, and raw replies to the ComfyUI console. This is your debugging switch; flip it when a slot misbehaves and you want to see the exact request.
Outputs
Two sockets:
server- the enhancedLLM_SERVER, layered on top of whatever came from upstream. Wire this to the Manager and Resolver instead of the raw config.options- anOPTIONSbundle shaped to match ComfyUI-Prompt-Manager's "Prompt Generator" node contract. Wire it into that node'soptionsinput and you can drive sampling, model, and system prompt from one place across both packs.
Under the hood it's just a dict merge: it shallow-copies the upstream server bundle, adds the fields you set, and only sends a sampling key when its value is non-zero (or above 1.0 for the penalty). Zero fiddly behavior, which is more than you get from most "options" nodes.
Installing
Same pack install: ComfyUI Manager β LLM Wildcard Manager, or git clone https://github.com/pclshm/comfyui-llm-wildcard-manager into ComfyUI/custom_nodes, restart. No deps, no models.
If you never change sampling settings, skip it - it's strictly an override layer and the Server Config's temperature alone will get you 90% of the way. Add it when the resolver's output starts feeling same-y or you're debugging a specific slot, and keep show_everything_in_console in your back pocket.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| server | LLM_SERVER | β | |
| use_model_default_samplingopt | BOOLEAN | false | If ON, drop all sampling overrides and let the model use its built-in defaults. Temperature from the base server is still applied. |
| temperatureopt | FLOAT | -1.00-1β2 | Override the server's temperature (-1 = keep server value). 0.0 = deterministic, 2.0 = very random. |
| top_kopt | INT | 00β200 | Sample from top K tokens (0 = disabled / not sent). |
| top_popt | FLOAT | 0.000β1 | Nucleus sampling threshold (0.0 = not sent). |
| min_popt | FLOAT | 0.000β1 | Minimum probability relative to the top token (0.0 = not sent). |
| repeat_penaltyopt | FLOAT | 1.001β2 | Repetition penalty (1.0 = no penalty / not sent). |
| context_sizeopt | INT | 00β131072 | Context window size in tokens (0 = use server default / not sent). |
| system_promptopt | STRING | Custom system prompt. Used only when wired into a node that reads it (e.g. Prompt Generator). Leave empty to use the consumer's defaults. | |
| show_everything_in_consoleopt | BOOLEAN | false | Print system prompt, user prompt, sampling options, and raw replies to the ComfyUI console. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| server | LLM_SERVER | β |
| options | OPTIONS | β |