Downloads · 30 days
13
16% of all-time downloads
dill-dev/NanoDream2-2B
NanoDream2-2B is a image-text-to-text model from dill-dev. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
⚠️ This repository contains the latest version of NanoDream2 our previous generation model. The latest version of Nanodream is NanoDream 3 (Preview).
Downloads · 30 days
13
16% of all-time downloads
All-time downloads
81
Public
Parameters
1.9B
3.9 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors3.9 GB · 100%
From the Hugging Face model README
⚠️ This repository contains the latest version of NanoDream2 our previous generation model. The latest version of Nanodream is NanoDream 3 (Preview).
Nanodream is a small vision language model designed to run efficiently everywhere.
from transformers import AutoModelForCausalLM, AutoTokenizer
from PIL import Image
model = AutoModelForCausalLM.from_pretrained(
"dill-dev/NanoDream2-2B",
revision="2025-06-21",
trust_remote_code=True,
device_map={"": "cuda"} # ...or 'mps', on Apple Silicon
)
# Captioning
print("Short caption:")
print(model.caption(image, length="short")["caption"])
print("\nNormal caption:")
for t in model.caption(image, length="normal", stream=True)["caption"]:
# Streaming generation example, supported for caption() and detect()
print(t, end="", flush=True)
print(model.caption(image, length="normal"))
# Visual Querying
print("\nVisual query: 'How many people are in the image?'")
print(model.query(image, "How many people are in the image?")["answer"])
# Object Detection
print("\nObject detection: 'face'")
objects = model.detect(image, "face")["objects"]
print(f"Found {len(objects)} face(s)")
# Pointing
print("\nPointing: 'person'")
points = model.point(image, "person")["points"]
print(f"Found {len(points)} person(s)")
reasoning=True in the query skill to trade off speed vs. accuracy.Improved chart understanding (ChartQA up from 74.8 to 77.5, 82.2 with PoT)
Added temperature and nucleus sampling to reduce repetitive outputs
Better OCR for documents and tables (prompt with “Transcribe the text” or “Transcribe the text in natural reading order”)
Object detection supports document layout detection (figure, formula, text, etc)
UI understanding (ScreenSpot F1@0.5 up from 53.3 to 60.3)
Improved text understanding (DocVQA up from 76.5 to 79.3, TextVQA up from 74.6 to 76.3)
Added support for long-form captioning
Open vocabulary image tagging
Improved counting accuracy (e.g. CountBenchQA increased from 80 to 86.4)
Improved text understanding (e.g. OCRBench increased from 58.3 to 61.2)
Improved object detection, especially for small objects (e.g. COCO up from 30.5 to 51.2)
Fixed token streaming bug affecting multi-byte unicode characters
gpt-fast style compile() now supported in HF Transformers implementation