ByteDance / Sa2VA-26B

huggingface.co
Total runs: 138
24-hour runs: 5
7-day runs: 48
30-day runs: 63
Model's Last Updated: September 08 2025
image-text-to-text

Introduction of Sa2VA-26B

Model Details of Sa2VA-26B

Sa2VA: Marrying SAM2 with LLaVA for Dense Grounded Understanding of Images and Videos

[📂 GitHub] [📜 Sa2VA paper] [🚀 Quick Start]

Introduction

Sa2VA is an MLLM capable of question answering, visual prompt understanding, and dense object segmentation at both image and video levels. It achieves comparable performance to SOTA MLLMs Qwen2-VL and InternVL2.5 on question-answering benchmarks. Additionally, Sa2VA possesses the visual prompt understanding and dense object segmentation capabilities that SOTA MLLMs Qwen2-VL and InternVL2.5 lack. Sa2VA achieves SOTA performance on both image and video grounding and segmentation benchmarks.

Sa2VA Family

We built the Sa2VA series based on Qwen2-VL and InternVL2/2.5. In the following table, we provide some Sa2VA models built on InternVL2.5. Other Sa2VA models will be open-sourced soon.

Sa2VA Performance
Model Name MME MMBench RefCOCO RefCOCO+ RefCOCOg MeVIS (val_u) DAVIS
Sa2VA-1B 1504/434 71.9 79.6 73.6 77.7 53.4 69.5
Sa2VA-4B 1691/610 81.8 82.4 77.6 79.7 55.9 73.7
Sa2VA-8B 1690/610 84.4 82.6 78.0 80.3 58.9 75.9
Sa2VA-26B 1698/653 85.8 82.9 79.3 81.2 61.8 78.6
Quick Start

We provide an example code to run Sa2VA using transformers .

import torch
from transformers import AutoTokenizer, AutoModel
from PIL import Image
import numpy as np
import os

def get_rank_and_world_size():
    rank = int(os.environ.get('RANK', 0))
    world_size = int(os.environ.get('WORLD_SIZE', 1))
    return rank, world_size

def split_model(model_name):
    import math
    device_map = {}
    num_gpus = torch.cuda.device_count()
    rank, world_size = get_rank_and_world_size()
    num_gpus = num_gpus // world_size

    num_layers = {'Sa2VA-8B': 32, 'Sa2VA-26B': 48,
                  'Sa2VA-38B': 64, 'Sa2VA-78B': 80}[model_name]
    # Since the first GPU will be used for ViT, treat it as 0.8 GPU.
    num_layers_per_gpu = math.ceil(num_layers / (num_gpus - 0.2))
    num_layers_per_gpu = [num_layers_per_gpu] * num_gpus
    num_layers_per_gpu[0] = math.ceil(num_layers_per_gpu[0] * 0.8)
    layer_cnt = 0
    for i, num_layer in enumerate(num_layers_per_gpu):
        for j in range(num_layer):
            device_map[f'language_model.model.layers.{layer_cnt}'] = rank + world_size * i
            layer_cnt += 1
    device_map['vision_model'] = rank
    device_map['mlp1'] = rank
    device_map['language_model.model.tok_embeddings'] = rank
    device_map['language_model.model.embed_tokens'] = rank
    device_map['language_model.output'] = rank
    device_map['language_model.model.norm'] = rank
    device_map['language_model.lm_head'] = rank
    device_map[f'language_model.model.layers.{num_layers - 1}'] = rank
    device_map['grounding_encoder'] = rank
    device_map['text_hidden_fcs'] = rank
    return device_map

# load the model and tokenizer
path = "ByteDance/Sa2VA-26B"
device_map = split_model("Sa2VA-26B")
model = AutoModel.from_pretrained(
    path,
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    use_flash_attn=True,
    trust_remote_code=True,
    device_map=device_map,
).eval()
tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True, use_fast=False)

# for image chat
image_path = "/PATH/TO/IMAGE"
text_prompts = "<image>Please describe the image."
image = Image.open(image_path).convert('RGB')
input_dict = {
    'image': image,
    'text': text_prompts,
    'past_text': '',
    'mask_prompts': None,
    'tokenizer': tokenizer,
    }
return_dict = model.predict_forward(**input_dict)
answer = return_dict["prediction"] # the text format answer

# for image chat with segmentation output
image_path = "/PATH/TO/IMAGE"
text_prompts = "<image>Could you please give me a brief description of the image? Please respond with interleaved segmentation masks for the corresponding parts of the answer."
image = Image.open(image_path).convert('RGB')
input_dict = {
    'image': image,
    'text': text_prompts,
    'past_text': '',
    'mask_prompts': None,
    'tokenizer': tokenizer,
    }
return_dict = model.predict_forward(**input_dict)
answer = return_dict["prediction"] # the text format answer
masks = return_dict['prediction_masks']  # segmentation masks, list(np.array(1, h, w), ...)
    
# for chat with visual prompt (mask format) input
mask_prompts = np.load('/PATH/TO/pred_masks.npy') # np.array(n_prompts, h, w)
image_path = "/PATH/TO/IMAGE"
text_prompts = "<image>Can you provide me with a detailed description of the region in the picture marked by region1."
image = Image.open(image_path).convert('RGB')
input_dict = {
    'image': image,
    'text': text_prompts,
    'past_text': '',
    'mask_prompts': mask_prompts,
    'tokenizer': tokenizer,
    }
