ComfyUI Node
LM Studio Chat π
Sends a prompt - and optionally an image - to a local LM Studio server and returns the reply as text. Works with any OpenAI-compatible endpoint. Reasoning-model <think> blocks come out on their own output, so the text output stays clean for wiring into a conditioning prompt. Chain the history output into another chat node's history input for a multi-turn conversation, and fill json_schema to force a structured JSON reply. Caches like any node; change the seed to re-roll the same inputs.
LM Studio Chat π
- image
- history
- text
- thinking
- history
βpromptβΊ
βsystem_promptβΊ
βendpointhttp://127.0.0.1:1234/v1βΊ
βmodelβΊ
βtemperature0.70βΊ
βmax_tokens512βΊ
βseed0βΊ
βtimeout_seconds120βΊ
βimage_max_edge1024βΊ
βtop_p1.00βΊ
βtop_k0βΊ
βrepeat_penalty1.00βΊ
βmin_p0.00βΊ
βpresence_penalty0.00βΊ
βthinking_modemodel defaultβΊ
βreasoning_open_tag<think>βΊ
βreasoning_close_tag</think>βΊ
βidle_unload_seconds0βΊ
βfree_comfy_vramfalseβΊ
βunload_llmfalseβΊ
βjson_schemaβΊ
Categoryπ AusBoss/Text
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | What to ask. Required unless an image is connected - an image with an empty prompt asks for a plain description. | |
| system_prompt | STRING | Optional role and rules for the model, e.g. 'You write single-paragraph Stable Diffusion prompts, no preamble.' Empty sends no system message. | |
| endpoint | STRING | http://127.0.0.1:1234/v1 | The server's base URL - LM Studio shows it on its Developer tab. A bare host:port or a full /v1 path both work; any OpenAI-compatible server is fine. |
| model | STRING | Model identifier as LM Studio lists it. Empty uses whatever the server has loaded, which is the everyday case. | |
| temperature | FLOAT | 0.700β2 | Sampling randomness: 0 is near-deterministic, 0.7 balanced, higher wanders. Captioning likes 0.2-0.5. |
| max_tokens | INT | 512-1β131072 | Longest allowed reply, in tokens. -1 leaves the length to the server. Reasoning models spend tokens thinking before answering, so give them room. |
| seed | INT | 00β18446744073709550000 | Sent to the server, and either way a changed seed re-runs the node instead of replaying the cached reply - the re-roll knob. |
| timeout_seconds | INT | 1205β3600 | How long to wait for the reply. Cold-loading a big model or a long think can need minutes. |
| image_max_edge | INT | 10240β8192 | Downscale a connected image so its longest edge fits this before sending; 0 sends full size. Vision models resize internally anyway, and a smaller upload prefills much faster. |
| imageopt | IMAGE | Optional image for vision models. Only the FIRST frame of a batch is sent - pick one with Select Frame π for video. A text-only model errors server-side if an image arrives. | |
| top_popt | FLOAT | 1.000β1 | Nucleus sampling cap; 1 sends nothing and the server default applies. |
| top_kopt | INT | 00β1000 | Top-k sampling cutoff; 0 sends nothing. |
| repeat_penaltyopt | FLOAT | 1.000β4 | Repetition penalty; 1 sends nothing. |
| min_popt | FLOAT | 0.000β1 | Minimum token probability; 0 sends nothing. |
| presence_penaltyopt | FLOAT | 0.00-2β2 | Presence penalty; 0 sends nothing. |
| thinking_modeopt | COMBO | model default | Force a hybrid reasoning model to think or not via chat_template_kwargs (Qwen-style templates honor it; others ignore it). |
| reasoning_open_tagopt | STRING | <think> | Tag that opens a reasoning block in the reply; the block moves to the thinking output. |
| reasoning_close_tagopt | STRING | </think> | Tag that closes a reasoning block. |
| idle_unload_secondsopt | INT | 00β86400 | LM Studio JIT TTL: unload the model after idling this many seconds. 0 sends nothing. |
| free_comfy_vramopt | BOOLEAN | false | Unload ComfyUI's cached models before the request so a big LLM fits alongside a big diffusion model on one GPU. |
| unload_llmopt | BOOLEAN | false | Unload the language model right after the reply (LM Studio JIT ttl) so its VRAM is free for the diffusion models and text encoders that run next. Overrides the gear menu's idle-unload timer. |
| historyopt | AUSBOSS_CHAT_HISTORY | Prior turns from another LM Studio Chat π node's history output; they replay before this prompt so the model remembers the conversation. Images are not carried between turns. | |
| json_schemaopt | STRING | Paste a JSON Schema to force the reply into that exact structure (LM Studio structured output). {"type": "object"} allows any JSON; empty replies as plain text. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | The model's reply with any <think> blocks removed - safe to wire straight into a text encoder. |
| thinking | STRING | The reasoning a thinking model emitted, empty for ordinary models. Useful for a preview node while tuning prompts. |
| history | AUSBOSS_CHAT_HISTORY | The conversation including this exchange - wire into another chat node's history input to continue the thread. |