Model reference · open weights

blip2-flan-t5-xl

LLMs Salesforce Vision + text 1 build Open weights 132k dl/mo

blip2-flan-t5-xl is an open-weight language model from Salesforce. blip2-flan-t5-xl (FP32) weighs 7.9 GB; the smallest configuration that runs it is RTX 3060 12 GB.

  • blip2-flan-t5-xl is a 3.9B parameter image-text-to-text model developed by Salesforce.
  • It uses a frozen Flan T5-xl language model and a CLIP-like image encoder connected by a Querying Transformer to perform tasks such as image captioning and visual question answering in English.
  • The model is released under the MIT license.

Summary of the Salesforce/blip2-flan-t5-xl model card, 2026-10-01

What it is

Released bySalesforce
Released2023-02-06
Parameters3.9B
VRAM7.9 GB for the weights

What it runs on

Memory and cards for blip2-flan-t5-xl (FP32)

7.9 GBweights, file size
197 MBcache per 1K tokens
1.9 GBruntime overhead, at least
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB1—9K11.6 GB
RTX 4060 Ti 16 GB3—28K15.4 GB
RTX 3090 24 GB8267K23.4 GB
RTX 4090 24 GB8267K23.4 GB
RTX 5090 32 GB133105K31.0 GB
L40S 48 GB215128K44.0 GB
A100 80 GB4210128K78.2 GB
H100 80 GB4010128K78.1 GB
RTX PRO 6000 Blackwell 96 GB5012128K93.8 GB
DGX Spark (GB10) 128 GB unified5814128K107 GB
H200 141 GB7719128K138 GB
B200 180 GB10125128K176 GB
Memory needed at each load
Requests at once8K tokens each32K tokens each
111.3 GB16.2 GB
517.8 GB41.9 GB
822.6 GB61.3 GB
1635.5 GB113 GB
3261.3 GB216 GB
64113 GB422 GB

One card, with vLLM's small-card settings.

From the model card

What Salesforce says about blip2-flan-t5-xl

Read the model card

BLIP-2 model, leveraging Flan T5-xl (a large language model). It was introduced in the paper BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models by Li et al. and first released in this repository.

Disclaimer: The team releasing BLIP-2 did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

BLIP-2 consists of 3 models: a CLIP-like image encoder, a Querying Transformer (Q-Former) and a large language model.

The authors initialize the weights of the image encoder and large language model from pre-trained checkpoints and keep them frozen while training the Querying Transformer, which is a BERT-like Transformer encoder that maps a set of "query tokens" to query embeddings, which bridge the gap between the embedding space of the image encoder and the large language model.

The goal for the model is simply to predict the next text token, giving the query embeddings and the previous text.

alt="drawing" width="600"/>

This allows the model to be used for tasks like:

  • image captioning
  • visual question answering (VQA)
  • chat-like conversations by feeding the image and the previous conversation as prompt to the model

Direct Use and Downstream Use

You can use the raw model for conditional text generation given an image and optional text. See the model hub to look for fine-tuned versions on a task that interests you.

Bias, Risks, Limitations, and Ethical Considerations

BLIP2-FlanT5 uses off-the-shelf Flan-T5 as the language model. It inherits the same risks and limitations from Flan-T5:

Language models, including Flan-T5, can potentially be used for language generation in a harmful way, according to Rae et al. (2021). Flan-T5 should not be used directly in any application, without a prior assessment of safety and fairness concerns specific to the application.

BLIP2 is fine-tuned on image-text datasets (e.g. LAION ) collected from the internet. As a result the model itself is potentially vulnerable to generating equivalently inappropriate content or replicating inherent biases in the underlying data.

BLIP2 has not been tested in real world applications. It should not be directly deployed in any applications. Researchers should first carefully assess the safety and fairness of the model in relation to the specific context they’re being deployed within.

Ethical Considerations

This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before deploying this model. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact people’s lives, rights, or safety. For further guidance on use cases, refer to our AUP and AI AUP.

How to use

For code examples, we refer to the documentation.

Running the model on CPU
import requests
from PIL import Image
from transformers import BlipProcessor, Blip2ForConditionalGeneration

processor = BlipProcessor.from_pretrained("Salesforce/blip2-flan-t5-xl")
model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-flan-t5-xl")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg'
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

question = "how many dogs are in the picture?"
inputs = processor(raw_image, question, return_tensors="pt")

out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True))
Running the model on GPU
In full precision
# pip install accelerate
import requests
from PIL import Image
from transformers import Blip2Processor, Blip2ForConditionalGeneration

processor = Blip2Processor.from_pretrained("Salesforce/blip2-flan-t5-xl")
model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-flan-t5-xl", device_map="auto")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg'
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

question = "how many dogs are in the picture?"
inputs = processor(raw_image, question, return_tensors="pt").to("cuda")

out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True))
In half precision (float16)
# pip install accelerate
import torch
import requests
from PIL import Image
from transformers import Blip2Processor, Blip2ForConditionalGeneration

processor = Blip2Processor.from_pretrained("Salesforce/blip2-flan-t5-xl")
model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-flan-t5-xl", torch_dtype=torch.float16, device_map="auto")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg'
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

question = "how many dogs are in the picture?"
inputs = processor(raw_image, question, return_tensors="pt").to("cuda", torch.float16)

out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True))
In 8-bit precision (int8)
# pip install accelerate bitsandbytes
import torch
import requests
from PIL import Image
from transformers import Blip2Processor, Blip2ForCondi

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms