BLIP2 Flan T5 XL

BLIP2_FLAN_T5_XL

Describes a photo in a sentence or answers a question about it in plain English.

Vision & Analysisimage-captioningvisual-question-answeringblip-2mitFine-tunable
BLIP2 Flan T5 XL: Vision & Analysis model on Kainguru

About BLIP2 Flan T5 XL

Good to know

  • Write the fine-tuning manifest after uploading the images: each "file" is the URL or name its upload returned (such as 0192f3c4-7e1a-7c2b-9d5e-1f2a3b4c5d6e.png), never the name the image had on your computer.

Attribution

BLIP-2 by Salesforce Research, released under the MIT License. Its image encoder is EVA-CLIP ViT-g (MIT License, Copyright (c) 2022 BAAI-Vision) and its language model is Google's Flan-T5 XL (Apache License 2.0).

BLIP2 Flan T5 XL inputs and output

NameTypeRequiredDefaultDetails
imagefileYes—The picture: JPEG, PNG or WebP, up to 20 MB and 50 megapixels.
Max 2048 characters · image/jpeg, png, webp
max_new_tokensintegerNo40Longest caption or answer, in tokens (a token is about three quarters of a word).
1–128
questiontextNo—A question about the image. Question-answering models need one; BLIP-2 answers it, or writes a caption when it is empty; captioning models take it as the start of the caption and finish it, e.g. "a photograph of".
Max 512 characters

Output. The caption, or the answer to the question, as plain text.

Run BLIP2 Flan T5 XL with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=BLIP2_FLAN_T5_XL" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image": "https://example.com/input.png",
    "max_new_tokens": 40
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "BLIP2_FLAN_T5_XL",
        {
          "image": "https://example.com/input.png",
          "max_new_tokens": 40
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune BLIP2 Flan T5 XL

You can fine-tune BLIP2 Flan T5 XL on your own data and run the tuned model through the same API. Dataset: Images plus a JSONL manifest, one {"file", "text"} per line: file as its upload returned it, text the caption or answer (up to 500 characters). Question answering needs "question" on each line; BLIP-2 takes it, captioning refuses it. 4 to 10000 lines.

The steps are in the docs.

BLIP2 Flan T5 XL pricing

Price per request: 0.1019 credits ($0.001019). The price is shown again before every run; all prices are on the pricing page.

Licence and source

Florence-2 Large: Vision & Analysis model on Kainguru
Vision & Analysis

Florence-2 Large

One small vision model that captions images, reads text, boxes objects and finds things named by a phrase.

Fine-tunable
BLIP Image Captioning Large: Vision & Analysis model on Kainguru
Vision & Analysis

BLIP Image Captioning Large

Writes a short English caption for a photo, and can finish a caption you start.

Fine-tunable
BLIP VQA Base: Vision & Analysis model on Kainguru
Vision & Analysis

BLIP VQA Base

Answers short questions about a photo, such as what colour the car is or how many people are in it.

Fine-tunable
GLM-OCR: Vision & Analysis model on Kainguru
Vision & Analysis

GLM-OCR

GLM-OCR reads documents in pictures: it writes out the text of a page, tables as HTML and formulas as LaTeX, and can…

Fine-tunable
Moondream 2: Vision & Analysis model on Kainguru
Vision & Analysis

Moondream 2

Moondream 2 is a small vision model: it answers questions about a picture, writes short, normal or long captions and…

Fine-tunable
Qwen3-VL 8B Instruct: Vision & Analysis model on Kainguru
Vision & Analysis

Qwen3-VL 8B Instruct

Qwen3-VL 8B Instruct answers questions about up to four pictures: it describes photos, reads printed and handwritten…

Fine-tunable