image-text-to-text Β· vision foundation Β· WebGPU Β· ~1.6 GB
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.
| Model | onnx-community/Florence-2-large |
|---|---|
| Task | image-text-to-text, task-prompted (caption / detect / OCR / region / segment) |
| Architecture | DaViT vision encoder + BART-style encoder-decoder (seq2seq) |
| Params / dtype | 0.77B Β· fp16 (needs shader-f16) |
| vs base | ~3.3Γ the parameters of Florence-2-base-ft β the accuracy/detail jump, same prompt API |
| Backend | WebGPU (required) |
| Download | ~1.6 GB fp16, cached after first load |
| License | MIT |
| Web APIs | WebGPU, Web Workers, Canvas, FileReader |
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.
Task β the same model, steered by a token
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.
Run a task to see the prompt.
The raw generated sequence appears here.
The structured result appears here.
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.
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.