Nodes/ComfyUI-988/LM Studio 988
ComfyUI Node

LM Studio 988

A local LLM/VLM inside your ComfyUI graph, no API key, no cloud

By kajan988·Created 3 months ago·Updated about a month ago· 1
LM Studio 988
  • image1
  • image2
  • image3
  • image4
  • response
  • reasoning
  • troubleshooting
system_messageYou are a helpful assistant.
default_system_message🚫OFF
prompt
model_selection-- Custom (enter below) --
custom_model_name
max_tokens1024
temperature0.70
seed0
image_resizeMedium (768px)
draft_model_selection-- Custom (enter below) --
custom_draft_model
top_p1.00
top_k0
repeat_penalty1.00
reasoning_modeAuto-detect (recommended)
custom_open_tag<think>
custom_close_tag</think>
unload_all_modelsfalse
empty_cuda_cachefalse
refresh_modelsfalse

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:

  1. LM Studio installed and running.
  2. 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 via config/user_config.json).
  3. The pack's Python deps installed - notably the lmstudio SDK 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_message and prompt - the obvious two. There's also default_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: image1image4 plus image_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), and refresh_models re-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_tokens deliberately.
  • 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.

Category🦇988/LM Studio

Inputs (24)

NameTypeDefaultDescription
system_messageSTRINGYou are a helpful assistant.System prompt that defines the LLM's role and behavior.
default_system_messageCOMBO🚫OFFSelect a predefined system message template to append after your custom system message.
promptSTRINGThe user prompt to send to the LLM.
model_selectionCOMBO-- Custom (enter below) --Select a model from LM Studio. Select 'Custom' to manually enter a model identifier.
custom_model_nameSTRINGManual model identifier. Only used when 'Custom' is selected above.
max_tokensINT10241–131072Maximum OUTPUT tokens for the response.
temperatureFLOAT0.700–2Controls randomness. Lower = focused, Higher = creative.
seedINT00–18446744073709550000Seed for reproducibility.
image_resizeoptCOMBOMedium (768px)Resize images before processing. Smaller = faster inference.
image1optIMAGEFirst image input for vision models (VLMs).
image2optIMAGESecond image input for multi-image VLMs.
image3optIMAGEThird image input for multi-image VLMs.
image4optIMAGEFourth image input for multi-image VLMs.
draft_model_selectionoptCOMBO-- Custom (enter below) --Optional draft model for speculative decoding.
custom_draft_modeloptSTRINGManual draft model identifier. Leave empty to disable.
top_poptFLOAT1.000–1Nucleus sampling threshold. 1.0 = disabled.
top_koptINT00–500Top-K sampling. 0 = disabled. Recommended: 20-40 for thinking models.
repeat_penaltyoptFLOAT1.000–2Penalizes repeated tokens. 1.0 = disabled.
reasoning_modeoptCOMBOAuto-detect (recommended)How to extract reasoning/thinking from model output.
custom_open_tagoptSTRING<think>Custom opening tag for reasoning extraction.
custom_close_tagoptSTRING</think>Custom closing tag for reasoning extraction.
unload_all_modelsoptBOOLEANfalseUnloads ComfyUI models (SD, VAE, etc.) from VRAM.
empty_cuda_cacheoptBOOLEANfalseClears the CUDA cache.
refresh_modelsoptBOOLEANfalseToggle ON to re-fetch the model list from LM Studio.

Outputs (3)

NameTypeDescription
responseSTRING
reasoningSTRING
troubleshootingSTRING