Florence-2, introduced by Microsoft Research at CVPR 2024, is an open-source vision-language foundation model designed to unify diverse computer vision tasks within a single sequence-to-sequence framework. Unlike traditional models that specialize in specific tasks, Florence-2 accepts both images and text prompts and outputs text for tasks such as captioning, object detection, segmentation, OCR, and region-based grounding. It comes in two sizes—Florence-2-base (~230M parameters) and Florence-2-large (~770M parameters)—and is trained on FLD-5B, a large dataset of ~126M images with ~5.4B annotations.
The model demonstrates strong zero-shot and fine-tuned performance, often rivaling larger vision-language systems while remaining lightweight and efficient. Released under the MIT license, all weights are publicly available, making it accessible for fine-tuning and deployment in applications like VQA, content tagging, accessibility, and research. Florence-2’s compact design, versatility, and openness position it as a practical alternative to larger proprietary multimodal models.
Drag and drop an image here, or click to browse
Captioning will run automatically
Other models worth comparing for similar use cases.
Florence-2 runs as a hosted REST endpoint through Roboflow Workflows. Pick a task, then hand the prompt to your coding agent or copy the code. Forking the workflow into a free Roboflow workspace replaces the your-workspace and YOUR_API_KEY placeholders with your own.
Add the Roboflow MCP server
claude mcp add --transport http roboflow https://mcp.roboflow.com/mcp
Run /mcp and authorize Roboflow in your browser when the OAuth flow opens.
Start a new Claude Code session so the MCP loads, then paste the prompt below (it works the same in any agent).
Fork this workflow to your Roboflow workspace to use it.
Integrate the Roboflow "Florence-2" workflow into my app.
- Endpoint: POST https://serverless.roboflow.com/<your-workspace>/workflows/playground-florence-2-c
- Auth: send my Roboflow API key as `api_key` in the request body, read from the ROBOFLOW_API_KEY env var (never hardcode).
- Body: { "api_key": ..., "inputs": { `image`: { type: "url" | "base64", value } } }.
With the Roboflow MCP connected, call `workflows_get` on "playground-florence-2-c" to read the exact input schema (the source of truth), then `workflows_run` on a sample image to confirm the output shape before writing code (the MCP is authenticated, so this needs no key). Without the MCP, use the contract above.
Before running the app, set up these keys so it does not error at runtime:
- `ROBOFLOW_API_KEY` (sent as `api_key`) from https://app.roboflow.com/settings/api
Create a .gitignore'd .env with these variables, using placeholder values for any I haven't given you. Then pause and tell me directly, in your reply: the full path to the .env file, exactly which keys I need to paste in, and the link to get each one. Wait for me to confirm I've added them before you run anything. Do not run the app until I confirm.
Then add the integration to my codebase: match my project's language, framework, and conventions; read every key from environment variables (never hardcode); add basic error handling; and include a small runnable example. If you can't tell what language my project uses, ask me.pip install inference-sdkFork this workflow to your Roboflow workspace to use it.
# 1. Import the library
from inference_sdk import InferenceHTTPClient
# 2. Connect to your workflow
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key="YOUR_API_KEY"
)
# 3. Run your workflow on an image
result = client.run_workflow(
workspace_name="your-workspace",
workflow_id="playground-florence-2-c",
images={
"image": "YOUR_IMAGE.jpg" # Path to your image file
},
use_cache=True # cache workflow definition for 15 minutes
)
# 4. Get your results
print(result)Fork this workflow to your Roboflow workspace to use it.
const response = await fetch('https://serverless.roboflow.com/your-workspace/workflows/playground-florence-2-c', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
inputs: {
"image": {"type": "url", "value": "IMAGE_URL"}
}
})
});
const result = await response.json();
console.log(result);Fork this workflow to your Roboflow workspace to use it.
curl --location 'https://serverless.roboflow.com/your-workspace/workflows/playground-florence-2-c' \
--header 'Content-Type: application/json' \
--data '{
"api_key": "YOUR_API_KEY",
"inputs": {
"image": {"type": "url", "value": "IMAGE_URL"}
}
}'Add the Roboflow MCP server
claude mcp add --transport http roboflow https://mcp.roboflow.com/mcp
Run /mcp and authorize Roboflow in your browser when the OAuth flow opens.
Start a new Claude Code session so the MCP loads, then paste the prompt below (it works the same in any agent).
Fork this workflow to your Roboflow workspace to use it.
Integrate the Roboflow "Florence-2" workflow into my app.
- Endpoint: POST https://serverless.roboflow.com/<your-workspace>/workflows/playground-florence-2-ocr
- Auth: send my Roboflow API key as `api_key` in the request body, read from the ROBOFLOW_API_KEY env var (never hardcode).
- Body: { "api_key": ..., "inputs": { `image`: { type: "url" | "base64", value } } }.
With the Roboflow MCP connected, call `workflows_get` on "playground-florence-2-ocr" to read the exact input schema (the source of truth), then `workflows_run` on a sample image to confirm the output shape before writing code (the MCP is authenticated, so this needs no key). Without the MCP, use the contract above.
Before running the app, set up these keys so it does not error at runtime:
- `ROBOFLOW_API_KEY` (sent as `api_key`) from https://app.roboflow.com/settings/api
Create a .gitignore'd .env with these variables, using placeholder values for any I haven't given you. Then pause and tell me directly, in your reply: the full path to the .env file, exactly which keys I need to paste in, and the link to get each one. Wait for me to confirm I've added them before you run anything. Do not run the app until I confirm.
Then add the integration to my codebase: match my project's language, framework, and conventions; read every key from environment variables (never hardcode); add basic error handling; and include a small runnable example. If you can't tell what language my project uses, ask me.pip install inference-sdkFork this workflow to your Roboflow workspace to use it.
# 1. Import the library
from inference_sdk import InferenceHTTPClient
# 2. Connect to your workflow
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key="YOUR_API_KEY"
)
# 3. Run your workflow on an image
result = client.run_workflow(
workspace_name="your-workspace",
workflow_id="playground-florence-2-ocr",
images={
"image": "YOUR_IMAGE.jpg" # Path to your image file
},
use_cache=True # cache workflow definition for 15 minutes
)
# 4. Get your results
print(result)Fork this workflow to your Roboflow workspace to use it.
const response = await fetch('https://serverless.roboflow.com/your-workspace/workflows/playground-florence-2-ocr', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
inputs: {
"image": {"type": "url", "value": "IMAGE_URL"}
}
})
});
const result = await response.json();
console.log(result);Fork this workflow to your Roboflow workspace to use it.
curl --location 'https://serverless.roboflow.com/your-workspace/workflows/playground-florence-2-ocr' \
--header 'Content-Type: application/json' \
--data '{
"api_key": "YOUR_API_KEY",
"inputs": {
"image": {"type": "url", "value": "IMAGE_URL"}
}
}'Add the Roboflow MCP server
claude mcp add --transport http roboflow https://mcp.roboflow.com/mcp
Run /mcp and authorize Roboflow in your browser when the OAuth flow opens.
Start a new Claude Code session so the MCP loads, then paste the prompt below (it works the same in any agent).
Fork this workflow to your Roboflow workspace to use it.
Integrate the Roboflow "Florence-2" workflow into my app.
- Endpoint: POST https://serverless.roboflow.com/<your-workspace>/workflows/playground-florence-2-od
- Auth: send my Roboflow API key as `api_key` in the request body, read from the ROBOFLOW_API_KEY env var (never hardcode).
- Body: { "api_key": ..., "inputs": { `image`: { type: "url" | "base64", value }, `classes`: string array } }.
With the Roboflow MCP connected, call `workflows_get` on "playground-florence-2-od" to read the exact input schema (the source of truth), then `workflows_run` on a sample image to confirm the output shape before writing code (the MCP is authenticated, so this needs no key). Without the MCP, use the contract above.
Before running the app, set up these keys so it does not error at runtime:
- `ROBOFLOW_API_KEY` (sent as `api_key`) from https://app.roboflow.com/settings/api
Create a .gitignore'd .env with these variables, using placeholder values for any I haven't given you. Then pause and tell me directly, in your reply: the full path to the .env file, exactly which keys I need to paste in, and the link to get each one. Wait for me to confirm I've added them before you run anything. Do not run the app until I confirm.
Then add the integration to my codebase: match my project's language, framework, and conventions; read every key from environment variables (never hardcode); add basic error handling; and include a small runnable example. If you can't tell what language my project uses, ask me.pip install inference-sdkFork this workflow to your Roboflow workspace to use it.
# 1. Import the library
from inference_sdk import InferenceHTTPClient
# 2. Connect to your workflow
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key="YOUR_API_KEY"
)
# 3. Run your workflow on an image
result = client.run_workflow(
workspace_name="your-workspace",
workflow_id="playground-florence-2-od",
images={
"image": "YOUR_IMAGE.jpg" # Path to your image file
},
parameters={
"classes": ["class1", "class2", "class3"]
},
use_cache=True # cache workflow definition for 15 minutes
)
# 4. Get your results
print(result)Fork this workflow to your Roboflow workspace to use it.
const response = await fetch('https://serverless.roboflow.com/your-workspace/workflows/playground-florence-2-od', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
inputs: {
"image": {"type": "url", "value": "IMAGE_URL"},
"classes": ["class1", "class2", "class3"]
}
})
});
const result = await response.json();
console.log(result);Fork this workflow to your Roboflow workspace to use it.
curl --location 'https://serverless.roboflow.com/your-workspace/workflows/playground-florence-2-od' \
--header 'Content-Type: application/json' \
--data '{
"api_key": "YOUR_API_KEY",
"inputs": {
"image": {"type": "url", "value": "IMAGE_URL"},
"classes": ["class1", "class2", "class3"]
}
}'License terms and commercial-use guidance for Florence-2.
This model is released under the MIT License, a short and permissive open-source license that allows commercial use, modification, and redistribution.
Yes. Under the terms of the MIT license, you can freely use this model for commercial purposes. You must retain the copyright notice and license text when redistributing.
License information is provided as a guide and is not legal advice.