Model reference · open weights

Florence-2

LLMs florence-community Vision + text 1 build Open weights 64k dl/mo

Florence-2 is an open-weight language model from florence-community. Florence-2-base (FP16) weighs 463 MB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • Florence-2 is a vision foundation model developed by florence-community that uses a prompt-based approach to handle various vision and vision-language tasks.
  • It supports capabilities such as captioning, object detection, segmentation, and OCR through a sequence-to-sequence architecture.
  • The model has 232M parameters, a context length of 1024 tokens, and is released under the MIT license.

Summary of the florence-community/Florence-2-base model card, 2026-10-01

What it is

Released byflorence-community
Released2025-09-11
Parameters232M
VRAM463 MB for the weights

What it runs on

Memory and cards for Florence-2-base (FP16)

463 MBweights, file size
1.8 GBruntime overhead, at least
1,024 tokenscontext max

How much memory each request adds isn't estimated yet for this architecture. The weights need at least the cards below, plus room for the context.

CardWeights alone
RTX 3060 12 GBfits
RTX 4060 Ti 16 GBfits
RTX 3090 24 GBfits
RTX 4090 24 GBfits
RTX 5090 32 GBfits
L40S 48 GBfits
A100 80 GBfits
H100 80 GBfits
RTX PRO 6000 Blackwell 96 GBfits
DGX Spark (GB10) 128 GB unifiedfits
H200 141 GBfits
B200 180 GBfits

From the model card

What florence-community says about Florence-2

Read the model card

[!NOTE] This is the repository for official transformers converted checkpoint of Microsoft's Florence model.

Florence-2: Advancing a Unified Representation for a Variety of Vision Tasks

Model Summary

This is a continued pretrained version of Florence-2-large model with 4k context length, only 0.1B samples are used for continue pretraining, thus it might not be trained well. In addition, OCR task has been updated with line separator ('\n'). COCO OD AP 39.8

Florence-2 is an advanced vision foundation model that uses a prompt-based approach to handle a wide range of vision and vision-language tasks. Florence-2 can interpret simple text prompts to perform tasks like captioning, object detection, and segmentation. It leverages our FLD-5B dataset, containing 5.4 billion annotations across 126 million images, to master multi-task learning. The model's sequence-to-sequence architecture enables it to excel in both zero-shot and fine-tuned settings, proving to be a competitive vision foundation model.

Resources and Technical Documentation:

ModelModel sizeModel Description
Florence-2-base[HF]0.23BPretrained model with FLD-5B
Florence-2-large[HF]0.77BPretrained model with FLD-5B
Florence-2-base-ft[HF]0.23BFinetuned model on a colletion of downstream tasks
Florence-2-large-ft[HF]0.77BFinetuned model on a colletion of downstream tasks

How to Get Started with the Model

Use the code below to get started with the model.

import torch
import requests
from PIL import Image
from transformers import AutoProcessor, Florence2ForConditionalGeneration

model = Florence2ForConditionalGeneration.from_pretrained(
    "florence-community/Florence-2-base",
    dtype=torch.bfloat16,
    device_map="auto",
)
processor = AutoProcessor.from_pretrained("florence-community/Florence-2-base")

url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")

task_prompt = ""
inputs = processor(text=task_prompt, images=image, return_tensors="pt").to(model.device, torch.bfloat16)

generated_ids = model.generate(
    **inputs,
    max_new_tokens=1024,
    num_beams=3,
)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]

image_size = image.size
parsed_answer = processor.post_process_generation(generated_text, task=task_prompt, image_size=image_size)

print(parsed_answer)

Tasks

This model is capable of performing different tasks through changing the prompts.

First, let's define a function to run a prompt.

Here are the tasks Florence-2 could perform:

Caption

prompt = ""
run_example(prompt)

Detailed Caption

prompt = ""
run_example(prompt)

More Detailed Caption

prompt = ""
run_example(prompt)

Caption to Phrase Grounding

caption to phrase grounding task requires additional text input, i.e. caption.

Caption to phrase grounding results format: {'': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['', '', ...]}}

task_prompt = ""
results = run_example(task_prompt, text_input="A green car parked in front of a yellow building.")

Object Detection

OD results format: {'': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['label1', 'label2', ...]} }

prompt = ""
run_example(prompt)

Dense Region Caption

Dense region caption results format: {'' : {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['label1', 'label2', ...]} }

prompt = ""
run_example(prompt)

Region proposal

Dense region caption results format: {'': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['', '', ...]}}

prompt = ""
run_example(prompt)

OCR

prompt = ""
run_example(prompt)

OCR with Region

OCR with region output format: {'': {'quad_boxes': [[x1, y1, x2, y2, x3, y3, x4, y4], ...], 'labels': ['text1', ...]}}

prompt = ""
run_example(prompt)

Benchmarks

Florence-2 Zero-shot performance

The following table presents the zero-shot performance of generalist vision foundation models on image captioning and object detection evaluation tasks. These models have not been exposed to the training data of the evaluation tasks during their training phase.

Method#paramsCOCO Cap. test CIDErNoCaps val CIDErTextCaps val CIDErCOCO Det. val2017 mAP
Flamingo80B84.3---
Florence-2-base0.23B133.0118.770.134.7
Florence-2-large0.77B135.6120.872.837.5

The following table continues the comparison with performance on other vision-language evaluation tasks.

MethodFlickr30k test R@1Refcoco val AccuracyRefcoco test-A AccuracyRefcoco test-B AccuracyRefcoco+ val AccuracyRefcoco+ test-A AccuracyRefcoco+ test-B AccuracyRefcocog val AccuracyRefcocog test AccuracyRefcoco RES val mIoU
Kosmos-278.752.357.447.345.550.742.260.661.7-
Florence-2-base83.653.958.449.7

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms