alt.freeweights.text / Florence-2-large
From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.textSubject:

Florence-2-large

Date: 2026-11-15Commit: 21a599dSigned: 2DC28CC7B26A283B ✓

Image text to text model with 777M parameters. Safetensors weights, 3.12 GB in all. Published by microsoft under MIT.

777M params3.12GBFlorence-2-largesafetensorspermissive
FactsParams777MSize3.12 GBFormatssafetensorsTaskimage text to textLicenseMITFrom sourcepermissive
$ fw get microsoft/Florence-2-large
# manifest sha256 d48fb44d85a3… · 3.12 GB · 18 files
$ fw verify ./Florence-2-large microsoft/Florence-2-large
From sourceHosted (signed)microsoft/Florence-2-largeLast check: 2026-11-15 02:27 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Runs withAIBrixBentoMLCTranslate2ExLlamaV2ExLlamaV3exofastllmFlashInferKTransformersLitServeLMCacheLMDeployLocalAImistral.rsMLC LLMMooncakeSGLangText Generation WebUItinygradTransformersTriton Inference ServervLLMXinferenceFine-tune withAccelerateAlignment HandbookAxolotlColossal-AIDeepSpeedEasyR1FlashAttentionH2O LLM StudioJAXKerasLiger KernelLitGPTLLaMA-FactoryMegatron-LMms-swiftnanotronOLMo-coreOpenRLHFOumiPEFTPyTorch Lightningsd-scriptsSimpleTunerTorchTitantorchtuneTransformer EngineTRLUnslothverlConvert withAQLMAutoRoundCore ML ToolsExecuTorchGPTQModelLLM CompressormergekitNeural CompressorOliveONNXOptimum QuantoOptimumsafetensorsTensorRT Model OptimizertorchaoEvaluate withAutoevalsDeepEvalEvaluateHELMLightEvallm-evaluation-harnessOpenCompassOpikRagassimple-evalsSWE-benchTruLensWeaveScan withAgentDojoAI Fairness 360DeepTeamDetoxifyFairlearngarakGiskardGuardrailsMCP ScannerModelScanNeMo GuardrailspicklescanpromptfooWorks withAgent Development KitAG2Google AI Edge GalleryAiderany-llmAnythingLLMBAMLbrowser-useCAMELHugging Face Chat UIChatboxCherry StudioClineCodex CLICogneeCrewAIDeerFlowdocTRDSPyEasyOCREnchantedGemini CLIGitHub MCP ServergooseGPT ResearcherGradioGraphitiGuidanceHollamaInstructorKilo CodeLangflowLangGraphLiteLLMLlamaIndexLLMLocalAGILoLLMs WebUIMCP Python SDKMem0MetaGPTNextChatOllama JavaScriptOllama PythonolmOCROpenAI Agents SDKopencodeOpenHandsotermOutlinesPage AssistPlaywright MCPPortkey AI GatewayPrivateGPTQwen CodeRWKV RunnerSemantic KernelsmolagentsStrands AgentsSuryaVaneXGrammar

Overview

Size
3.12 GB
Weights
1.55 GB (safetensors)
Parameters
777M
Formats
safetensors
Task
image text to text
License
MIT (permissive)
Files
18, each with a sha256
Publisher
microsoft
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:27 UTCpassed

Model card

From the publisher at commit 21a599d. Shown as plain text with links; images open at the publisher.

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

This Hub repository contains a HuggingFace's transformers implementation of Florence-2 model from Microsoft.

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]](https://huggingface.co/microsoft/Florence-2-base)0.23BPretrained model with FLD-5B
Florence-2-large[[HF]](https://huggingface.co/microsoft/Florence-2-large)0.77BPretrained model with FLD-5B
Florence-2-base-ft[[HF]](https://huggingface.co/microsoft/Florence-2-base-ft)0.23BFinetuned model on a colletion of downstream tasks
Florence-2-large-ft[[HF]](https://huggingface.co/microsoft/Florence-2-large-ft)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. All models are trained with float16.

import requests

import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForCausalLM 


device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32

model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-large", torch_dtype=torch_dtype, trust_remote_code=True).to(device)
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-large", trust_remote_code=True)

prompt = "<OD>"

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)

inputs = processor(text=prompt, images=image, return_tensors="pt").to(device, torch_dtype)

generated_ids = model.generate(
    input_ids=inputs["input_ids"],
    pixel_values=inputs["pixel_values"],
    max_new_tokens=4096,
    num_beams=3,
    do_sample=False
)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]

parsed_answer = processor.post_process_generation(generated_text, task="<OD>", image_size=(image.width, image.height))

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.

Click to expand

import requests

import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForCausalLM 

device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32

model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-large", torch_dtype=torch_dtype, trust_remote_code=True).to(device)
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-large", trust_remote_code=True)

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)

def run_example(task_prompt, text_input=None):
    if text_input is None:
        prompt = task_prompt
    else:
        prompt = task_prompt + text_input
    inputs = processor(text=prompt, images=image, return_tensors="pt").to(device, torch_dtype)
    generated_ids = model.generate(
      input_ids=inputs["input_ids"],
      pixel_values=inputs["pixel_values"],
      max_new_tokens=1024,
      num_beams=3
    )
    generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]

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

    print(parsed_answer)

