siglip2-base-patch16-naflex
by google
Keeps the image's real shape instead of square-cropping it to 224 by 224
google/siglip2-base-patch16-naflexDeploy siglip2-base-patch16-naflex
Single-tenantMixpeek has no managed extractor for this model. On a single-tenant deployment you upload the weights and a custom plugin serves them next to the rest of your pipeline.
Overview
Almost every image encoder resizes its input to a square before it looks at anything. For a photograph that is survivable. For a screenshot, a scanned page, a wide video frame or a phone-shot receipt it is not, because the aspect ratio carried information and the resize threw it away, along with most of the small text. NaFlex is the SigLIP 2 variant that accepts native aspect ratios and a variable sequence length, so a 3:1 banner and a portrait document are encoded as the shapes they are. On document and screenshot retrieval that is frequently the difference between finding the page and not.
Architecture
SigLIP 2, patch size 16, NaFlex variable-resolution variant, 375,234,050 parameters in safetensors. Sigmoid pairwise loss rather than softmax contrastive, so training does not need a global negative pool.
Mixpeek SDK Integration
# NaFlex takes the image at its own aspect ratio, so do NOT pre-resize to a
# square before handing it over. The processor handles the variable sequence.
from transformers import AutoProcessor, AutoModel
from mixpeek import Mixpeek
import torch
proc = AutoProcessor.from_pretrained("google/siglip2-base-patch16-naflex")
model = AutoModel.from_pretrained("google/siglip2-base-patch16-naflex")
mx = Mixpeek(api_key="API_KEY")
inputs = proc(images=page_image, return_tensors="pt")
with torch.no_grad():
vec = model.get_image_features(**inputs)[0]
vec = (vec / vec.norm()).tolist()
mx.namespaces.documents.upsert(
namespace_id="ns_your_namespace",
documents=[{
"document_id": "invoice-4471-page-2",
"payload": {"source_key": "invoices/4471.pdf#page=2"},
"vectors": {"image_embedding": vec},
}],
)Capabilities
- Native aspect ratio and variable sequence length, no forced square crop
- Zero-shot image classification and image-text retrieval in one embedding space
- Multilingual text tower, inherited from SigLIP 2
- Apache-2.0
Use Cases on Mixpeek
Frequently Asked Questions
How is NaFlex different from the other SigLIP 2 checkpoints?
The fixed-resolution checkpoints resize every input to one square size. NaFlex keeps the native aspect ratio and lets the sequence length vary with the image, so a wide or tall input is not squashed. Everything else about the model is the same family, so if your images are already roughly square you gain little and pay a variable-length cost.
Will this read the text in my documents?
No, and the distinction matters. It embeds the page as an image, so it retrieves pages that look like your query. It does not transcribe. For the words themselves you still want OCR or a document-understanding model, and the two are complementary rather than alternatives.
Does Mixpeek run this model?
Not as a managed extractor. Embed your pages with it and upsert the vectors against an image index on the collection, or use the multimodal extractor if you would rather not run an encoder at all.
Specification
Research Paper
SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features
arxiv.orgBuild a pipeline with siglip2-base-patch16-naflex
Add this model to a processing pipeline alongside other extractors. Combine with retrieval stages for end-to-end search.
Run it on your own data, free