LMStudio - Image To Text
Turn any image into a prompt with a local vision LLM — nothing leaves your machine
- connection
- image
- Response
The node that pays for the whole pack
This is the reason you install LMStudio Remote Nodes in the first place. Drop an image tensor in, get a written description out - captioning, image-to-prompt, reverse-engineering someone else's prompt, all against a vision model running locally in LM Studio. No cloud API, no uploads, no per-image cost. The images you feed it never leave your machine, which for anything remotely private is the entire pitch.
The community has settled on a signature use for this: caption an image with a Qwen3-VL model and feed the description straight back as the generation prompt, especially to LLM-encoded checkpoints that reward long, detailed prose. That "describe the image, then regenerate it from the description" loop is a reliable img2img technique, and it also happens to be how you bootstrap a caption set if you're curating training data for a LoRA.
How it works
The node takes your IMAGE tensor, converts it to PNG bytes, base64-encodes them into a data:image/png;base64,... URL, and sends that to the LM Studio server alongside your prompts. It goes through the OpenAI responses endpoint with the image as input_image content and your system prompt riding along as instructions. If the server doesn't support that endpoint, it falls back to chat.completions with a classic image_url - with one catch: the fallback only sends a single image, so extra frames in a batch get dropped, and the status preview tells you so.
The same thinking handling as the rest of the pack applies: thinking is inherited from the Connect node, and any <think>...</think> blocks are stripped from the final text. If the model returns nothing but a reasoning trace, the node raises rather than hand you an empty string.
Inputs and output
- connection - the
LMSTUDIO_CONNECTIONoutput from LMStudio - Connect. It carries model, temperature, max tokens, and timeout. - image - any
IMAGEtensor: a Load Image output, a frame from a video node, or the result of a sampler. - system_prompt - the assistant's persona, default "You are LM Souls, an expert image analyst and prompt writer." Multiline; rewrite it for your task (analyst vs. dataset-captioner vs. style-identifier all want different instructions).
- user_prompt - what you want said about the image, default "Describe this image and provide an optimized generation prompt." This is where you steer whether you get a plain description, tags, or a ready-to-paste generation prompt.
- seed -
-1for a secure random seed, or a fixed value to reproduce.
Output is a single Response STRING - wire it into a sampler's prompt, a preview, or anywhere else a string belongs.
Getting it running
Same install as the rest of the pack, done once: 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
then restart. Dependencies are just openai, numpy, Pillow; no model files live in ComfyUI. You need a vision-capable model loaded in LM Studio - Qwen3-VL and the LLaVA lineage both work, and Qwen3-VL is the community favorite for captioning quality. A text-only model won't understand the image content and you'll get confident nonsense or errors.
Where people get burned
Most failures are LM Studio side: the server isn't started (Developer tab, port 1234), or a text-only model is loaded instead of a vision one. Beyond that, the usual pack gotchas apply - it's an unofficial, quickly-vibecoded project with a tiny install base, so the README is short and worth reading, and the code is small enough to eyeball before you trust it with real work. If output comes back empty on a reasoning model, set thinking to off on the Connect node. And if you're feeding batches, know that only the responses path handles them fully - the fallback quietly keeps the first frame.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| connection | LMSTUDIO_CONNECTION | Connection output from LMStudio - Connect node. | |
| image | IMAGE | Input image tensor. | |
| system_prompt | STRING | You are LM Souls, an expert image analyst and prompt writer. | System instructions that define assistant behavior. |
| user_prompt | STRING | Describe this image and provide an optimized generation prompt. | User instruction for image understanding. |
| seed | INT | -1-1–9223372036854776000 | -1 uses a secure random seed. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Response | STRING | Generated text output. |