Here are the tasks Florence-2 could perform:

Click to expand

Caption#
prompt = "<CAPTION>"
run_example(prompt)
Detailed Caption#
prompt = "<DETAILED_CAPTION>"
run_example(prompt)
More Detailed Caption#
prompt = "<MORE_DETAILED_CAPTION>"
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: {'\<CAPTION_TO_PHRASE_GROUNDING>': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['', '', ...]}}

task_prompt = "<CAPTION_TO_PHRASE_GROUNDING>"
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 = "<OD>"
run_example(prompt)
Dense Region Caption#

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

prompt = "<DENSE_REGION_CAPTION>"
run_example(prompt)
Region proposal#

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

prompt = "<REGION_PROPOSAL>"
run_example(prompt)
OCR#
prompt = "<OCR>"
run_example(prompt)
OCR with Region#

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

prompt = "<OCR_WITH_REGION>"
run_example(prompt)
Output confidence score with Object Detection#

def run_example_with_score(task_prompt, text_input=None):
    if text_input is None:
        prompt = task_prompt
    else:
        prompt = task_prompt + text_input
    inputs = processor(text=prompt, images=image, return_tensors="pt").to(device, torch_dtype)
    generated_ids = model.generate(
      input_ids=inputs["input_ids"],
      pixel_values=inputs["pixel_values"],
      max_new_tokens=1024,
      num_beams=3,
      return_dict_in_generate=True,
      output_scores=True,
    )
    generated_text = processor.batch_decode(generated_ids.sequences, skip_special_tokens=False)[0]

    prediction, scores, beam_indices = generated_ids.sequences, generated_ids.scores, generated_ids.beam_indices
    transition_beam_scores = model.compute_transition_scores(
        sequences=prediction,
        scores=scores,
        beam_indices=beam_indices,
    )

    parsed_answer = processor.post_process_generation(sequence=generated_ids.sequences[0], 
        transition_beam_score=transition_beam_scores[0],
        task=task_prompt, image_size=(image.width, image.height)
    )

    print(parsed_answer)

prompt = "<OD>"
run_example_with_score(prompt)

for More detailed examples, please refer to notebook

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.751.556.447.966.365.134.6
Florence-2-large84.456.361.651.453.657.949.968.067.035.8

Florence-2 finetuned performance#

We finetune Florence-2 models with a collection of downstream tasks, resulting two generalist models Florence-2-base-ft and Florence-2-large-ft that can conduct a wide range of downstream tasks.

The table below compares the performance of specialist and generalist models on various captioning and Visual Question Answering (VQA) tasks. Specialist models are fine-tuned specifically for each task, whereas generalist models are fine-tuned in a task-agnostic manner across all tasks. The symbol "▲" indicates the usage of external OCR as input.

Method# ParamsCOCO Caption Karpathy test CIDErNoCaps val CIDErTextCaps val CIDErVQAv2 test-dev AccTextVQA test-dev AccVizWiz VQA test-dev Acc
Specialist Models
CoCa2.1B143.6122.4-82.3--
BLIP-27.8B144.5121.6-82.2--
GIT25.1B145.0126.9148.681.767.371.0
Flamingo80B138.1--82.054.165.7
PaLI17B149.1127.0160.0▲84.358.8 / 73.1▲71.6 / 74.4▲
PaLI-X55B149.2126.3147.0 / 163.7▲86.071.4 / 80.8▲70.9 / 74.6▲
Generalist Models
Unified-IO2.9B-100.0-77.9-57.4
Florence-2-base-ft0.23B140.0116.7143.979.763.663.6
Florence-2-large-ft0.77B143.3124.9151.181.773.572.6
Method# ParamsCOCO Det. val2017 mAPFlickr30k 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
Specialist Models
SeqTR---83.786.581.271.576.364.974.974.2-
PolyFormer---90.492.987.285.089.878.085.885.976.9
UNINEXT0.74B60.6-92.694.391.585.289.679.888.789.4-
Ferret13B--89.592.484.482.888.175.285.886.3-
Generalist Models
UniTAB---88.691.183.881.085.471.684.684.7-
Florence-2-base-ft0.23B41.484.092.694.891.586.891.782.289.882.278.0
Florence-2-large-ft0.77B43.485.293.495.392.088.392.983.691.291.780.5

BibTex and citation info#

