ComfyUI Node

Florence-2 Node

The pack's dedicated, actually-current captioner

By mediocreatmybest·Created 2 years ago·Updated 12 months ago· 3
Florence-2 Node
  • image_paths
  • generated_captions
model_namemicrosoft/Florence-2-large-ft
task_prompt<CAPTION>
max_new_tokens1024

Model Loader plus Caption Generator gives you this pack's generic captioning path, and by default that path runs BLIP - a model the LoRA-training community has been calling deprecated and inaccurate for years. Florence-2 Node is the alternative: one self-contained node, no separate loader step, defaulting to microsoft/Florence-2-large-ft instead. Of everything in this pack, it's the node to reach for if caption quality is actually what you care about.

That's not a stray opinion - it's the current, specific community recommendation. Florence-2 is one of exactly two models people point to today for writing natural-language captions for LoRA training (the other is JoyCaption), specifically named as the model that replaced BLIP for this job, and noted as working well paired with a Danbooru-style tagger when a dataset needs both natural language and tags. BLIP, by contrast, gets described flatly as producing formulaic, inaccurate output. If you've been running the default settings on this pack's Model Loader, switching to this node is the single biggest quality upgrade available inside it.

One thing worth knowing if you go looking for more Florence-2 workflows online: the integration most captioning posts and tutorials reference is Kijai's separate ComfyUI-Florence2 pack, not this one. This node is a self-contained alternative bundled into a broader captioning pipeline rather than a wrapper around that other pack - worth knowing so you're not confused when a workflow you found elsewhere doesn't match this node's fields.

How it works

Florence-2 isn't prompted with a natural-language question the way a chat-style vision model is. It's driven by literal task tokens - strings like <CAPTION> that the model was specifically trained to recognize as a mode switch, not free text it interprets. That's why task_prompt here is a fixed dropdown rather than a text box: the three options aren't suggestions, they're the exact strings the model expects, escalating in verbosity from a short one-liner to a full paragraph.

The inputs and outputs that matter

  • model_name (STRING, default microsoft/Florence-2-large-ft) - free text, unlike Caption Model List elsewhere in this pack, so you can drop in a different Florence-2 checkpoint (the base-sized model, for instance) if -large is heavier than you need.
  • image_paths (LIST, required) - straight from Image Loader.
  • task_prompt (enum, default <CAPTION>) - three choices: <CAPTION> (short), <DETAILED_CAPTION> (a full paragraph), <MORE_DETAILED_CAPTION> (the most exhaustive Florence-2 will produce). Start with <CAPTION> for tag-length output, move up if your captions feel thin.
  • max_new_tokens (optional, default 1024, range 322048) - a much higher ceiling than Caption Generator's default of 75 elsewhere in this pack, because <MORE_DETAILED_CAPTION> genuinely produces long output, and a caption cut off mid-sentence is worse than one running a bit long.

Output is generated_captions (LIST) - feed it into Caption Export exactly where Caption Generator's captions output would go.

Installing it

Through ComfyUI Manager: search ComfyUI-Transformers-Pipeline, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/mediocreatmybest/ComfyUI-Transformers-Pipeline

then restart. The Florence-2 checkpoint downloads from Hugging Face on first run - the -large-ft default is a multi-gigabyte pull, budget for that on a cold start. Florence-2's Hugging Face repo ships custom modeling code, which normally needs trust_remote_code enabled to load at all; this node has no such toggle exposed, so it presumably handles that internally rather than leaving it to you.

Common issues & troubleshooting

First run is slow. That's the checkpoint downloading, not a hang - Florence-2-large is a real download, not a small file.

Typo'd model_name and it just fails. Unlike Caption Model List's dropdown elsewhere in this pack, this field is free text with nothing backing it - a mistyped Hugging Face repo id fails outright rather than warning you. Copy the exact repo id from Hugging Face if you're swapping away from the default.

Grounding/region-style Florence-2 capabilities aren't here. This node only exposes the three captioning task tokens - no object-detection or region-grounding tasks, which Florence-2 does support in general but which this specific node doesn't wire up. If you need those, look at a Florence-2 integration built for them (Kijai's pack, mentioned above) rather than expecting this node to do it.

Want the smaller/cheaper generic path instead. That's what Model Loader plus Caption Generator is for. This node trades that flexibility for a much better default - pick based on which tradeoff you actually want.

CategoryTransformers Pipeline

Inputs (4)

NameTypeDefaultDescription
model_nameSTRINGmicrosoft/Florence-2-large-ft
image_pathsLIST
task_promptCOMBO<CAPTION>3 options: <CAPTION>, <DETAILED_CAPTION>, <MORE_DETAILED_CAPTION>
max_new_tokensoptINT102432–2048

Outputs (1)

NameTypeDescription
generated_captionsLIST