Nodes/ComfyUI-SwissArmyKnife/LLM Studio Structured Describe (Image)
ComfyUI Node

LLM Studio Structured Describe (Image)

Guaranteed-valid JSON captions without the parsing headache

By sammykumar·Created 12 months ago·Updated 8 months ago· 6
LLM Studio Structured Describe (Image)
  • image
  • json_output
  • field_1
  • field_2
  • field_3
  • field_4
  • field_5
base_urlhttp://192.168.50.41:1234
model_nameqwen3-vl-8b-thinking-mlx
schema_presetvideo_description
promptAnalyze this image and provide a detailed description following the schema.
temperature0.2
verbosefalse

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_preset defines which fields come out, and field_1..5 are 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.

CategorySwiss Army Knife 🔪/Media Caption

Inputs (7)

NameTypeDefaultDescription
base_urlSTRINGhttp://192.168.50.41:1234LM Studio server URL (e.g. http://192.168.50.41:1234)
model_nameSTRINGqwen3-vl-8b-thinking-mlxModel name in LM Studio (e.g. qwen3-vl-8b-thinking-mlx)
imageIMAGEInput image to analyze
schema_presetCOMBOvideo_descriptionJSON schema preset to use for structured output
promptSTRINGAnalyze this image and provide a detailed description following the schema.Prompt for image analysis
temperatureFLOAT0.20–2Temperature for text generation
verboseBOOLEANfalseShow detailed processing information in console

Outputs (6)

NameTypeDescription
json_outputSTRING
field_1STRING
field_2STRING
field_3STRING
field_4STRING
field_5STRING