@article{xiao2023florence,
  title={Florence-2: Advancing a unified representation for a variety of vision tasks},
  author={Xiao, Bin and Wu, Haiping and Xu, Weijian and Dai, Xiyang and Hu, Houdong and Lu, Yumao and Zeng, Michael and Liu, Ce and Yuan, Lu},
  journal={arXiv preprint arXiv:2311.06242},
  year={2023}
}

Files

18 files · 3.12 GBWeights 1.55 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 18 files with their sha256
FileSizesha256
.gitattributes1.56 KB28aac17b0f70983ef58c18a7ee355503e454ce3178fce77a7b50503906df0635
CODE_OF_CONDUCT.md444 B9daeae709a0bd71bcfd1c96dc5822ecec5210327eff929da64b0ae7f8faf1444
LICENSE1.14 KBc2cfccb812fe482101a8f04597dfc5a9991a6b2748266c47ac91b6a5aae15383
README.md16.3 KB16212f1929e4992649d18b812e0ebf7ebbbaffd90a5ba23dfdc5c78df2f92ac2
SECURITY.md2.66 KB7b6976eec43edfa68b79a459dd089c56b7a395916dbf1a01bd11e6d86e12128f
SUPPORT.md1.24 KB149773411caf2c59cb1a6bfb2c6f070d1d054f1f018e7a80be319a8c384eeaf5
config.json2.44 KB6f8a8f92a74ce18b5c1e5646b4a8222477dd1ac49f31b953e75d6fc3e0f8583a
configuration_florence2.py15.1 KBde2e45a975b3582de05d2f4d963a3e9f9a3d20dccf78d28e0052932a0be93bdf
generation_config.json51 B30e9865458ecc8ee931eeeb43f44f1d169c5ab95be39e0072142a7a6b8f31990
model.safetensors1.55 GB4f38ce741c6b71188fe2b3419a55e11917a8a7b321ae2e63c61da0191b0ebad7
modeling_florence2.py127 KB5162bf465e61b6e29cc113a467630ec3cb56ed8e4d46eb6207157f10fb9b8a24
preprocessor_config.json806 B2f5921bbc53c7cc04251e1027b45b1cec726276be6db23d1bb40641bfbe2cf29
processing_florence2.py48.7 KBc655782a9e4347965c735ea54cbc4e98fdbc02155ffd1ce2ecd61f42c45eda28
pytorch_model.bin1.56 GB8b7d99c2ca930af3bcc4625df55c82b6bb372456280310b5189c519d6083a270
sample_inference.ipynb5.71 MB1dabc0f882f7f14752dec6c74404e516d99faf4db3e8bb93cd44a453d0981365
tokenizer.json1.36 MB847bbeab6174d66a88898f729d52fa8d355fafe1bea101cf960dd404581df70e
tokenizer_config.json34 B79ffcf43af8ebda99d165f61d243180da2e2639952e41e71e11611c18770489c
vocab.json1.10 MB394fdc63c71aabe0a9b97117f5d62fb5fcc4d59b2b3ea929a3929e6a53217b3c
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
21a599d414 pinned now2026-11-15 02:27 UTC18 files · 3.12 GB

Use it

$ fw get microsoft/Florence-2-large
# manifest sha256 d48fb44d85a3… · 3.12 GB · 18 files
$ fw verify ./Florence-2-large microsoft/Florence-2-large
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/microsoft/Florence-2-large.json --dir ./Florence-2-large $ python3 fw.py verify ./Florence-2-large ./microsoft__Florence-2-large.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Florence-2-large --revision 21a599d414c4d928c9032694c424fb94458e3594 --local-dir ./Florence-2-large
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForImageTextToText, AutoProcessor processor = AutoProcessor.from_pretrained("microsoft/Florence-2-large", revision="21a599d414c4d928c9032694c424fb94458e3594") model = AutoModelForImageTextToText.from_pretrained("microsoft/Florence-2-large", revision="21a599d414c4d928c9032694c424fb94458e3594", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve microsoft/Florence-2-large --revision 21a599d414c4d928c9032694c424fb94458e3594

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
LICENSE
Text sha256
c2cfccb812fe482101a8f04597dfc5a9991a6b2748266c47ac91b6a5aae15383
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.textSubject: Florence-2-largeDate: 2026-11-15Commit: 21a599dSigned: 2DC28CC7B26A283B ✓
Upstream
microsoft/Florence-2-large
Pinned commit
21a599d414c4d928c9032694c424fb94458e3594
Manifest
Florence-2-large.json · .minisig
Manifest sha256
d48fb44d85a3b3980bc120fcf8bbf9bffef5d31e137f51bbcc95a6b25e8333a3
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:27 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/microsoft/Florence-2-large.json $ curl -O https://freeweights.allternit.com/manifests/microsoft/Florence-2-large.json.minisig $ minisign -Vm Florence-2-large.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Quantizations 1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Florence-2-large
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. Florence-2-large.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of Florence-2-large. Each has its own license check and page.

From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B