LM Studio Vision Prompt Enhancer
Turn a start image into a Wan motion prompt with a local LLM
- image
- enhanced_prompt
This is the odd one out in jan-prompt-presets - the only node in the pack that isn't a 30-second convenience. It's the LM Studio Vision Prompt Enhancer, and it does something genuinely useful: you give it a start image and it hands that image to a vision-capable LLM running locally in LM Studio, then returns a Wan-optimised motion prompt you can feed straight into the text encoder.
The problem it solves is real. If you've done Wan image-to-video, you know the hardest part isn't the pipeline - it's writing the motion prompt. Wan doesn't want tag lists; it wants descriptive prose about how things move, and it responds poorly to tag-style prompts. Writing "her hair shifts gently to the left as a soft breeze passes through" on command is a skill. This node is the shortcut.
How it works
The mechanism is straightforward OpenAI-compatible API calling, done locally. The node takes the first image from the input batch, converts it to a base64 JPEG, and POSTs an OpenAI-style chat/completions request to your LM Studio server - http://127.0.0.1:1234/v1/chat/completions by default. Your optional scene_description goes in as the user message alongside the image; the response's text comes out as enhanced_prompt. No cloud, no API key, nothing leaves your machine.
The interesting part is the default system prompt. It's effectively a writer's brief for Wan: output only the prompt, describe motion in physical directional terms, stay visual (no sounds, no smells), don't invent scene elements, present tense, aim for 80–120 words. And you can edit it right in the node - that's the system_prompt input - so if you want shorter, more technical, or a different vibe, you don't touch code.
The inputs that matter
image- your start frame (first frame of the batch; it only looks at[0]).model_name- a partial name of the model already loaded in LM Studio, default"qwen". It doesn't load models; it identifies one that's already in memory.url- the LM Studio endpoint.max_tokens- default 300, range 50–4096.temperature- default 0.5, range 0–2. Lower is more focused.scene_description(optional) - a hint like "A girl dances on a tropical beach." Empty means the LLM works from the image alone.system_prompt(optional) - editable.
Output: enhanced_prompt, a plain STRING → wire it into CLIP Text Encode.
Setup - the part people trip on
This needs three things to be true:
- LM Studio running with Developer Mode on (that starts the local server on port 1234).
- A vision-capable model loaded - the README points at something like Qwen3 9B with its
mmprojfile. A text-only model won't work. - The model you loaded matching the
model_nameyou type.
The README also suggests pairing this with the ComfyUI-EBU-LMStudio pack (burnsbert) to manage the LLM's load/unload lifecycle around the node. That's a separate install, not required for this node to run.
Installing it
Part of jan-prompt-presets (https://github.com/kursopiko/jan-prompt-presets). ComfyUI Manager: search jan-prompt-presets, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/kursopiko/jan-prompt-presets
Restart ComfyUI. No pip requirements even here - the node uses Python's standard library for the HTTP call. All nodes land under prompt/presets.
Troubleshooting
- "Could not connect to LM Studio" error. LM Studio isn't running, Developer Mode is off, or the port changed. The node raises a clear
RuntimeErrorfor exactly this case - read the error text, it tells you. - Request fails or returns garbage. Wrong
model_name(it's a partial match against loaded models) or the loaded model isn't vision-capable. - It ignores your multi-frame input. By design it only processes the first image in the batch - feed it a single frame.
- Slow first run. The first vision request can take a while as the model warms up; the node allows up to a 120-second timeout.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The start image to describe and expand into a Wan prompt. | |
| model_name | STRING | qwen | Partial model name to identify the loaded LM Studio model. Must already be loaded in LM Studio. |
| url | STRING | http://127.0.0.1:1234/v1/chat/completions | LM Studio API endpoint. |
| max_tokens | INT | 30050–4096 | Maximum length of the generated prompt. |
| temperature | FLOAT | 0.500–2 | Sampling temperature. Lower = more focused, higher = more varied. |
| scene_descriptionopt | STRING | A short hint about what should happen in the video. If empty, the LLM works from the image alone. | |
| system_promptopt | STRING | You are a prompt writer for Wan, a video generation AI model. Your job is to look at the provided image and expand it into a detailed generation prompt, optionally guided by a short scene description if one is provided. Wan responds well to descriptive prose that focuses on motion, atmosphere, and physical detail. It does not respond well to tag-style prompts. Rules: - Output only the expanded prompt. No preamble, no commentary, no explanations. - Describe motion in physical, directional terms. For example: "her hair shifts gently to the left as a soft breeze passes through", not "hair blowing in the wind". - Describe lighting, atmosphere, and environment with sensory detail. - Stay visual. Do not describe sounds, smells, or other non-visual sensations. - Do not invent major new scene elements that are not implied by the image or the description. Expand what is there, don't replace it. - Do not include animals or creatures unless they are clearly visible in the image or explicitly mentioned in the description. - Keep all subjects consistent with what is visible in the image. - Write in present tense. - The scene should feel ongoing, not like it is building toward or concluding anything. - Aim for 80-120 words. | System prompt sent to the LLM. Edit to tune the output style. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| enhanced_prompt | STRING | — |