X2SAM: Any Segmentation in Images and Videos
Abstract
Multimodal Large Language Models (MLLMs) have demon-strated strong image-level visual understanding and reasoning, yet theirpixel-level perception across both images and videos remains limited.Foundation segmentation models such as the SAM series produce high-quality masks, but they rely on low-level visual prompts and cannotnatively interpret complex conversational instructions. Existing segmen-tation MLLMs narrow this gap, but are usually specialized for eitherimages or videos and rarely support both textual and visual promptsin one interface. We introduce X2SAM, a unified segmentation MLLMthat extends any-segmentation capabilities from images to videos. Givenconversational instructions and visual prompts, X2SAM couples an LLMwith a Mask Memory module that stores guided vision features for tem-porally consistent video mask generation. The same formulation sup-ports generic, open-vocabulary, referring, reasoning, grounded conversa-tion generation, interactive, and visual grounded segmentation across im-age and video inputs. We further introduce the Video Visual Grounded(V-VGD) segmentation benchmark, which evaluates whether a modelcan segment object tracks in videos from interactive visual prompts.With a unified joint training strategy over heterogeneous image and videodatasets, X2SAM delivers strong video segmentation performance, re-mains competitive on image segmentation benchmarks, and preservesgeneral image and video chat ability. Code is available at https://github.com/wanghao9610/X2SAM.