DownloadAndLoadFlorence2Model
Load Microsoft's Florence-2 in ComfyUI
- lora
- florence2_model
This is the node that fetches Microsoft's Florence-2 and hands it to the rest of the pack. It doesn't caption anything or detect anything by itself - it's the loader. You drop it in once, point it at a model, and its output feeds whatever run node actually does the work. If you're here because a workflow you downloaded errored on a missing DownloadAndLoadFlorence2Model, this is the piece you're missing.
What Florence-2 is, and why you'd bother
Florence-2 is a small vision-language model from Microsoft. Small is the point: the base model is around 0.23B parameters, the large one about 0.77B, so it runs comfortably next to a full image workflow without eating your VRAM. Despite the size it's a genuine Swiss-army knife - one prompt-based model that does captioning, object detection with bounding boxes, region segmentation, OCR, and (in this fork) document question-answering. You give it an image and a task, it gives you text or coordinates back.
Two jobs are where it actually earns its keep. The first is captioning training datasets. Our LoRA-training notes put it plainly: for the newer LLM-encoder bases (Flux, Z-Image, Qwen-Image) you want natural-language captions, and Florence-2 is one of the two auto-captioners people reach for - it pairs especially well with a WD14 tagger layered on top. (The community favorite is JoyCaption; BLIP has been "pure trash" for years. Florence-2 sits comfortably in the respectable middle.) The second job is feeding a segmentation pipeline: point Florence-2 at "person" or "car," take the bounding boxes it draws, and pass them to SAM2 to get clean masks for inpainting or compositing. That combo shows up constantly.
The pack is by kijai, which is most of the reason to trust it. He's the ComfyUI community's de-facto wrapper author - the standard IC-Light nodes, the Wan video wrapper, and a long list of others are all his. When a new model drops, his wrapper is usually how everyone ends up running it.
The inputs that matter
Only two are required, and there's really one decision:
- model - a dropdown of 14 options.
microsoft/Florence-2-baseis the default and fine for a quick try;Florence-2-large(or-large-ft) is noticeably better and what most people settle on for real captioning. The list also includes community finetunes worth knowing: theMiaoshouAIPromptGen models are tuned specifically for generating SD/Flux-style prompts, andHuggingFaceM4/Florence-2-DocVQAis the one for asking questions about documents. - precision -
fp16,bf16, orfp32. Leave it onfp16unless you hit numerical weirdness; it's the smallest and quickest and the quality difference is nil for this kind of model.
The two optional inputs are lora (accepts a PEFT LoRA to patch the loaded model, niche) and convert_to_safetensors (a boolean that re-saves the downloaded weights in safetensors format - leave it off unless you specifically want that). The single output is florence2_model (type FL2MODEL), which wires straight into the pack's run node - the one that takes your image plus a task and produces the caption, boxes, or mask.
Installing it
Two ways. In ComfyUI Manager, search ComfyUI-Florence2, install, restart. Or from a terminal: cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-Florence2, then pip install -r requirements.txt inside that folder (portable users run it through python_embeded\python.exe -m pip install ...), and restart.
You don't hand-download the model - that's the whole point of this node. The first time you run it, it pulls the weights from HuggingFace into ComfyUI/models/LLM automatically. Expect a wait and a few GB on that first run; after that it loads from disk.
Where people get burned
The number-one failure isn't this node - it's transformers. Florence-2 loads custom model code, and if your transformers version is out of step, you get a loud error like "has model type florence2 but Transformers does not recognize this architecture... your version of Transformers is out of date." The README pins the floor at 4.38.0, but the more common real-world fix runs the other way: a too-new transformers breaks it, and people report dropping back to around 4.49 to get it loading again. If the loader fails on import, that version is the first thing to check. (A separate, newer symptom - Florence-2 stuck repeating its beam-search loop every run - traces to the same version friction, so treat both the same way.)
Beyond that: the first-run download can look like a hang when it's just fetching weights (watch the console), and if it downloads but errors on load, delete the half-pulled folder in models/LLM and let it re-fetch. Nothing here is exotic - get transformers on a version Florence-2 likes and the node just works.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | microsoft/Florence-2-base | 14 options: microsoft/Florence-2-base, microsoft/Florence-2-base-ft, microsoft/Florence-2-large, microsoft/Florence-2-large-ft, HuggingFaceM4/Florence-2-DocVQA, thwri/CogFlorence-2.1-Large, +8 |
| precision | COMBO | fp16 | 3 options: fp16, bf16, fp32 |
| loraopt | PEFTLORA | — | |
| convert_to_safetensorsopt | BOOLEAN | false | Some of the older model weights are not saved in .safetensors format, which seem to cause longer loading times, this option converts the .bin weights to .safetensors |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| florence2_model | FL2MODEL | — |