Nodes/ComfyUI_CaptionThis/Florence2 Describe Image ๐Ÿ‘
ComfyUI Node

Florence2 Describe Image ๐Ÿ‘

Caption or tag an image with Florence-2

By MieMieeeeeยทCreated about a year agoยทUpdated 10 months agoยท 127
Florence2 Describe Image ๐Ÿ‘
  • model
  • image
  • text
โ—„taskmore_detailed_captionโ–บ
โ—„seed42โ–บ
โ—„max_new_tokens1024โ–บ
โ—„num_beams3โ–บ
โ—„do_sampletrueโ–บ
โ—„keep_model_loadedtrueโ–บ

Feed this node a loaded Florence-2 model and an image, and it writes a caption. It's the fast, low-fuss captioner in the pack - Florence-2 is tiny, so this runs quick even on modest hardware. The thing that makes it different from the Janus node is that Florence-2 doesn't take a free-form question; instead you pick a task from a dropdown, and the task decides what shape of text you get back.

The task dropdown is the whole game

This is the input you'll actually think about. Seven options:

  • caption - a short one-liner. "A woman standing in a field."
  • detailed_caption - a couple of sentences with more context.
  • more_detailed_caption (the default) - a full descriptive paragraph. This is the natural-language style that LLM-encoder base models (Flux, Qwen-Image, Z-Image) want for training.
  • tags - comma-separated tags instead of prose.
  • mixed / extra_mixed - a blend of description and tags.
  • analyze - a more analytical read of the image.

For LoRA dataset prep on a modern base, more_detailed_caption is the sensible default; if you're working an anime base that wants Danbooru-style tags, tags gets you closer, though a dedicated WD14 tagger is still the community's first choice there. Florence-2's real sweet spot, per trainers, is combining its description with a WD14 tagger - sentence from one, tags from the other.

The other inputs

  • model - from Florence2 Model Loader. Required.
  • image - the picture to caption.
  • num_beams (3) - beam search width. Higher can give slightly better phrasing at the cost of speed; 3 is a fine default.
  • do_sample (on) - adds a little randomness so captions aren't perfectly deterministic.
  • max_new_tokens (1024) - the length cap. Rarely needs touching; lower it only if you want captions kept short.

seed fixes reproducibility. There's no keep_model_loaded concern to overthink - it defaults on, keeping Florence-2 resident so back-to-back images stay fast.

The single output is text (a STRING).

You need a node to see the text

Same trap as everywhere in this pack: ComfyUI has no built-in node that displays text, so a bare run leaves the caption invisible. Wire text into a ShowText / DisplayText node. The author recommends their own dependency-free MieNodes, but any show-text node does the job.

How to install it

Ships in ComfyUI-CaptionThis:

  • ComfyUI Manager (recommended): search CaptionThis, Install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/MieMieeeee/ComfyUI-CaptionThis, then restart.

Florence-2 weights download from HuggingFace on first run (or set HF_ENDPOINT=https://hf-mirror.com for the mirror). Model and precision details live on the Florence2 Model Loader page.

Common issues & troubleshooting

The caption invents things that aren't in the image. Florence-2 can hallucinate detail on the longer tasks - more_detailed_caption especially will confidently describe things it's guessing at. For a training set, skim and correct; don't trust it blindly. If it's badly overreaching, drop to detailed_caption or caption for something more grounded.

Wrong kind of output - you wanted tags, got a paragraph (or vice versa). That's the task dropdown. Switch it to tags for comma tags, more_detailed_caption for prose.

It errored before it ever ran. That's almost always the loader, not this node - most often flash_attention_2 selected without the flash-attn build, or a precision mismatch. Fix it on the Florence2 Model Loader: set attention to sdpa, and try fp32 if you're getting NaN output.

Category๐Ÿ‘ Florence2Caption

Inputs (8)

NameTypeDefaultDescription
modelMIE_FLORENCE2_MODELโ€”
imageIMAGEโ€”
taskCOMBOmore_detailed_caption7 options: caption, detailed_caption, more_detailed_caption, tags, mixed, extra_mixed, +1
seedINT421โ€“18446744073709550000โ€”
max_new_tokensINT10241โ€“4096โ€”
num_beamsINT31โ€“64โ€”
do_sampleBOOLEANtrueโ€”
keep_model_loadedBOOLEANtrueโ€”

Outputs (1)

NameTypeDescription
textSTRINGโ€”