Skip to content

Runs in the browser · Vision + language

Run Florence-2-large-ft in your browser

Florence-2-large-ft downloads 555.3 MB over WebGPU (q4f16), or 791.1 MB over WebAssembly (uint8), to caption, detect, or segment an image using task-prompt tokens entirely in the tab with Transformers.js. No install, no server.

Vision + language · onnx-community/Florence-2-large-ft

WebGPU download
555.3 MB
q4f16
WASM download
791.1 MB
uint8
Parameters
770.43M
Pipeline task
custom

Reading

Same task-prompt-token usage as Florence-2-base (see that model); no pipeline() call, use Florence2ForConditionalGeneration and AutoProcessor directly.

The second-largest vision + language download in the catalog (555.3 MB).

The quant ladder spans 5.7x: 555.3 MB (q4f16) to 3.07 GB (fp32).

Will it run in your browser?

Live check this browser

Checking for WebGPU support…

All measured variants

Quant Download size
Variant Size
q4f16 WebGPU pick 555.3 MB
bnb4 709.7 MB
q4 753.9 MB
uint8 WASM pick 791.1 MB
fp16 1.54 GB
q8 1.55 GB
fp32 3.07 GB

Sizes measured from the HuggingFace API file tree for onnx-community/Florence-2-large-ft, not estimated.

Use it with Transformers.js

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

const model = await Florence2ForConditionalGeneration.from_pretrained("onnx-community/Florence-2-large-ft", {
  device: "webgpu",
  // Per-module dtype map: keep the language-model parts in fp16/fp32 for
  // quality, quantize the (much larger) vision encoder/decoder to q4.
  dtype: {
    embed_tokens: "fp16", // or "fp32" where WebGPU fp16 (shader-f16) isn't supported
    vision_encoder: "fp16", // or "fp32" where WebGPU fp16 isn't supported
    encoder_model: "q4",
    decoder_model_merged: "q4",
  },
});
const processor = await AutoProcessor.from_pretrained("onnx-community/Florence-2-large-ft");
const tokenizer = await AutoTokenizer.from_pretrained("onnx-community/Florence-2-large-ft");

const prompt = "<MORE_DETAILED_CAPTION>"; // task-prompt token, not free text
// const inputs = await processor(image, prompt);
// const generated = await model.generate({ ...inputs, max_new_tokens: 100 });
// const result = processor.batch_decode(generated, { skip_special_tokens: false });

Requires npm install @huggingface/transformers (or the CDN build). This model needs the lower-level API shown above, not pipeline() (see the Reading panel above).

Sources

Same job, different size

FAQ

WebGPU or WASM for Florence-2-large-ft, in practice?

Chrome, Edge, and Safari 26+ run the WebGPU build (q4f16) on the GPU. Firefox has WebGPU on Windows and Apple Silicon Macs but not everywhere yet. Any browser without a WebGPU adapter falls back automatically to the WebAssembly build (uint8) on CPU: same model, slower to load, slower to run.

What does q4f16 mean for Florence-2-large-ft?

The WebGPU build here uses q4f16: 4-bit weights with some layers kept at 16-bit for stability: WebGPU's usual smallest clean build. The WASM fallback uses uint8: 8-bit integers: about a quarter the size of fp32, with a smaller quality trade than 4-bit.

Sizes measured 2026-08-01 from the HuggingFace API. Last validated 2026-08-03. See all browser models or the methodology.