Skip to main content
MicrosoftFastHigh

Florence-2 Large

Microsoft's Florence-2 all-in-one vision model โ€” captioning, object detection, phrase grounding, OCR, and segmentation in a single API. Pick a task, optionally add text input, done.

2 credits
per call
One model, many tasks (task_input selection)
Caption / Detailed Caption / Object Detection
OCR and OCR with region boxes
Phrase grounding and segmentation
3 credits per call

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Quick Start

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "lucataco/florence-2-large",
  "input": {
    "image": "https://example.com/document.jpg",
    "task_input": "OCR with Region"
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
imagestringYes-Input image
task_inputstringNoCaptionVision task to run (caption, detection, OCR, grounding, segmentation...)
CaptionDetailed CaptionMore Detailed CaptionCaption to Phrase GroundingObject DetectionDense Region CaptionRegion ProposalOCROCR with Region
text_inputstringNo-Text for tasks that need it (grounding phrases, region coords)

How to Provide File Input

There are 3 ways to provide files for the image parameter:

Recommended

Direct Upload (Multipart)

Attach files directly to POST /v1/predictions/upload. No separate upload step needed.

curl -X POST "https://api.core.today/v1/predictions/upload" \
  -H "X-API-Key: cdt_your_api_key" \
  -F "model=lucataco/florence-2-large" \
  -F 'input={"prompt":"your prompt here"}' \
  -F "file:image=@your_file.png"

Image URL

Pass a publicly accessible URL directly. You can also use file_url from the Storage API.

{
  "model": "lucataco/florence-2-large",
  "input": {
    "prompt": "your prompt here",
    "image": "https://example.com/image.jpg"
  }
}
See the File Upload docs for more upload methods including Presigned URLs.

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

OCR with Regions

Extract text with positional boxes

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "lucataco/florence-2-large",
  "input": {
    "image": "https://example.com/document.jpg",
    "task_input": "OCR with Region"
  }
}'

Detailed Caption

Get a rich multi-sentence caption

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "lucataco/florence-2-large",
  "input": {
    "image": "https://example.com/scene.jpg",
    "task_input": "More Detailed Caption"
  }
}'

Tips & Best Practices

1One dependency covers caption+detect+OCR โ€” simplifies vision pipelines
2'OCR with Region' returns text plus box coordinates for layout-aware parsing
3Use 'Caption to Phrase Grounding' with text_input to locate phrases in the image
4For text-prompted detection with thresholds, Grounding DINO gives finer control

Use Cases

Unified vision pipelines with one dependency
Detailed image captioning
OCR with positional boxes
Open-vocabulary detection
Region-aware segmentation