LMStudio - Text Gen
The plainest node in the pack — a bare local LLM call you can wire anywhere
- connection
- Response
Text Gen is the tap at the end of the plumbing
If LMStudio - Connect is the plumbing, this is the tap: a system prompt, a user prompt, and a string comes out the other side. No image, no bells, no automatic anything. It's a plain chat completion against your local LM Studio server, dropped into the graph as a node. For a lot of people that's exactly what they want - a "think about this and give me text" box they can thread into a workflow.
What you'd actually use it for
The honest use case is prompt work. Modern checkpoints are increasingly LLM-encoded, and as the community keeps rediscovering, those models are prompt-instructed rather than fed a token bag - so having a local LLM rewrite or expand a prompt in-graph is a real workflow, not a gimmick. Wire Text Gen's output into a sampler's positive prompt and you get "generate five variations of this idea" without leaving ComfyUI. It's also handy as a general helper: summarise, brainstorm, draft - the same LM Studio chat you'd run anyway, but with its result available to the rest of the graph.
How it works
The node builds a system + user message pair and sends it through the OpenAI SDK, trying the newer responses endpoint first and falling back to chat.completions if the server (or an older LM Studio build) doesn't support it. If it fell back, the status preview tells you, complete with the reason. The seed input defaults to -1, which means a secure random seed - set a fixed value if you want reproducible output. Whatever the model returns, <think>...</think> reasoning blocks are stripped out so you get visible text, not a hidden trace.
Inputs and output
- connection - the
LMSTUDIO_CONNECTIONoutput from LMStudio - Connect. It carries the model, temperature, max tokens, and timeout, so you don't set those here. - system_prompt - the assistant's persona. Defaults to "You are LM Souls, an expert prompt engineer and creative assistant." Multiline; worth rewriting for your actual task.
- user_prompt - what you want back. Multiline, and can be linked from another node's string output.
- seed -
-1for random, any non-negative integer to reproduce.
The single output, Response (STRING), feeds anything that accepts a string: a sampler's prompt, a text preview node, or another tool further down the graph.
Setup and the usual suspects
Install the pack once and it serves all three nodes: ComfyUI Manager search "LMStudio Remote Nodes", or cd ComfyUI/custom_nodes && git clone https://github.com/glonlas/comfyUI-LMStudio-nodes, pip install -r requirements.txt, restart. Dependencies are light (openai, numpy, Pillow) and there are no model files - the model runs in LM Studio, not ComfyUI.
Common failure modes are mostly upstream of this node. The model must actually be loaded in LM Studio, not just installed - LM Studio serves whatever is currently in memory, and an empty or erroring response usually means nothing is loaded. If you get nothing back and the model is a reasoning one, the node can hit the case where everything came back inside a <think> block and there's no visible text to return - flip the Connect node's thinking to off and the model answers directly. And as always with this pack: it's an unofficial, small, "vibecoded" utility, so glance at the source before wiring it into something you care about.
The honest bottom line
Text Gen is the thinnest node here, and it knows it. It's a bare call with no prompt presets, no template management, no streaming niceties. If you want a full prompt-engineering toolkit you'd reach for a dedicated pack instead. But when you just need "local LLM, in my graph, right now," this is the node - zero frills, which is the feature.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| connection | LMSTUDIO_CONNECTION | Connection output from LMStudio - Connect node. | |
| system_prompt | STRING | You are LM Souls, an expert prompt engineer and creative assistant. | System instructions that define assistant behavior. |
| user_prompt | STRING | Write a concise prompt for a cinematic portrait scene. | User input to transform into a final response. |
| seed | INT | -1-1–9223372036854776000 | -1 uses a secure random seed. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Response | STRING | Generated text output. |