FL Ollama Captioner by Cosmic
Caption a dataset locally with Ollama, no cloud key
- images
- STRING
Captioning a training set is tedious, and paying OpenAI or Google per image to do it feels wrong when the whole point of a local LoRA is staying local. FL_OllamaCaptioner is the offline answer: it sends each image to a vision model running on your own Ollama server, gets back a description, and saves the image with its caption. No API key, no per-image bill, nothing leaving your machine.
The trade is that you have to run Ollama yourself and pull a vision-capable model. If you've already got Ollama going for other things, this slots right in. If not, it's a one-time setup you'll be glad you did the moment you're captioning a few hundred images.
How it works
For each image in the batch, the node encodes it as base64 and POSTs it to your Ollama server's API, asking the chosen model to describe it. The returned text becomes the caption, and the node writes the image and its caption into your output folder as a training-ready pair. There's also a switch to skip the LLM entirely and write a fixed default caption instead - useful for a quick pass or when every image shares the same tag.
The inputs and outputs that matter
All required:
images(IMAGE) - the batch to caption.url(STRING, defaulthttp://127.0.0.1:11434) - where your Ollama server is. The default is a local install on the standard port; change it if Ollama runs on another host or port.model(STRING) - the Ollama model tag to use. This must be a vision model you've already pulled (something likellava,llama3.2-vision,qwen2-vl) - a text-only model can't see the image.use_llm(BOOLEAN, default true) - true actually captions; false writes the default caption without calling the model.folder_name(STRING) andoverwrite(BOOLEAN) - where pairs are saved and whether to overwrite existing files.
It's an output node and also emits a STRING you can chain (the caption/status).
When you'd reach for it
LoRA and fine-tune dataset prep where privacy, cost, or offline operation matter. It's the local sibling of the pack's GPT-Vision and Gemini captioners - reach for those when you want top-tier caption quality and don't mind the cloud; reach for this when you'd rather keep it on your own hardware and free.
Installing it
ComfyUI Manager → ComfyUI_Fill-Nodes → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
then restart. Separately, install Ollama from ollama.com and pull a vision model (ollama pull llama3.2-vision), and make sure the server is running before you queue.
One heads-up worth knowing: Fill-Nodes is a big kitchen-sink pack, and people have been startled on first launch by the wall of dependencies it installs (one r/comfyui thread flagged it pulling in a whole Google Cloud subsystem for its Drive nodes). It's not malware - it's just a pack that bundles a lot of unrelated tools. If a captioner is all you want, know that you're installing far more than a captioner.
Common issues & troubleshooting
Connection refused / nothing happens. Ollama isn't running or isn't reachable at url. Start the server, confirm the port, and if ComfyUI and Ollama are on different machines point url at the right host.
Captions are gibberish or empty. You pointed model at a text-only model. It has to be a vision model, and it has to be pulled locally first - Ollama won't caption an image with a model that can't take one.
It wrote default captions instead of real ones. use_llm is false. Flip it on.
Slow. Local vision models aren't instant, especially larger ones on modest GPUs. For big datasets, pick a smaller vision model and let it run.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| folder_name | STRING | output_folder | — |
| use_llm | BOOLEAN | true | — |
| url | STRING | http://127.0.0.1:11434 | — |
| model | STRING | default_model | — |
| overwrite | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |