LoRA Caption Generator (Multi-Lang)
Caption your training set with the vision LLM you already run
- image
- english
- traditional_chinese
- simplified_chinese
This node is a captioning pipeline disguised as a ComfyUI node, and the "pipeline" part is doing a lot of work: it takes a training image, sends it to any OpenAI-compatible local LLM API that has vision (LM Studio, Ollama, whatever), forces the model to reply in JSON, and hands you back three captions at once - English, Traditional Chinese, and Simplified Chinese. No cloud API, no API key, no model downloads from the pack itself. If you're already running a vision model in LM Studio for other stuff, this is a zero-extra-cost way to caption a LoRA dataset.
Why you'd reach for it
Modern training targets changed what a good caption looks like. Flux, Z-Image, Qwen-Image, Krea 2 - the whole LLM-encoder family - want long, structured natural-language descriptions, not comma-separated Danbooru tags. That's exactly the gap this kind of node fills, and it's a real workflow: people build tools around local vision LLMs specifically because you can tell them in natural language what format to output, which the fixed taggers can't do.
The multi-language thing is the actual differentiator. If you only train in English, the established local favorite is JoyCaption, and honestly that's the more battle-tested path. But if you're making captions for a dataset that will be shared or localized, or you just want the same image described three ways in one request, nothing else in the ecosystem does that out of the box.
How it works
Under the hood it's a thin HTTP wrapper, and the source is small enough to read in one sitting. The image tensor gets converted to a base64 JPEG, stuffed into an OpenAI-vision-format messages payload alongside a system prompt pulled from the pack's prompts.json, and POSTed to whatever api_url you set. It requests response_format: {"type": "json_object"} and parses the reply for en, zh_tw, and zh_cn keys. The system prompts are the real product here - eight of them, tuned per target (Flux natural language, SDXL tags, Z-Image Turbo concise, an "art critic" universal style, and so on). That's the part you can edit: it's just a JSON file in the pack folder.
The inputs that matter
image- your training image (or batch, via the folder loader).prompt_style- pick your base model's caption dialect:Flux (Natural Language),SDXL Style (Tag-Based),Z-Image Turbo (Concise & Fast),Detailed Art Critic (Universal), or the bare variants. This is the one input that changes what comes out more than any other.trigger_word- defaults tostyle_name; the prompt instructs the model to weave it into every caption. Use your actual trigger token, ideally a rare one.api_url- defaults tohttp://127.0.0.1:1234/v1/chat/completions, which is LM Studio's stock endpoint. Point it at Ollama (.../v1/chat/completionsworks there too) or any compatible server.model_name- defaults togemma4, which is a trap: it must exactly match a model actually loaded in your server, and it has to be a vision model or the whole thing is blind.api_key-not-neededis the right value for local servers; keep it for a remote OpenAI-compatible endpoint.temperature,max_new_tokens,seed- standard generation knobs. Seed makes runs reproducible.
Outputs
Three STRING outputs: english, traditional_chinese, simplified_chinese. Wire the one your trainer consumes into a Save Text File node and you get a ready .txt per image. Batch the folder and ComfyUI walks it for you. Slightly annoying detail: if you want to keep all three languages you need three Save Text File nodes with different filenames, since each output only carries one caption.
Install
Easy path: ComfyUI Manager → search "LoRA-Captioner" → install, restart. Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/JetterTW/ComfyUI-LoRA-Captioner.git
cd ComfyUI-LoRA-Captioner
pip install -r requirements.txt
Then restart ComfyUI. Dependencies are refreshingly light - requests, numpy, Pillow - nothing you don't already have in a working ComfyUI. The pack itself downloads no models; the model lives in your LM Studio/Ollama install. README suggests 12GB+ VRAM to run a local vision LLM comfortably, and that's the honest cost - the node is cheap, the model isn't.
Common issues
The biggest trap is the default model_name. The README's own examples say gemma4-vision or llava, but the default is gemma4 - you must change it to the exact name of a vision model running in your server, or the API errors out. Second trap: not every server honors response_format: json_object, and the node hard-depends on it. If the model talks in prose instead of JSON, the parse fails - and here's the confusing part, errors don't pop a dialog: they get returned as a string in the english output ("Error: ..."). That's actually handy for debugging, but it means a red string in your caption file isn't a caption. If you see one, the first thing to check is that your model name is right and your endpoint actually serves vision.
It's also a young, small pack - last touched mid-2026, essentially zero community footprint. It works, but don't expect a support ecosystem. For English-only captioning JoyCaption or Florence-2 is the more established pick; this is the one to reach for when you already run a local vision LLM and want multi-language captions from it.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| trigger_word | STRING | style_name | — |
| prompt_style | COMBO | 8 options: Flux (Natural Language), SDXL Style (Tag-Based), Z-Image Turbo (Concise & Fast), Detailed Art Critic (Universal), Flux, SDXL, +2 | |
| api_url | STRING | http://127.0.0.1:1234/v1/chat/completions | — |
| model_name | STRING | gemma4 | — |
| api_key | STRING | not-needed | — |
| max_new_tokens | INT | 20481–8192 | — |
| temperature | FLOAT | 0.70–2 | — |
| seed | INT | 00–18446744073709550000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| english | STRING | — |
| traditional_chinese | STRING | — |
| simplified_chinese | STRING | — |