Florence-2 Model¶
v2¶
Class: Florence2BlockV2 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.models.foundation.florence2.v2.Florence2BlockV2
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
Dedicated inference server required (GPU recommended) - you may want to use dedicated deployment
This Workflow block introduces Florence 2, a Visual Language Model (VLM) capable of performing a wide range of tasks, including:
-
Object Detection
-
Instance Segmentation
-
Image Captioning
-
Optical Character Recognition (OCR)
-
and more...
Below is a comprehensive list of tasks supported by the model, along with descriptions on how to utilize their outputs within the Workflows ecosystem:
Task Descriptions:
-
Custom Prompt (
custom) - Use free-form prompt to generate a response. Useful with finetuned models. -
Text Recognition (OCR) (
ocr) - Model recognizes text in the image -
Text Detection & Recognition (OCR) (
ocr-with-text-detection) - Model detects text regions in the image, and then performs OCR on each detected region -
Captioning (short) (
caption) - Model provides a short description of the image -
Captioning (
detailed-caption) - Model provides a long description of the image -
Captioning (long) (
more-detailed-caption) - Model provides a very long description of the image -
Unprompted Object Detection (
object-detection) - Model detects and returns the bounding boxes for prominent objects in the image -
Object Detection (
open-vocabulary-object-detection) - Model detects and returns the bounding boxes for the provided classes -
Detection & Captioning (
object-detection-and-caption) - Model detects prominent objects and captions them -
Prompted Object Detection (
phrase-grounded-object-detection) - Based on the textual prompt, model detects objects matching the descriptions -
Prompted Instance Segmentation (
phrase-grounded-instance-segmentation) - Based on the textual prompt, model segments objects matching the descriptions -
Segment Bounding Box (
detection-grounded-instance-segmentation) - Model segments the object in the provided bounding box into a polygon -
Classification of Bounding Box (
detection-grounded-classification) - Model classifies the object inside the provided bounding box -
Captioning of Bounding Box (
detection-grounded-caption) - Model captions the object in the provided bounding box -
Text Recognition (OCR) for Bounding Box (
detection-grounded-ocr) - Model performs OCR on the text inside the provided bounding box -
Regions of Interest proposal (
region-proposal) - Model proposes Regions of Interest (Bounding Boxes) in the image
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/florence_2@v2to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
task_type |
str |
Task type to be performed by model. Value determines required parameters and output response.. | ❌ |
prompt |
str |
Text prompt to the Florence-2 model. | ✅ |
classes |
List[str] |
List of classes to be used. | ✅ |
grounding_detection |
Optional[List[float], List[int]] |
Detection to ground Florence-2 model. May be statically provided bounding box [left_top_x, left_top_y, right_bottom_x, right_bottom_y] or result of object-detection model. If the latter is true, one box will be selected based on grounding_selection_mode.. |
✅ |
grounding_selection_mode |
str |
. | ❌ |
model_id |
str |
Model to be used. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
hard— runtimeself_hosted_cpu; executionlocal - Requires a GPU; run_locally() loads a model that needs CUDA.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Florence-2 Model in version v2.
- inputs:
Template Matching,Morphological Transformation,Classification Label Visualization,Crop Visualization,Stability AI Outpainting,Blur Visualization,Detections Transformation,Reference Path Visualization,OpenAI,YOLO-World Model,Detections Classes Replacement,Anthropic Claude,Camera Focus,Track Class Lock,Size Measurement,Instance Segmentation Model,Mask Edge Snap,Model Comparison Visualization,Florence-2 Model,Trace Visualization,Background Color Visualization,Label Visualization,Image Convert Grayscale,Florence-2 Model,Text Display,Qwen-VL,Llama 3.2 Vision,Image Blur,Keypoint Detection Model,Absolute Static Crop,Velocity,CSV Formatter,Gaze Detection,Keypoint Detection Model,LMM,OC-SORT Tracker,Qwen 3.5 API,Qwen 3.6 API,Camera Focus,SORT Tracker,VLM As Detector,Clip Comparison,Detections Stitch,Google Gemma API,Contrast Enhancement,Halo Visualization,Color Visualization,Morphological Transformation,MoonshotAI Kimi,Stitch OCR Detections,Event Writer,Buffer,Stability AI Inpainting,Bounding Rectangle,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,Time in Zone,OpenAI,Roboflow Vision Events,Mask Area Measurement,Detection Offset,CogVLM,Detections Consensus,Object Detection Model,OPC UA Writer Sink,Dynamic Crop,Path Deviation,Byte Tracker,Bounding Box Visualization,Detections Combine,Qwen3.5-VL,Clip Comparison,SAM 3,OpenAI,Time in Zone,OCR Model,Single-Label Classification Model,Slack Notification,OpenRouter,Detection Event Log,SIFT Comparison,Pixelate Visualization,Google Vision OCR,SAM3 Video Tracker,Dynamic Zone,Google Gemma,Halo Visualization,Stitch OCR Detections,GLM-OCR,Image Threshold,SAM 3 Interactive,Stitch Images,Twilio SMS/MMS Notification,Icon Visualization,VLM As Classifier,MoonshotAI Kimi,ByteTrack Tracker,Google Gemini,Byte Tracker,Webhook Sink,Instance Segmentation Model,QR Code Generator,Path Deviation,MQTT Writer,Ellipse Visualization,Object Detection Model,Keypoint Detection Model,BoT-SORT Tracker,Dot Visualization,Perspective Correction,Instance Segmentation Model,Seg Preview,Per-Class Confidence Filter,Roboflow Dataset Upload,PLC ModbusTCP,Detections Stabilizer,Detections Merge,SIFT,Google Gemini,EasyOCR,Dimension Collapse,Local File Sink,SAM 3,Triangle Visualization,Contrast Equalization,Time in Zone,Polygon Visualization,OpenAI,SAM2 Video Tracker,Heatmap Visualization,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Polygon Visualization,Email Notification,Image Stack,Mask Visualization,Anthropic Claude,Detections Filter,PTZ Tracking (ONVIF),Keypoint Visualization,Background Subtraction,Multi-Label Classification Model,Overlap Filter,Twilio SMS Notification,Email Notification,Image Slicer,Image Contours,Line Counter Visualization,Image Preprocessing,Byte Tracker,SAM 3,Depth Estimation,Motion Detection,Current Time,Corner Visualization,Polygon Zone Visualization,Camera Calibration,Roboflow Dataset Upload,Grid Visualization,Stability AI Image Generation,Moondream2,Segment Anything 2 Model,S3 Sink,Circle Visualization,Image Slicer,Roboflow Custom Metadata,Relative Static Crop,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Anthropic Claude,Line Counter - outputs:
Morphological Transformation,Classification Label Visualization,Crop Visualization,Stability AI Outpainting,Reference Path Visualization,OpenAI,YOLO-World Model,Detections Classes Replacement,Anthropic Claude,Instance Segmentation Model,Size Measurement,Model Comparison Visualization,Florence-2 Model,Trace Visualization,JSON Parser,Label Visualization,Florence-2 Model,Qwen-VL,Text Display,Llama 3.2 Vision,Image Blur,Keypoint Detection Model,Keypoint Detection Model,LMM,Qwen 3.5 API,Qwen 3.6 API,Line Counter,VLM As Detector,Detections Stitch,Clip Comparison,Google Gemma API,Halo Visualization,Stitch OCR Detections,MoonshotAI Kimi,Color Visualization,Morphological Transformation,Event Writer,Buffer,Stability AI Inpainting,Cache Set,Microsoft SQL Server Sink,Time in Zone,Roboflow Asset Library Attributes,OpenAI,Roboflow Vision Events,CogVLM,Detections Consensus,Object Detection Model,OPC UA Writer Sink,Semantic Segmentation Model,Dynamic Crop,Path Deviation,Bounding Box Visualization,Qwen3.5-VL,Clip Comparison,SAM 3,Cache Get,OpenAI,Time in Zone,Slack Notification,OpenRouter,Google Vision OCR,SIFT Comparison,SAM3 Video Tracker,Google Gemma,Halo Visualization,CLIP Embedding Model,Stitch OCR Detections,GLM-OCR,Image Threshold,Twilio SMS/MMS Notification,Icon Visualization,VLM As Classifier,MoonshotAI Kimi,Single-Label Classification Model,Google Gemini,Webhook Sink,Instance Segmentation Model,QR Code Generator,Path Deviation,MQTT Writer,Ellipse Visualization,Anthropic Claude,Object Detection Model,Keypoint Detection Model,Dot Visualization,Perspective Correction,Instance Segmentation Model,Seg Preview,Per-Class Confidence Filter,Roboflow Dataset Upload,Google Gemini,Local File Sink,SAM 3,Triangle Visualization,Contrast Equalization,Time in Zone,Polygon Visualization,OpenAI,Heatmap Visualization,Perception Encoder Embedding Model,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Multi-Label Classification Model,Polygon Visualization,Email Notification,Mask Visualization,Anthropic Claude,Distance Measurement,PTZ Tracking (ONVIF),Keypoint Visualization,Twilio SMS Notification,Email Notification,Line Counter Visualization,Image Preprocessing,SAM 3,VLM As Classifier,Depth Estimation,Pixel Color Count,Motion Detection,Current Time,Roboflow Dataset Upload,Polygon Zone Visualization,Moondream2,Segment Anything 2 Model,Corner Visualization,Stability AI Image Generation,Grid Visualization,S3 Sink,Circle Visualization,Roboflow Custom Metadata,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Background Color Visualization,Line Counter
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Florence-2 Model in version v2 has.
Bindings
-
input
images(image): The image to infer on..prompt(string): Text prompt to the Florence-2 model.classes(list_of_values): List of classes to be used.grounding_detection(Union[instance_segmentation_prediction,list_of_values,keypoint_detection_prediction,object_detection_prediction]): Detection to ground Florence-2 model. May be statically provided bounding box[left_top_x, left_top_y, right_bottom_x, right_bottom_y]or result of object-detection model. If the latter is true, one box will be selected based ongrounding_selection_mode..model_id(roboflow_model_id): Model to be used.
-
output
raw_output(Union[string,language_model_output]): String value ifstringor LLM / VLM output iflanguage_model_output.parsed_output(dictionary): Dictionary.classes(list_of_values): List of values of any type.
Example JSON definition of step Florence-2 Model in version v2
{
"name": "<your_step_name_here>",
"type": "roboflow_core/florence_2@v2",
"images": "$inputs.image",
"task_type": "<block_does_not_provide_example>",
"prompt": "my prompt",
"classes": [
"class-a",
"class-b"
],
"grounding_detection": "$steps.detection.predictions",
"grounding_selection_mode": "first",
"model_id": "florence-2-base"
}
v1¶
Class: Florence2BlockV1 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.models.foundation.florence2.v1.Florence2BlockV1
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
Dedicated inference server required (GPU recommended) - you may want to use dedicated deployment
This Workflow block introduces Florence 2, a Visual Language Model (VLM) capable of performing a wide range of tasks, including:
-
Object Detection
-
Instance Segmentation
-
Image Captioning
-
Optical Character Recognition (OCR)
-
and more...
Below is a comprehensive list of tasks supported by the model, along with descriptions on how to utilize their outputs within the Workflows ecosystem:
Task Descriptions:
-
Custom Prompt (
custom) - Use free-form prompt to generate a response. Useful with finetuned models. -
Text Recognition (OCR) (
ocr) - Model recognizes text in the image -
Text Detection & Recognition (OCR) (
ocr-with-text-detection) - Model detects text regions in the image, and then performs OCR on each detected region -
Captioning (short) (
caption) - Model provides a short description of the image -
Captioning (
detailed-caption) - Model provides a long description of the image -
Captioning (long) (
more-detailed-caption) - Model provides a very long description of the image -
Unprompted Object Detection (
object-detection) - Model detects and returns the bounding boxes for prominent objects in the image -
Object Detection (
open-vocabulary-object-detection) - Model detects and returns the bounding boxes for the provided classes -
Detection & Captioning (
object-detection-and-caption) - Model detects prominent objects and captions them -
Prompted Object Detection (
phrase-grounded-object-detection) - Based on the textual prompt, model detects objects matching the descriptions -
Prompted Instance Segmentation (
phrase-grounded-instance-segmentation) - Based on the textual prompt, model segments objects matching the descriptions -
Segment Bounding Box (
detection-grounded-instance-segmentation) - Model segments the object in the provided bounding box into a polygon -
Classification of Bounding Box (
detection-grounded-classification) - Model classifies the object inside the provided bounding box -
Captioning of Bounding Box (
detection-grounded-caption) - Model captions the object in the provided bounding box -
Text Recognition (OCR) for Bounding Box (
detection-grounded-ocr) - Model performs OCR on the text inside the provided bounding box -
Regions of Interest proposal (
region-proposal) - Model proposes Regions of Interest (Bounding Boxes) in the image
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/florence_2@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
task_type |
str |
Task type to be performed by model. Value determines required parameters and output response.. | ❌ |
prompt |
str |
Text prompt to the Florence-2 model. | ✅ |
classes |
List[str] |
List of classes to be used. | ✅ |
grounding_detection |
Optional[List[float], List[int]] |
Detection to ground Florence-2 model. May be statically provided bounding box [left_top_x, left_top_y, right_bottom_x, right_bottom_y] or result of object-detection model. If the latter is true, one box will be selected based on grounding_selection_mode.. |
✅ |
grounding_selection_mode |
str |
. | ❌ |
model_version |
str |
Model to be used. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
hard— runtimeself_hosted_cpu; executionlocal - Requires a GPU; run_locally() loads a model that needs CUDA.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Florence-2 Model in version v1.
- inputs:
Template Matching,Morphological Transformation,Classification Label Visualization,Crop Visualization,Stability AI Outpainting,Blur Visualization,Detections Transformation,Reference Path Visualization,OpenAI,YOLO-World Model,Detections Classes Replacement,Anthropic Claude,Camera Focus,Track Class Lock,Size Measurement,Instance Segmentation Model,Mask Edge Snap,Model Comparison Visualization,Florence-2 Model,Trace Visualization,Background Color Visualization,Label Visualization,Image Convert Grayscale,Florence-2 Model,Text Display,Qwen-VL,Llama 3.2 Vision,Image Blur,Keypoint Detection Model,Absolute Static Crop,Velocity,CSV Formatter,Gaze Detection,Keypoint Detection Model,LMM,OC-SORT Tracker,Qwen 3.5 API,Qwen 3.6 API,Camera Focus,SORT Tracker,VLM As Detector,Clip Comparison,Detections Stitch,Google Gemma API,Contrast Enhancement,Halo Visualization,Color Visualization,Morphological Transformation,MoonshotAI Kimi,Stitch OCR Detections,Event Writer,Buffer,Stability AI Inpainting,Bounding Rectangle,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,Time in Zone,OpenAI,Roboflow Vision Events,Mask Area Measurement,Detection Offset,CogVLM,Detections Consensus,Object Detection Model,OPC UA Writer Sink,Dynamic Crop,Path Deviation,Byte Tracker,Bounding Box Visualization,Detections Combine,Qwen3.5-VL,Clip Comparison,SAM 3,OpenAI,Time in Zone,OCR Model,Single-Label Classification Model,Slack Notification,OpenRouter,Detection Event Log,SIFT Comparison,Pixelate Visualization,Google Vision OCR,SAM3 Video Tracker,Dynamic Zone,Google Gemma,Halo Visualization,Stitch OCR Detections,GLM-OCR,Image Threshold,SAM 3 Interactive,Stitch Images,Twilio SMS/MMS Notification,Icon Visualization,VLM As Classifier,MoonshotAI Kimi,ByteTrack Tracker,Google Gemini,Byte Tracker,Webhook Sink,Instance Segmentation Model,QR Code Generator,Path Deviation,MQTT Writer,Ellipse Visualization,Object Detection Model,Keypoint Detection Model,BoT-SORT Tracker,Dot Visualization,Perspective Correction,Instance Segmentation Model,Seg Preview,Per-Class Confidence Filter,Roboflow Dataset Upload,PLC ModbusTCP,Detections Stabilizer,Detections Merge,SIFT,Google Gemini,EasyOCR,Dimension Collapse,Local File Sink,SAM 3,Triangle Visualization,Contrast Equalization,Time in Zone,Polygon Visualization,OpenAI,SAM2 Video Tracker,Heatmap Visualization,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Polygon Visualization,Email Notification,Image Stack,Mask Visualization,Anthropic Claude,Detections Filter,PTZ Tracking (ONVIF),Keypoint Visualization,Background Subtraction,Multi-Label Classification Model,Overlap Filter,Twilio SMS Notification,Email Notification,Image Slicer,Image Contours,Line Counter Visualization,Image Preprocessing,Byte Tracker,SAM 3,Depth Estimation,Motion Detection,Current Time,Corner Visualization,Polygon Zone Visualization,Camera Calibration,Roboflow Dataset Upload,Grid Visualization,Stability AI Image Generation,Moondream2,Segment Anything 2 Model,S3 Sink,Circle Visualization,Image Slicer,Roboflow Custom Metadata,Relative Static Crop,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Anthropic Claude,Line Counter - outputs:
Morphological Transformation,Classification Label Visualization,Crop Visualization,Stability AI Outpainting,Reference Path Visualization,OpenAI,YOLO-World Model,Detections Classes Replacement,Anthropic Claude,Instance Segmentation Model,Size Measurement,Model Comparison Visualization,Florence-2 Model,Trace Visualization,JSON Parser,Label Visualization,Florence-2 Model,Qwen-VL,Text Display,Llama 3.2 Vision,Image Blur,Keypoint Detection Model,Keypoint Detection Model,LMM,Qwen 3.5 API,Qwen 3.6 API,Line Counter,VLM As Detector,Detections Stitch,Clip Comparison,Google Gemma API,Halo Visualization,Stitch OCR Detections,MoonshotAI Kimi,Color Visualization,Morphological Transformation,Event Writer,Buffer,Stability AI Inpainting,Cache Set,Microsoft SQL Server Sink,Time in Zone,Roboflow Asset Library Attributes,OpenAI,Roboflow Vision Events,CogVLM,Detections Consensus,Object Detection Model,OPC UA Writer Sink,Semantic Segmentation Model,Dynamic Crop,Path Deviation,Bounding Box Visualization,Qwen3.5-VL,Clip Comparison,SAM 3,Cache Get,OpenAI,Time in Zone,Slack Notification,OpenRouter,Google Vision OCR,SIFT Comparison,SAM3 Video Tracker,Google Gemma,Halo Visualization,CLIP Embedding Model,Stitch OCR Detections,GLM-OCR,Image Threshold,Twilio SMS/MMS Notification,Icon Visualization,VLM As Classifier,MoonshotAI Kimi,Single-Label Classification Model,Google Gemini,Webhook Sink,Instance Segmentation Model,QR Code Generator,Path Deviation,MQTT Writer,Ellipse Visualization,Anthropic Claude,Object Detection Model,Keypoint Detection Model,Dot Visualization,Perspective Correction,Instance Segmentation Model,Seg Preview,Per-Class Confidence Filter,Roboflow Dataset Upload,Google Gemini,Local File Sink,SAM 3,Triangle Visualization,Contrast Equalization,Time in Zone,Polygon Visualization,OpenAI,Heatmap Visualization,Perception Encoder Embedding Model,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Multi-Label Classification Model,Polygon Visualization,Email Notification,Mask Visualization,Anthropic Claude,Distance Measurement,PTZ Tracking (ONVIF),Keypoint Visualization,Twilio SMS Notification,Email Notification,Line Counter Visualization,Image Preprocessing,SAM 3,VLM As Classifier,Depth Estimation,Pixel Color Count,Motion Detection,Current Time,Roboflow Dataset Upload,Polygon Zone Visualization,Moondream2,Segment Anything 2 Model,Corner Visualization,Stability AI Image Generation,Grid Visualization,S3 Sink,Circle Visualization,Roboflow Custom Metadata,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Background Color Visualization,Line Counter
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Florence-2 Model in version v1 has.
Bindings
-
input
images(image): The image to infer on..prompt(string): Text prompt to the Florence-2 model.classes(list_of_values): List of classes to be used.grounding_detection(Union[instance_segmentation_prediction,list_of_values,keypoint_detection_prediction,object_detection_prediction]): Detection to ground Florence-2 model. May be statically provided bounding box[left_top_x, left_top_y, right_bottom_x, right_bottom_y]or result of object-detection model. If the latter is true, one box will be selected based ongrounding_selection_mode..model_version(string): Model to be used.
-
output
raw_output(Union[string,language_model_output]): String value ifstringor LLM / VLM output iflanguage_model_output.parsed_output(dictionary): Dictionary.classes(list_of_values): List of values of any type.
Example JSON definition of step Florence-2 Model in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/florence_2@v1",
"images": "$inputs.image",
"task_type": "<block_does_not_provide_example>",
"prompt": "my prompt",
"classes": [
"class-a",
"class-b"
],
"grounding_detection": "$steps.detection.predictions",
"grounding_selection_mode": "first",
"model_version": "florence-2-base"
}