return_dict = model.predict_forward(**input_dict)
answer = return_dict["prediction"] # the text format answer

# for video chat
video_folder = "/PATH/TO/VIDEO_FOLDER"
images_paths = os.listdir(video_folder)
images_paths = [os.path.join(video_folder, image_path) for image_name in images_paths]
if len(images_paths) > 5:  # uniformly sample 5 frames
    step = (len(images_paths) - 1) // (5 - 1)
    images_paths = [images_paths[0]] + images_paths[1:-1][::step][1:] + [images_paths[-1]]
text_prompts = "<image>Please describe the video."
input_dict = {
    'video': images_paths,
    'text': text_prompts,
    'past_text': '',
    'mask_prompts': None,
    'tokenizer': tokenizer,
}
return_dict = model.predict_forward(**input_dict)
answer = return_dict["prediction"] # the text format answer


# for video chat with segmentation mask output
video_folder = "/PATH/TO/VIDEO_FOLDER"
images_paths = os.listdir(video_folder)
images_paths = [os.path.join(video_folder, image_path) for image_name in images_paths]
text_prompts = "<image>Please segment the person."
input_dict = {
    'video': images_paths,
    'text': text_prompts,
    'past_text': '',
    'mask_prompts': None,
    'tokenizer': tokenizer,
}
return_dict = model.predict_forward(**input_dict)
answer = return_dict["prediction"] # the text format answer
masks = return_dict['prediction_masks']  # segmentation masks, list(np.array(n_frames, h, w), ...)
Citation

If you find this project useful in your research, please consider citing:

@article{sa2va,
  title={Sa2VA: Marrying SAM2 with LLaVA for Dense Grounded Understanding of Images and Videos},
  author={Yuan, Haobo and Li, Xiangtai and Zhang, Tao and Huang, Zilong Huang and Xu, Shilin and Ji, Shunping and Tong, Yunhai and Qi, Lu and Feng, Jiashi and Yang, Ming-Hsuan},
  journal={arXiv preprint},
  year={2025}
}

Runs of ByteDance Sa2VA-26B on huggingface.co

138
Total runs
5
24-hour runs
24
3-day runs
48
7-day runs
63
30-day runs

More Information About Sa2VA-26B huggingface.co Model

More Sa2VA-26B license Visit here:

https://choosealicense.com/licenses/apache-2.0

Sa2VA-26B huggingface.co

Sa2VA-26B huggingface.co is an AI model on huggingface.co that provides Sa2VA-26B's model effect (), which can be used instantly with this ByteDance Sa2VA-26B model. huggingface.co supports a free trial of the Sa2VA-26B model, and also provides paid use of the Sa2VA-26B. Support call Sa2VA-26B model through api, including Node.js, Python, http.

ByteDance Sa2VA-26B online free

Sa2VA-26B huggingface.co is an online trial and call api platform, which integrates Sa2VA-26B's modeling effects, including api services, and provides a free online trial of Sa2VA-26B, you can try Sa2VA-26B online for free by clicking the link below.

ByteDance Sa2VA-26B online free url in huggingface.co:

https://huggingface.co/ByteDance/Sa2VA-26B

Sa2VA-26B install

Sa2VA-26B is an open source model from GitHub that offers a free installation service, and any user can find Sa2VA-26B on GitHub to install. At the same time, huggingface.co provides the effect of Sa2VA-26B install, users can directly use Sa2VA-26B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Sa2VA-26B install url in huggingface.co:

https://huggingface.co/ByteDance/Sa2VA-26B

Url of Sa2VA-26B

Provider of Sa2VA-26B huggingface.co

ByteDance
ORGANIZATIONS

Other API from ByteDance

huggingface.co

Total runs: 67.0K
Run Growth: 17.9K
Growth Rate: 26.32%
Updated:December 05 2024
huggingface.co

Total runs: 22.8K
Run Growth: 1.5K
Growth Rate: 6.37%
Updated:January 19 2026
huggingface.co

Total runs: 8.5K
Run Growth: 249
Growth Rate: 2.91%
Updated:January 19 2026
huggingface.co

Total runs: 8.1K
Run Growth: 7.9K
Growth Rate: 98.15%
Updated:September 08 2025
huggingface.co

Total runs: 2.5K
Run Growth: 2.0K
Growth Rate: 78.86%
Updated:December 12 2025
huggingface.co

Total runs: 2.4K
Run Growth: 1.2K
Growth Rate: 48.93%
Updated:September 08 2025
huggingface.co

Total runs: 842
Run Growth: 520
Growth Rate: 61.76%
Updated:November 12 2025
huggingface.co

Total runs: 835
Run Growth: 439
Growth Rate: 52.57%
Updated:September 08 2025
huggingface.co

Total runs: 714
Run Growth: -165
Growth Rate: -23.11%
Updated:July 16 2025
huggingface.co

Total runs: 461
Run Growth: -26
Growth Rate: -5.64%
Updated:November 28 2025
huggingface.co

Total runs: 347
Run Growth: -190
Growth Rate: -54.76%
Updated:April 04 2025
huggingface.co

Total runs: 96
Run Growth: -23
Growth Rate: -23.96%
Updated:July 01 2025
huggingface.co

Total runs: 96
Run Growth: -15
Growth Rate: -15.63%
Updated:June 02 2026
huggingface.co

Total runs: 8
Run Growth: -61
Growth Rate: -677.78%
Updated:April 22 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 26 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 11 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 02 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 01 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 27 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 05 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 24 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 13 2026