LM Studio Generate Advance
Full sampler control, including the system prompt
- response
- previous_conv
- read_conv
LM Studio Generate Advance is the plain Generate node with the training wheels off. Same chat-completion call to LM Studio, same conversation outputs, but now you also get a system prompt, top_p, top_k, and a token cap. If Generate is the "ask the model a thing" node, Advance is the "make the model be something and then ask" node. It's the one you want when your prompt-enhancement pipeline depends on the model staying in character - literally, in the system-prompt sense.
Why you'd reach for it
The system prompt is the big deal, because it's how you actually steer a local LLM. A text-to-image workflow wants "You are a prompt engineer. Rewrite the user's idea as a detailed, comma-separated prompt for a diffusion model. Never include negative words." That instruction traveling with every turn changes the output far more than any slider, and none of the simpler nodes in this pack give you that slot. The sampler controls matter less for day-to-day use - but when you're fighting a model that repeats itself or rambles, top_p, top_k, and max_tokens are the levers you'll reach for.
How it works
The node posts an OpenAI-style request to {url}/v1/chat/completions on LM Studio. If you supply a system prompt, it's inserted as the first system message; a previous_conv thread is loaded if you provide one, then your prompt is appended as the user turn. The reply comes back from choices[0].message.content. filter_thinking (on by default) strips <think>/<thinking> reasoning blocks out of the answer, which you want on for any 2025+ reasoning model. debug - a plain boolean here, not the enable/disable enum on the base Generate - prints the full request and response to the console.
The inputs that matter
- system - the personality and constraints for the whole conversation. This is the one worth writing carefully.
- prompt - your actual question or source text.
- max_tokens - defaults to
-1(no cap). Set a real number, up to 4096, once a reply runs long. - top_p (0.9) and top_k (40) - sampling knobs; the defaults are fine for most local models.
- temperature - 0.8 default; lower it if rewrites drift from your source.
- model / url - the dropdown and server address, same as the rest of the pack.
Outputs
- response - the model's reply. Wire it to a text encoder or wherever the text belongs.
- previous_conv - the conversation as JSON, for threading into the next LM Studio node.
- read_conv - the same history formatted for humans.
Installing
The usual: ComfyUI Manager → search "comfyui-lmstudio", or
cd ComfyUI/custom_nodes
git clone https://github.com/SiegeKeebsOffical/comfyui-lmstudio
restart ComfyUI, load a model in LM Studio, start the local server on port 1234. No model downloads through the pack. If ComfyUI throws ModuleNotFoundError: No module named 'httpx', pip install httpx and restart.
Where people get burned
The system prompt is persistent - it rides along in the conversation and shapes every answer, so if output quality drops, check whether a stale system prompt from an old test is still in the graph. And remember the pack's standing rule: LM Studio and ComfyUI share your VRAM, so a big model loaded "just for the system prompt" will tax sampling. Keep the enhancement model small and quantized. When you're tuning samplers, do it one variable at a time with a fixed seed - change three knobs at once and you won't know which one fixed the output.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | What is Art? | — |
| debug | BOOLEAN | false | — |
| url | STRING | http://localhost:1234 | — |
| model | COMBO | 0 options: | |
| system | STRING | You are an art expert, gracefully describing your knowledge in art domain. | — |
| seed | INT | 796047180–2147483648 | — |
| temperature | FLOAT | 0.800–1 | — |
| top_p | FLOAT | 0.900–1 | — |
| top_k | INT | 400–100 | — |
| max_tokens | INT | -1-1–4096 | — |
| filter_thinking | BOOLEAN | true | — |
| previous_convopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| previous_conv | STRING | — |
| read_conv | STRING | — |