diffusers / Florence2-image-Annotator

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: February 20 2026

Introduction of Florence2-image-Annotator

Model Details of Florence2-image-Annotator

Florence-2 Image Annotator

A custom Modular Diffusers block that uses Florence-2 for image annotation tasks like segmentation, object detection, and captioning.

How to use
import torch
from diffusers import ModularPipeline
from diffusers.utils import load_image

# Load the block
image_annotator = ModularPipeline.from_pretrained(
    "diffusers/Florence2-image-Annotator",
    trust_remote_code=True
)
image_annotator.load_components(torch_dtype=torch.bfloat16)
image_annotator.to("cuda")

# Load an image
image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg")
image = image.resize((1024, 1024))

# Generate a segmentation mask
output = image_annotator(
    image=image,
    annotation_task="<REFERRING_EXPRESSION_SEGMENTATION>",
    annotation_prompt="the car",
    annotation_output_type="mask_image",
).images[0]
output.save("car-mask.png")
Compose with Inpainting Pipeline
from diffusers import ModularPipeline

# Load the annotator
image_annotator = ModularPipeline.from_pretrained(
    "diffusers/Florence2-image-Annotator",
    trust_remote_code=True
)

# Get an inpainting workflow and insert the annotator
# repo_id = .. # you can use SDXL/flux/qwen any pipeline support Inpaint
inpaint_blocks = ModularPipeline.from_pretrained(repo_id).blocks.get_workflow("inpainting")
inpaint_blocks.sub_blocks.insert("image_annotator", image_annotator.blocks, 0)

# Initialize the combined pipeline
pipe = inpaint_blocks.init_pipeline()
pipe.load_components(torch_dtype=torch.float16, device="cuda")

# Inpaint with automatic mask generation
output = pipe(
    prompt=prompt,
    image=image,
    annotation_task="<REFERRING_EXPRESSION_SEGMENTATION>",
    annotation_prompt="the car",
    annotation_output_type="mask_image",
    num_inference_steps=30,
).images[0]
output.save("inpainted-car.png")
Supported Tasks
Task Description
<OD> Object detection
<REFERRING_EXPRESSION_SEGMENTATION> Segment specific objects based on text
<CAPTION> Generate image caption
<DETAILED_CAPTION> Generate detailed caption
<MORE_DETAILED_CAPTION> Generate very detailed caption
<DENSE_REGION_CAPTION> Caption different regions
<CAPTION_TO_PHRASE_GROUNDING> Ground phrases to regions
<OPEN_VOCABULARY_DETECTION> Detect objects from open vocabulary
Output Types
Type Description
mask_image Black and white mask image
mask_overlay Mask overlaid on original image
bounding_box Bounding boxes drawn on image
Inputs
Parameter Type Required Default Description
image PIL.Image Yes - Image to annotate
annotation_task str No <REFERRING_EXPRESSION_SEGMENTATION> Task to perform
annotation_prompt str Yes - Text prompt for the task
annotation_output_type str No mask_image Output format
Outputs
Parameter Type Description
mask_image PIL.Image Generated mask (when output type is mask_image )
image PIL.Image Annotated image (when output type is mask_overlay or bounding_box )
annotations dict Raw annotation predictions
Components

This block uses the following models from florence-community/Florence-2-base-ft :

  • image_annotator : Florence2ForConditionalGeneration
  • image_annotator_processor : AutoProcessor
Learn More

Runs of diffusers Florence2-image-Annotator on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About Florence2-image-Annotator huggingface.co Model

Florence2-image-Annotator huggingface.co

Florence2-image-Annotator huggingface.co is an AI model on huggingface.co that provides Florence2-image-Annotator's model effect (), which can be used instantly with this diffusers Florence2-image-Annotator model. huggingface.co supports a free trial of the Florence2-image-Annotator model, and also provides paid use of the Florence2-image-Annotator. Support call Florence2-image-Annotator model through api, including Node.js, Python, http.

Florence2-image-Annotator huggingface.co Url

https://huggingface.co/diffusers/Florence2-image-Annotator

diffusers Florence2-image-Annotator online free

Florence2-image-Annotator huggingface.co is an online trial and call api platform, which integrates Florence2-image-Annotator's modeling effects, including api services, and provides a free online trial of Florence2-image-Annotator, you can try Florence2-image-Annotator online for free by clicking the link below.

diffusers Florence2-image-Annotator online free url in huggingface.co:

https://huggingface.co/diffusers/Florence2-image-Annotator

Florence2-image-Annotator install

Florence2-image-Annotator is an open source model from GitHub that offers a free installation service, and any user can find Florence2-image-Annotator on GitHub to install. At the same time, huggingface.co provides the effect of Florence2-image-Annotator install, users can directly use Florence2-image-Annotator installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Florence2-image-Annotator install url in huggingface.co:

https://huggingface.co/diffusers/Florence2-image-Annotator

Url of Florence2-image-Annotator

Florence2-image-Annotator huggingface.co Url

Provider of Florence2-image-Annotator huggingface.co

diffusers
ORGANIZATIONS

Other API from diffusers

huggingface.co

Total runs: 46.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 22 2024
huggingface.co

Total runs: 2.4K
Run Growth: -1.8K
Growth Rate: -73.77%
Updated:February 08 2023
huggingface.co

Total runs: 645
Run Growth: 125
Growth Rate: 19.38%
Updated:February 24 2025
huggingface.co

Total runs: 17
Run Growth: -5
Growth Rate: -29.41%
Updated:January 27 2023
huggingface.co

Total runs: 8
Run Growth: -18
Growth Rate: -225.00%
Updated:February 07 2024
huggingface.co

Total runs: 1
Run Growth: -1
Growth Rate: -100.00%
Updated:March 14 2023