LLM Studio Structured Describe (Image)
Guaranteed-valid JSON captions without the parsing headache
- image
- json_output
- field_1
- field_2
- field_3
- field_4
- field_5
The annoying thing about asking an LLM for JSON is that you often get a JSON-ish paragraph with commentary glued to it, and then you're writing parsers and praying. LLM Studio Structured Describe (Image) removes that entire failure class: it uses LM Studio's JSON-schema structured output mode, so the model is constrained to return valid JSON matching a schema you pick. No code fences, no "here is the output:" preamble, no manual parsing.
You feed it an image tensor, a base_url and model_name for your LM Studio server, a prompt, temperature (default 0.2), and schema_preset. The preset is the heart of it - three choices, each a different JSON schema:
- video_description (default) - the full structured description, matching the pack's five-paragraph style
- simple_description - a lighter caption with fewer fields
- character_analysis - aimed at breaking down a character, which pairs with character-consistency workflows
On the way out it returns json_output (the complete valid JSON as a string) plus field_1 through field_5 - the individual fields pulled out as separate STRING outputs. That's the part people underrate: you don't have to parse the JSON to get at one field. If you only care about the subject, wire field_1 straight into your prompt builder and ignore the blob.
Mechanically this is where LM Studio's structured output support does the real work - the node sends response_format as a JSON schema and the server enforces it, which is a different and much more reliable path than hoping the model behaves. The default model here, qwen3-vl-8b-thinking-mlx, is notably smaller than the 30B used by the free-form Picture Describe - a deliberate choice, because structured output doesn't need the biggest model and 8B is fast enough to iterate on.
Installing
Ships with Swiss Army Knife:
- ComfyUI Manager: search "Swiss Army Knife", install, restart.
- Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/sammykumar/ComfyUI-SwissArmyKnife.git
cd ComfyUI-SwissArmyKnife
pip install -e .
Gotchas
- LM Studio must support JSON-schema structured output for the model you loaded. Newer LM Studio versions do; if you get schema errors, update LM Studio or the model.
schema_presetdefines which fields come out, andfield_1..5are sliced according to that preset. Change the preset and the field meaning changes - the node doesn't re-label them for you.- Structured output guarantees shape, not quality. Valid JSON can still be mediocre content. If the captions are wrong, that's a prompt or model problem, not a schema one.
If you're building any automated pipeline off local captions - feeding a prompt builder, logging structured descriptions, driving character consistency - this is the node that keeps the data clean. Free-form captions are friendlier to read; structured output is friendlier to build on. Pick accordingly.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | http://192.168.50.41:1234 | LM Studio server URL (e.g. http://192.168.50.41:1234) |
| model_name | STRING | qwen3-vl-8b-thinking-mlx | Model name in LM Studio (e.g. qwen3-vl-8b-thinking-mlx) |
| image | IMAGE | Input image to analyze | |
| schema_preset | COMBO | video_description | JSON schema preset to use for structured output |
| prompt | STRING | Analyze this image and provide a detailed description following the schema. | Prompt for image analysis |
| temperature | FLOAT | 0.20–2 | Temperature for text generation |
| verbose | BOOLEAN | false | Show detailed processing information in console |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| json_output | STRING | — |
| field_1 | STRING | — |
| field_2 | STRING | — |
| field_3 | STRING | — |
| field_4 | STRING | — |
| field_5 | STRING | — |