LM Studio (Unified)
One node for text, images, or both — the lazy route to local LLMs
- image
- Generated Text
The Unified node is the "just talk to a model" option in this pack. Where its siblings specialize - Image to Text is vision-only, Text Gen is text-only - this one takes a text prompt, an image, or both, and returns a single generated text string. The default text_input is literally "give me a prompt for an image generation," which tells you what the author thinks you'll do with it: sit in front of a checkpoint with no idea what to type, and let a local LLM in LM Studio write your prompt for you.
And that genuinely is the killer use. LLM-assisted prompting has become routine in the ComfyUI world - prompt-enhancer mentions grew twentyfold between 2023 and 2026 - and the community's advice has settled into one sentence: if writing a prompt for a modern LLM-encoded model is hard, have an LLM translate what you want into a well-structured prompt following the model's own guide. Unified is that, as a node, with the option to throw in a reference image when your idea is visual rather than verbal.
How it works
Same machinery as the whole pack: an lmstudio SDK client connects to your local LM Studio server (localhost:1234, automatically - no key, no IP/port to type), builds a chat from system_prompt plus your input, streams the answer, and returns the finished text. The difference is what it accepts. An image input is optional, and so is text_input - just don't leave both empty, or the node has nothing to work with.
If you pass both, the image and text go into the same user message, which is the interesting combo: "Look at this image and give me a prompt for a scene like it, but at night." That's the workflow the other two nodes can't do in one shot.
Inputs worth touching
text_input- your instruction; defaults to the prompt-for-image-generation example above.system_prompt- set this if you want the output to match a specific checkpoint's style (comma-separated tags, the{this|that}wildcard syntax, whatever the model guide recommends).image- optional; requires a vision-capablemodel_key.model_key- defaultgemma-3-4b-it-qat. Switch to something likeqwen/qwen3-vl-8bif your input is image-based.seed,max_tokens(1000),temperature(0.7),strip_thinking(on),auto_unload/unload_delay- all the standard dials from the pack. Lower the temperature for prompt-writing; leavestrip_thinkingalone.
The output is a single Generated Text (STRING) that feeds into CLIP Text Encode, a ShowText node, or back into another LLM node.
When to pick it over the others
Honest take: if you know you only need text-to-text, the Text Gen node is the cleaner choice - it's the same engine with fewer knobs to trip over. If you're doing vision-only captioning, use Image to Text. But if you're prototyping, sharing a workflow, or want text-plus-image in one call, Unified is the one that keeps your graph small. Its IS_CHANGED logic re-runs on any input change, so be aware it'll call the model whenever you tweak a widget - that's expected, not a bug.
Install and troubleshooting
ComfyUI Manager (search "LM Studio") or git clone https://github.com/mattjohnpowell/comfyui-lmstudio-image-to-text-node into custom_nodes, pip install lmstudio if needed (the pack auto-installs at load), restart ComfyUI. LM Studio must be running with the Server started and a model loaded.
The usual failure stack applies: server not running, model_key not in your library, or a non-vision model getting an image (which fails loudly). Flip debug on and read the console. Post-upgrade bosToken errors mean your SDK is behind your LM Studio app - pip install lmstudio --upgrade (or run upgrade_lmstudio.py) and restart ComfyUI completely.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| text_input | STRING | give me a prompt for an image generation | — |
| system_prompt | STRING | You are a helpful AI assistant. | — |
| model_key | STRING | gemma-3-4b-it-qat | — |
| auto_unload | COMBO | True | 2 options: True, False |
| unload_delay | INT | 00–3600 | — |
| seed | INT | -1-1–18446744073709550000 | — |
| imageopt | IMAGE | — | |
| max_tokensopt | INT | 10001–4096 | — |
| temperatureopt | FLOAT | 0.700–2 | — |
| debugopt | BOOLEAN | false | — |
| timeout_secondsopt | INT | 30010–3600 | — |
| strip_thinkingopt | BOOLEAN | true | Strip <think>...</think> reasoning blocks from the response (for models with thinking mode enabled). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Generated Text | STRING | — |