← All models

image-text-to-text Β· vision foundation Β· WebGPU Β· ~1.6 GB

Florence-2-large β€” same API, sharper answers

This is the large Florence-2 checkpoint: 0.77B parameters against the base model's 0.23B. The interface is identical β€” one network steered by a task token to caption, detect, read text (OCR), describe regions, or segment a phrase β€” but the extra capacity buys noticeably richer captions, more complete detections, and better OCR. Pick an image, pick a task, and watch the bigger model run on your GPU with nothing uploaded.

At a glance

Modelonnx-community/Florence-2-large
Taskimage-text-to-text, task-prompted (caption / detect / OCR / region / segment)
ArchitectureDaViT vision encoder + BART-style encoder-decoder (seq2seq)
Params / dtype0.77B Β· fp16 (needs shader-f16)
vs base~3.3Γ— the parameters of Florence-2-base-ft β€” the accuracy/detail jump, same prompt API
BackendWebGPU (required)
Download~1.6 GB fp16, cached after first load
LicenseMIT
Web APIsWebGPU, Web Workers, Canvas, FileReader

Run it

Because it's ~1.6 GB in fp16, Florence-2-large needs a GPU with a bit of headroom. On a device without WebGPU the page shows an honest needs-WebGPU state rather than a fake result.

A riverside at golden hour with a swan Two cats on a couch A cozy bedroom
…or drop / choose your own image

Task β€” the same model, steered by a token

The result appears here.

See inside β€” task token in, raw sequence out

Florence-2 has no separate heads for detection, OCR, and captioning β€” every task is the same text-to-text generation, differing only by the token you prepend. Below is the exact prompt the processor built, the raw decoded sequence the model emitted (special location tokens like <loc_512> and all), and the parsed result after post_process_generation. The large model tends to emit longer, more complete sequences than the base β€” visible right here in the raw output.

Task token / constructed prompt

Run a task to see the prompt.

Raw model output (before post-processing)

The raw generated sequence appears here.

Parsed result

The structured result appears here.

Why it matters

The large checkpoint is the one you reach for when the base model's answer is close but not quite good enough β€” a caption that misses a detail, a detection that drops a small object, OCR that garbles a hard font. Same single download, same task-token API; you're trading download size and GPU memory for accuracy.

Use cases

Basics

Detailed caption β€” feel the extra descriptive detail over the base model.

Practical

Detect & count, then OCR a real image with the sharper model.

Wild

Say a phrase, segment the thing you named β€” grounded masks.

Multi-model

Florence-large reads an image β†’ Qwen summarizes / answers about it.

How the API works

Identical to the base model β€” only the checkpoint id changes. Build the prompt from a task token, run the processor over the image and prompt, generate, decode, then post-process:

import { Florence2ForConditionalGeneration, AutoProcessor, load_image }
  from "@huggingface/transformers";

const model = await Florence2ForConditionalGeneration.from_pretrained(
  "onnx-community/Florence-2-large", { dtype: "fp16", device: "webgpu" });   // WebGPU required
const processor = await AutoProcessor.from_pretrained("onnx-community/Florence-2-large");

const image = await load_image(imageURL);
const task = "<OD>";                              // or <CAPTION>, <OCR>, <REFERRING_EXPRESSION_SEGMENTATION>…
const prompts = processor.construct_prompts(task);
const inputs = await processor(image, prompts);

const ids = await model.generate({ ...inputs, max_new_tokens: 512 });
const raw = processor.batch_decode(ids, { skip_special_tokens: false })[0];
const result = processor.post_process_generation(raw, task, image.size);
// result["<OD>"] = { bboxes: [[x1,y1,x2,y2], …], labels: [ … ] }

This page runs exactly that in a Web Worker, and gates on a real WebGPU adapter first β€” with none it shows a labelled needs-WebGPU state instead of a fake result.

References