Nodes/ComfyUI_FluxPromptGen/Flux Image Caption
ComfyUI Node

Flux Image Caption

Florence-2 image captioning riding along in the prompt-generator pack

By dfghsdh·Created 2 years ago·Updated 2 years ago· 18
Flux Image Caption
  • image
  • STRING
max_length50

This one's simple compared to its sibling node: feed it an image, get back a text caption. FluxImageCaptionNode wraps Microsoft's Florence-2 vision-language model to describe whatever picture you hand it - useful for reverse-engineering a rough prompt from a reference image, or for the less glamorous but far more common job of auto-captioning a folder of training images before you kick off a LoRA.

On that second use case, Florence-2 is a genuinely solid pick, not a token gesture. Community consensus has more or less retired BLIP for this - "pure trash" is the blunt version people give it - and the two models that actually replaced it for natural-language Flux captions are JoyCaption and Florence-2. JoyCaption tends to get named as the default these days, and Florence-2 shows up more often paired with a WD14 tagger than run alone. Either way: getting Florence-2 captioning as a node in the same pack you're already using for prompt generation is a real convenience, one less custom-node install to go chase down.

How it works

Florence-2 is small by vision-language-model standards - Microsoft built it to be fast and cheap to run rather than maximally capable, which is exactly why it fits a bulk-captioning job instead of something heavier. The node hands your image to Florence-2's captioning pass and returns whatever natural-language description comes back. There's no instruction or question field here - this is a fixed captioning task, not open-ended visual Q&A, so don't go looking for a prompt input that isn't there.

The inputs and outputs that matter

Only two inputs, which is the whole appeal of this node. image takes anything that outputs IMAGE - Load Image, VAE Decode, wherever your picture is coming from. max_length (default 50, range 10-200) controls how long and detailed the caption gets: push it up if Florence-2's default feels clipped, pull it down if you just want a terse one-liner. The output is a single STRING - worth flagging that the node labels the socket literally "STRING" rather than something friendlier like "caption," so don't be thrown when you're wiring it up. Send it wherever text goes: a CLIP Text Encode, a Save Text node, or concatenated with other prompt fragments upstream.

Installing it

Same pack as FluxPromptGeneratorNode, so if you've already installed one, you have the other. Via ComfyUI Manager: search "ComfyUI_FluxPromptGen." It's a small pack and may not show up in Manager's registry, in which case clone it directly:

cd ComfyUI/custom_nodes
git clone https://github.com/dfghsdh/ComfyUI_FluxPromptGen
pip install -r ComfyUI_FluxPromptGen/requirements.txt

Restart ComfyUI. Unlike its sibling node, this one doesn't need Ollama running anywhere - Florence-2 is entirely local through the pack's own Python dependencies. Do expect a model download on first use: Florence-2's weights pull from Hugging Face the first time you actually run the node, so your first caption will take noticeably longer than every one after it while that finishes.

Common issues & troubleshooting

First run is slow, then it's fine after that. That's the one-time model download, not a hang. Check your terminal for download progress before assuming the node is stuck.

Import or missing-dependency errors on startup. Florence-2 integrations typically need transformers, timm, and einops behind the scenes. If the node fails to load, re-run pip install -r requirements.txt inside the pack's folder, and double check it's installing into the same Python environment ComfyUI itself runs on - a very common source of "it's installed but ComfyUI can't see it," especially on portable or embedded ComfyUI builds.

Captions read generic or too short. That's max_length at the low end of its range doing exactly what it's set to do, not a bug - bump it up.

Don't lean on this for the dataset where every caption matters. Auto-captioning, Florence-2 included, is for the folder of hundreds of images you don't have time to caption by hand - not the 15-image set where getting each caption right actually decides how the LoRA turns out. For small, high-stakes sets, hand-captioning (or at least spot-checking what comes out here) is still the standard advice.

Categoryflux

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
max_lengthINT5010–200

Outputs (1)

NameTypeDescription
STRINGSTRING