LM Studio 988
A local LLM/VLM inside your ComfyUI graph, no API key, no cloud
- image1
- image2
- image3
- image4
- response
- reasoning
- troubleshooting
The name is a lie in the best possible way: this node doesn't call any API and needs no key. It talks to LM Studio, the local LLM app, which runs the model on your own machine - which is exactly the "local, uncensored, free per call" path the KB's LLM-in-ComfyUI essay says the community converged on for prompt enhancement and captioning. ComfyUI + LM Studio is a mainstream pattern (460+ corpus threads), and this node is the adapter that drops it straight into your graph as a first-class citizen.
It's adapted from EA_LMStudio (MIT, credited in the pack README), which is a good pedigree. Where a lot of LLM nodes are cloud-first, this one is local-first by construction: you pick a model that's already loaded in LM Studio, and the node sends text (or images, for vision models) to your own server on localhost.
What it needs before it works
Three things, and two of them are on you:
- LM Studio installed and running.
- Its local server started - in LM Studio's Developer tab, enable the server (default
127.0.0.1:1234, which is what the pack's default config expects; override viaconfig/user_config.json). - The pack's Python deps installed - notably the
lmstudioSDK in its requirements.txt. Without that pip step, the node errors at load.
The model_selection dropdown is populated from the running server's model list, which is why it can look empty on a fresh install - load a model in LM Studio and hit refresh_models (or toggle it on) to re-fetch.
The inputs that matter
system_messageandprompt- the obvious two. There's alsodefault_system_message, a menu of 22 baked-in templates (Tags, Simple Description, Cinematic Description, Style Transfer, Enhance, …) that get appended after your own system message. Handy, and the author's own way of shipping prompt recipes.model_selection/custom_model_name- pick from the server, or enter an identifier manually.max_tokens(default 1024),temperature(default 0.7),seed- the standard generation controls, with tooltips that tell you exactly what they do.- Vision:
image1–image4plusimage_resize(No Resize / 512 / 768 / 1024 / 1536). Feed images to a VLM for captioning or image analysis - that's your VLM-captioning job from the KB, done locally. reasoning_mode- Auto-detect extracts thinking from reasoning models (DeepSeek, Qwen, QwQ, GLM, GPT-OSS), or use custom tags (default<think>/</think>) if a model uses non-standard ones. This is the "reasoning extraction" the README advertises, and it saves you from hand-stripping think-blocks.draft_model_selection- optional speculative-decoding draft model for faster generation.unload_all_models/empty_cuda_cache- free ComfyUI's VRAM before the LLM runs (both models share your card), andrefresh_modelsre-pulls the model list.
Outputs
Three strings: response (the model's answer - wire it to a CLIP Text Encode or a Display UI 988), reasoning (the extracted thinking, if any), and troubleshooting (diagnostics when something's wrong).
Gotchas
- No model in the dropdown: server not started, or hit
refresh_models. - VRAM pressure: LLM + diffusion on one card. The unload toggles exist for exactly this; the KB notes the good nodes do automatic unload/reload rather than holding two models resident.
- It's an output node, so it re-runs per generation - a long reply will add wall-clock time to every run. Set
max_tokensdeliberately. - Security-wise, this is the good shape of an LLM node: everything talks to your own localhost server, nothing phones home. Still, it executes arbitrary code with your user's access, same as every custom node - install from the official repo, and read what you install (the KB's LLMVISION caution applies to the whole category).
Install
Part of ComfyUI-988: Manager (search "ComfyUI-988") or:
cd ComfyUI/custom_nodes
git clone https://github.com/kajan988/ComfyUI-988
cd ComfyUI-988
pip install -r requirements.txt
Then restart. The lmstudio SDK in that requirements file is the one that makes the local-server connection work - don't skip it.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| system_message | STRING | You are a helpful assistant. | System prompt that defines the LLM's role and behavior. |
| default_system_message | COMBO | 🚫OFF | Select a predefined system message template to append after your custom system message. |
| prompt | STRING | The user prompt to send to the LLM. | |
| model_selection | COMBO | -- Custom (enter below) -- | Select a model from LM Studio. Select 'Custom' to manually enter a model identifier. |
| custom_model_name | STRING | Manual model identifier. Only used when 'Custom' is selected above. | |
| max_tokens | INT | 10241–131072 | Maximum OUTPUT tokens for the response. |
| temperature | FLOAT | 0.700–2 | Controls randomness. Lower = focused, Higher = creative. |
| seed | INT | 00–18446744073709550000 | Seed for reproducibility. |
| image_resizeopt | COMBO | Medium (768px) | Resize images before processing. Smaller = faster inference. |
| image1opt | IMAGE | First image input for vision models (VLMs). | |
| image2opt | IMAGE | Second image input for multi-image VLMs. | |
| image3opt | IMAGE | Third image input for multi-image VLMs. | |
| image4opt | IMAGE | Fourth image input for multi-image VLMs. | |
| draft_model_selectionopt | COMBO | -- Custom (enter below) -- | Optional draft model for speculative decoding. |
| custom_draft_modelopt | STRING | Manual draft model identifier. Leave empty to disable. | |
| top_popt | FLOAT | 1.000–1 | Nucleus sampling threshold. 1.0 = disabled. |
| top_kopt | INT | 00–500 | Top-K sampling. 0 = disabled. Recommended: 20-40 for thinking models. |
| repeat_penaltyopt | FLOAT | 1.000–2 | Penalizes repeated tokens. 1.0 = disabled. |
| reasoning_modeopt | COMBO | Auto-detect (recommended) | How to extract reasoning/thinking from model output. |
| custom_open_tagopt | STRING | <think> | Custom opening tag for reasoning extraction. |
| custom_close_tagopt | STRING | </think> | Custom closing tag for reasoning extraction. |
| unload_all_modelsopt | BOOLEAN | false | Unloads ComfyUI models (SD, VAE, etc.) from VRAM. |
| empty_cuda_cacheopt | BOOLEAN | false | Clears the CUDA cache. |
| refresh_modelsopt | BOOLEAN | false | Toggle ON to re-fetch the model list from LM Studio. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| reasoning | STRING | — |
| troubleshooting | STRING | — |