Nanosaur2-670M
well9472 · Kit
Makes illustrations from text prompts with a small 670M-parameter diffusion model, run through ComfyUI. Built as a low-budget research model for people who wan…
A small Microsoft vision model that handles captioning, object detection and segmentation by changing the text prompt. It suits developers and researchers who need several image tasks from one model.
Florence-2-base is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install -U huggingface_hub hf download microsoft/Florence-2-base
Florence-2-base is the 232 million parameter version of Microsoft's Florence-2 vision model, packaged for the transformers library. One model covers several image jobs, and you choose the job with a short task prompt, such as captioning, object detection or segmentation. It was trained on FLD-5B, a set with 5.4 billion annotations over 126 million images, and it works zero-shot or after fine-tuning.
It suits developers and researchers who want one compact vision model for several tasks instead of a separate model for each. It runs on a CPU or a CUDA GPU.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Accessibility | App developers | Draft written descriptions of images | Ask for a detailed caption of a photo |
| Computer vision | Vision engineers | Find objects in a picture with a prompt | Run the object detection prompt on a street scene |
| Research | Machine learning researchers | Fine-tune a small base model on their own images | Start from the base size and adapt it to a new task |
If you need the strongest accuracy, you can skip the base size. The card also lists a larger 0.77 billion version.
The card shows it in Python through the transformers library, on a GPU when one is present and the CPU otherwise.
| Use case | Who | What they get back |
|---|---|---|
| Image captioning | Developers | A short, detailed or more detailed caption |
| Object detection | Vision engineers | Detected objects with their boxes |
| Segmentation and more | Researchers | Results for other tasks chosen by the prompt |
You need Python with pip, the transformers library, PyTorch and Pillow. Download the model files, then load them in your script.
pip install -U huggingface_hub hf download microsoft/Florence-2-base
Load the model and processor, open an image with Pillow as the variable named image, pick a task prompt and generate. The card's own sample downloads a car photo from the web, which is left out here. The model works in float16 on a GPU.
from transformers import AutoProcessor, AutoModelForCausalLM
device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-base", torch_dtype=torch_dtype, trust_remote_code=True).to(device)
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", trust_remote_code=True)
prompt = "<OD>"
inputs = processor(text=prompt, images=image, return_tensors="pt").to(device, torch_dtype)
generated_ids = model.generate(
input_ids=inputs["input_ids"],
pixel_values=inputs["pixel_values"],
max_new_tokens=1024,
do_sample=False,
num_beams=3,
)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]
parsed_answer = processor.post_process_generation(generated_text, task="<OD>", image_size=(image.width, image.height))
print(parsed_answer)The card then defines a helper called run_example and swaps the prompt to change the task. These are the caption prompts it shows.
prompt = "<CAPTION>" run_example(prompt) prompt = "<DETAILED_CAPTION>" run_example(prompt) prompt = "<MORE_DETAILED_CAPTION>" run_example(prompt)
You open a photo of a street, set the object detection prompt and run the script. You get back parsed objects with their positions. Switching to the detailed caption prompt returns a written description of the same photo.
If you are new, think of it as one model you steer with a short instruction. Start with the caption prompt on a photo you know, and read the text it returns.
If you know the field, it is a sequence-to-sequence model that turns every task into text, so one set of weights serves many tasks. The card lists four sizes, two pretrained and two fine-tuned. The sample sets trust_remote_code, so check that setting against your security rules.
The family comes in two sizes, each pretrained on FLD-5B or fine-tuned on downstream tasks.
A small Microsoft vision model that handles captioning, object detection and segmentation by changing the text prompt. It suits developers and researchers who need several image tasks from one model.
Made by microsoft on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: Florence-2-base is the 232 million parameter version of Microsoft's Florence-2 vision model, packaged for the transformers library. One model covers several image jobs, and you choose the job with a short task prompt, such as captioning, object detection or segmentation. It was trained on FLD-5B, a set with 5.4 billion annotations over 126 million images, and it works zero-shot or after fine-tuning.
Who it suits: It suits developers and researchers who want one compact vision model for several tasks instead of a separate model for each. It runs on a CPU or a CUDA GPU.
Title: Who might use it
Industry | Who uses it | How they use it | Example
Accessibility | App developers | Draft written descriptions of images | Ask for a detailed caption of a photo
Computer vision | Vision engineers | Find objects in a picture with a prompt | Run the object detection prompt on a street scene
Research | Machine learning researchers | Fine-tune a small base model on their own images | Start from the base size and adapt it to a new task
If you need the strongest accuracy, you can skip the base size. The card also lists a larger 0.77 billion version.
Where to use it: The card shows it in Python through the transformers library, on a GPU when one is present and the CPU otherwise.
Title: Jobs it does
Use case | Who | What they get back
Image captioning | Developers | A short, detailed or more detailed caption
Object detection | Vision engineers | Detected objects with their boxes
Segmentation and more | Researchers | Results for other tasks chosen by the prompt
How to set it up: You need Python with pip, the transformers library, PyTorch and Pillow. Download the model files, then load them in your script.
pip install -U huggingface_hub
hf download microsoft/Florence-2-base
How to use it: Load the model and processor, open an image with Pillow as the variable named image, pick a task prompt and generate. The card's own sample downloads a car photo from the web, which is left out here. The model works in float16 on a GPU.
from transformers import AutoProcessor, AutoModelForCausalLM
device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-base", torch_dtype=torch_dtype, trust_remote_code=True).to(device)
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", trust_remote_code=True)
prompt = "<OD>"
inputs = processor(text=prompt, images=image, return_tensors="pt").to(device, torch_dtype)
generated_ids = model.generate(
input_ids=inputs["input_ids"],
pixel_values=inputs["pixel_values"],
max_new_tokens=1024,
do_sample=False,
num_beams=3,
)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]
parsed_answer = processor.post_process_generation(generated_text, task="<OD>", image_size=(image.width, image.height))
print(parsed_answer)
The card then defines a helper called run_example and swaps the prompt to change the task. These are the caption prompts it shows.
prompt = "<CAPTION>"
run_example(prompt)
prompt = "<DETAILED_CAPTION>"
run_example(prompt)
prompt = "<MORE_DETAILED_CAPTION>"
run_example(prompt)
Example: You open a photo of a street, set the object detection prompt and run the script. You get back parsed objects with their positions. Switching to the detailed caption prompt returns a written description of the same photo.
For newcomers and experts: If you are new, think of it as one model you steer with a short instruction. Start with the caption prompt on a photo you know, and read the text it returns.
If you know the field, it is a sequence-to-sequence model that turns every task into text, so one set of weights serves many tasks. The card lists four sizes, two pretrained and two fine-tuned. The sample sets trust_remote_code, so check that setting against your security rules.
An image and a task prompt go in
The processor prepares the inputs
The model generates text
The result is parsed into the task output
Good to know: The family comes in two sizes, each pretrained on FLD-5B or fine-tuned on downstream tasks.
Title: Model size in billions of parameters
Florence-2-base: 0.23
Florence-2-large: 0.77
Florence-2-base-ft: 0.23
Florence-2-large-ft: 0.77
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download microsoft/Florence-2-base
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 6 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| Florence-2-base This page | 14,139,837 | 439 | 232M | mit | |
| Florence-2-largeShares florence2 · vision · pytorch | 403,113 | 1,889 | 777M | mit | |
| elephant-1Shares vision · image-text-to-text · transformers | 7,426 | 115 | 9.4B | mit | |
| Agents-A1Shares vision · image-text-to-text · transformers | 7,232 | 669 | 35.1B | apache-2.0 | |
| mammoth-1Shares vision · image-text-to-text · transformers | 5,903 | 97 | 27.4B | mit | |
| Qwen3.8-27B-piShares vision · image-text-to-text · transformers | 1,857 | 87 | 27.8B | apache-2.0 |
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
well9472 · Kit
Makes illustrations from text prompts with a small 670M-parameter diffusion model, run through ComfyUI. Built as a low-budget research model for people who wan…
Waqf-AI · Kit
Reads handwritten Arabic text from images and returns it as text. A fine-tuned PaddleOCR-VL model for people digitizing Arabic handwriting.
Wan-AI · Kit
Makes video clips from a text prompt or an image plus text, at up to 720P and 24 frames per second, in the Diffusers format for a single consumer GPU.
Wan-AI · Kit
Generates cinematic video of a character driven by an audio track, and can also lip-sync existing video. For video creators, animators and researchers with a l…
Wan-AI · Kit
Animates a character or swaps one into a video by copying a performer's movement and expressions, as one model from the Wan2.2 video family. Use only faces and…
vllm-sr · Kit
Answers choice, yes-or-no, score, box and tracking questions about text, images or video in one call, with a probability for each answer. For people building r…