⚙️ LM Studio Model Params
Temperature and friends for your LM Studio chat, without leaving ComfyUI
- params
This one is pure plumbing, and that's the nicest thing you can say about it. ⚙️ LM Studio Model Params builds the settings dict - temperature, top-k, top-p, repetition penalty, max tokens - that 💬 LM Studio Chat sends along with your prompt. No networking, no model, no API key. It's a config box you plug into the chat node's params input so you can tune generation from inside the workflow instead of bouncing between the LM Studio app and your canvas.
The inputs are the predictable five. temperature (0.7), top_k (40), top_p (0.9), repetition_penalty (1.0), and max_tokens (2048, hard-capped at 8192). If you've touched any chat UI in the last few years you know what these do. Temperature and top-p control randomness - keep them low for a prompt enhancer you want consistent, raise temperature when you're brainstorming. repetition_penalty above 1.0 stops the model from looping, which small GGUFs do more than you'd expect. And max_tokens is where people get caught: the node won't let you set it above 8192, so if you're asking for a long detailed prompt or a full caption and getting truncated output, this is the ceiling you're hitting.
Then there's preset, the interesting one. The pack scans LM Studio's own preset folder - ~/.lmstudio/config-presets, or Library/Application Support/LM Studio/config-presets on macOS - for *.preset.json files and drops their names into the dropdown. Tick use_preset_values and the preset's saved values win over whatever you typed in the fields. Presets can also carry a system-prompt template, which the chat node picks up - including a {source_text} placeholder that swaps your whole prompt into the template. That's the power move: define your "you are a Flux prompt engineer, no preamble, 150 words" preset once in LM Studio, and this node hands it to the graph.
The output is exactly one thing: params (LMSTUDIO_PARAMS), wired into the chat or vision node's params input. And it's fully optional - the chat node has sensible defaults and works fine without it. Reach for this node when you want to tweak sampling from inside a workflow you run a lot, or when you have presets worth reusing.
Install
Same pack, same everything. ComfyUI Manager, search "comfyui-lmstudio-simple", or:
cd ComfyUI/custom_nodes
git clone https://github.com/huagusam/comfyui-lmstudio-simple
Restart. No dependencies beyond what ships with ComfyUI - the pack needs PIL and numpy, which are already there.
Gotchas
Troubleshooting is thin because there's so little to go wrong. The one real miss: if the preset dropdown shows only "default", the pack didn't find your presets - either you haven't saved any in LM Studio yet, or your LM Studio version stores them somewhere this pack doesn't look (newer releases have shuffled preset storage around, so this is the first thing to check if presets matter to you). Fix: save a preset in LM Studio, then add a fresh Model Params node and see if it shows up. If it still doesn't, the manual fields work identically with use_preset_values left off - you lose the template magic, but the sliders do their job.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| preset | COMBO | default | 1 options: default |
| temperatureopt | FLOAT | 0.70–2 | — |
| top_kopt | INT | 400–100 | — |
| top_popt | FLOAT | 0.900–1 | — |
| repetition_penaltyopt | FLOAT | 1.000–2 | — |
| max_tokensopt | INT | 20481–8192 | — |
| use_preset_valuesopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| params | LMSTUDIO_PARAMS | — |