🤖 LMStudio (OreX)
A local LLM node with a GUI and a chat, minus the cloud
- image
- Generated Text
- Request_lmstudio
If Ollama is the command-line way to run local LLMs, LM Studio is the "install a program, click a button" way - and the OreX pack has a node for it too. LMStudio (OreX) talks to the LM Studio server running on your machine at http://127.0.0.1:1234 and brings whatever model you've loaded there into ComfyUI as a text-generation node. Same shape as the pack's Ollama node, different backend: no API key, no cloud, and a familiar chat interface to pick and manage models on the LM Studio side.
How it works
It's a client for LM Studio's OpenAI-compatible API (/v1/chat/completions). On startup it queries /v1/models and fills the model_key dropdown with what's available, so you pick from the real list rather than typing IDs. When you run the queue it builds a chat request - system prompt plus your text_input - with generation options (temperature, top_p, context_length, max tokens), sends it, and returns the model's reply.
The feature set mirrors the Ollama node almost exactly, which makes sense since they share a codebase family:
- Vision. Plug an IMAGE into the optional
imageinput and it base64-encodes it (downscaled to ~0.7 MP) as an OpenAI-style image message. Great for "describe this image" or "what's wrong with this render" prompts. - Reasoning handling.
include_reasoningoff (default) strips<think>/[Thinking]blocks and even re-attaches separately-deliveredreasoning_contentwhen you do want it - DeepSeek R1-class models in LM Studio produce that field, and the node speaks to both layouts. - VRAM management.
clean_vram_beforeunloads ComfyUI's models before inference.auto_unload_modelplusunload_delayschedules the LM Studio model to be unloaded when done - it tries the officiallmstudioSDK first (the pack's console output will tell you if you shouldpip install lmstudio), then falls back to LM Studio's unload endpoint. There's even a per-model unload timer so batch queues don't get interrupted mid-run.
Inputs that matter
Same handful as the Ollama node: model_key (live dropdown), text_input, system_prompt / system_preset (a shared preset JSON with translators, short-answer, and image-sysprompt templates), seed for reproducibility, and the optional image input. Outputs are Generated Text (wire this onward) and Request_lmstudio - a JSON log of the exact request, invaluable when output misbehaves.
Install
ComfyUI Manager (search "comfyui-OreX") or:
cd ComfyUI/custom_nodes
git clone https://github.com/orex2121/comfyui-OreX
Restart. Then separately: install LM Studio, start the local server (Developer tab → "Start Server", default port 1234), and load a model in its GUI. The node reads LMSTUDIO_URL if your server is elsewhere. Optionally pip install lmstudio for smoother model unloads.
Common issues
- "Cannot connect to LM Studio" on run - the server isn't started or isn't on port 1234. Start it, then re-run.
- "SELECT A MODEL" forever - the dropdown couldn't reach
/v1/modelsat node-load time. Start LM Studio before ComfyUI, or restart ComfyUI after starting the server. - Text-only model ignoring your image - the model you loaded isn't vision-capable. Load a multimodal one in LM Studio.
- OOM with both apps on one GPU - enable
clean_vram_before; keepunload_delayat 0 so models free VRAM right after each call.
One honest note: Ollama vs LM Studio is a preference call, not a quality call. If you already run one, don't switch for the sake of this node - but if you like a GUI and per-model settings, LM Studio plus this node is a genuinely pleasant local-LLM setup.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| text_input | STRING | — | |
| system_prompt | STRING | — | |
| system_preset | COMBO | 8 options: None, Image Description, English translator, Translator into Russian, Translation into Chinese, Short answer, +2 | |
| model_key | COMBO | 1 options: SELECT A MODEL | |
| include_reasoning | BOOLEAN | false | — |
| auto_unload_model | BOOLEAN | true | — |
| unload_delay | INT | 00–3600 | — |
| clean_vram_before | BOOLEAN | false | — |
| seed | INT | 7770–18446744073709550000 | — |
| imageopt | IMAGE | — | |
| context_lengthopt | INT | 40960–131072 | — |
| max_tokensopt | INT | 00–18446744073709550000 | — |
| generation_parametersopt | BOOLEAN | false | — |
| temperatureopt | FLOAT | 0.700–2 | — |
| top_kopt | INT | 400–100 | — |
| top_popt | FLOAT | 0.950–1 | — |
| repeat_penaltyopt | FLOAT | 1.100–2 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Generated Text | STRING | — |
| Request_lmstudio | STRING | — |