Nodes/comfyui-lmstudio/LM Studio Vision
ComfyUI Node

LM Studio Vision

Turn any image into a usable prompt with LM Studio's vision models

By SiegeKeebsOffical·Created 9 months ago·Updated 9 months ago· 4
LM Studio Vision
  • images
  • description
  • previous_conv
  • read_conv
querydescribe the image
debug
urlhttp://localhost:1234
model
temperature0.80
seed366608884
previous_conv

The name is half a lie, but in the good way. LM Studio Vision does no image generation and needs no API key - it shows a picture to a vision model running inside LM Studio and hands you back text. If you've ever saved a reference image and wished something would just write a detailed prompt for it, this is the node. It's the ComfyUI end of the "LM Studio vision model reads an image, writes a prompt, diffusion model draws it" pattern people actually run.

Why you'd reach for it

Image-to-prompt is the most genuinely useful LLM-in-ComfyUI workflow. Vision models like Qwen3-VL run comfortably in LM Studio, and the community workflow is exactly what this node wires up: load your image, ask for a structured description, and feed the result into a CLIP Text Encode (or any other text input) further down the graph. It also works for captioning datasets, checking what a model actually rendered, or turning a sketch into a prompt you can refine.

How it works

The mechanism is plain and worth knowing because it explains the failure modes. Each image in the batch is converted to a PNG, base64-encoded, and sent as an OpenAI-style image_url content part to {url}/v1/chat/completions on LM Studio. One request per batch - all your images ride in a single message. The reply comes back from choices[0].message.content. The timeout is 600 seconds, which sounds absurd until you send a big image to a local vision model on a busy GPU.

The model dropdown isn't a hardcoded list. The pack registers a small endpoint on ComfyUI's own server that asks LM Studio's /v1/models and fills the widget from whatever models are loaded. That's why an empty dropdown almost always means the LM Studio server isn't answering - not a missing file on your side.

The inputs that matter

Most of them you'll set once and forget:

  • images - any IMAGE output: Load Image, VAE Decode, whatever you want read.
  • query - your instruction. The default "describe the image" works, but the whole value is in asking for structure: "write a detailed prompt for a text-to-image model, split into subject, scene, style, lighting."
  • model - pick the vision model you've loaded in LM Studio. Load a text-only LLM here and it'll either error or invent content out of nothing.
  • url - leave it at http://localhost:1234 unless you changed LM Studio's port.
  • debug - set to enable once. It prints the exact request and full response to the ComfyUI console, which is the fastest way to see what the model was actually sent.

Temperature and seed pass straight through to the model. temperature at 0.8 is a decent default for description; drop it toward 0.2 if you want the same image to produce the same phrasing.

Wiring the outputs

Three outputs, two of which you'll use:

  • description - the text. Wire it into a text input anywhere in the graph.
  • previous_conv - the conversation as JSON, for threading into another LM Studio node's previous_conv to continue the chat.
  • read_conv - the same history formatted for humans. Preview Text is happy to show it.

Installing and setup

ComfyUI Manager → search "comfyui-lmstudio", or clone it in:

cd ComfyUI/custom_nodes
git clone https://github.com/SiegeKeebsOffical/comfyui-lmstudio

Restart ComfyUI. There are no model downloads - models live in LM Studio. The pack ships no requirements.txt, and the one import that isn't guaranteed is httpx; if you see ModuleNotFoundError: No module named 'httpx', pip install httpx and restart. On the LM Studio side: load a vision model, then start the local server (Developer tab → Local Server → Start Server). The default http://localhost:1234 matches the node's default URL.

Where people get burned

Three things trip people up. First, VRAM: LM Studio holds the LLM in VRAM while ComfyUI holds the diffusion model, and they fight. On a single card, use a small quantized vision model and unload it from LM Studio when you're sampling. Second, oversized images: base64 of a huge PNG is slow and can OOM the vision model - downscale the image before this node (the community tip for Qwen3-VL is to resize to a total-pixel budget first). Third: custom nodes execute arbitrary Python on load, and this exact "LLM in ComfyUI" category is what the malicious ComfyUI_LLMVISION pack faked back in 2024. This pack is a single readable .py file - skim it once, and don't expose ComfyUI to the internet.

CategoryLM Studio

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE
querySTRINGdescribe the image
debugCOMBO2 options: enable, disable
urlSTRINGhttp://localhost:1234
modelCOMBO0 options:
temperatureFLOAT0.800–1
seedINT3666088840–2147483648
previous_convoptSTRING

Outputs (3)

NameTypeDescription
descriptionSTRING
previous_convSTRING
read_convSTRING