Image-Text-to-Text
Transformers
Safetensors

Add model card for Sa2va-Instance-4B (Stage 1 of InstanceControl)

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +63 -0
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ pipeline_tag: image-text-to-text
5
+ ---
6
+
7
+ # Sa2va-Instance-4B (Stage 1 of InstanceControl)
8
+
9
+ This repository contains the **Sa2va-Instance-4B** model checkpoint, which serves as the Stage 1 (instance parsing/mask prediction) model of **InstanceControl**, presented in the paper [InstanceControl: Controllable Complex Image Generation without Instance Labeling](https://huggingface.co/papers/2606.31924).
10
+
11
+ * **Project Page:** [InstanceControl Homepage](https://instancecontrol.github.io/InstanceControl/)
12
+ * **Repository:** [GitHub - liuxiaoyu1104/InstanceControl](https://github.com/liuxiaoyu1104/InstanceControl)
13
+ * **Dataset (MIG-Train):** [MIG_train](https://huggingface.co/datasets/xiaoyu1104/MIG_train)
14
+ * **Evaluation Benchmark:** [MIG-Eval](https://huggingface.co/datasets/xiaoyu1104/MIG-Eval)
15
+
16
+ ---
17
+
18
+ ## Model Description
19
+
20
+ InstanceControl is a multi-instance controllable generation method that eliminates the need for manual instance labeling.
21
+
22
+ **Sa2va-Instance-4B** is a Vision-Language Model (VLM) designed to establish instance-level correspondences between text prompts and visual conditions (such as Canny edge maps, depth maps, or HED boundary maps). It automatically parses instance descriptions from the text prompts and predicts instance masks based on the visual conditions. These predicted masks are then dynamically refined during the Stage 2 generation process using a modified FLUX ControlNet.
23
+
24
+ ---
25
+
26
+ ## Installation
27
+
28
+ To set up the environment for running Sa2va-Instance-4B, follow these steps:
29
+
30
+ ```bash
31
+ conda create -n instancecontrol python=3.10
32
+ conda activate instancecontrol
33
+
34
+ pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
35
+ pip install -r requirements.txt
36
+ ```
37
+
38
+ ## Quick Start (Stage 1 Inference)
39
+
40
+ To predict instance masks from your visual conditions and prompt JSON files, place the model checkpoint under `pretrain_model/InstanceControl_canny/Sa2va-Instance-4B` and run:
41
+
42
+ ```bash
43
+ python stage1_Sa2VA/projects/llava_sam2/evaluation/gcg_eval_our_folders.py \
44
+ --model_path ./pretrain_model/InstanceControl_canny/Sa2va-Instance-4B \
45
+ --image_dir ./example/canny \
46
+ --json_dir ./example/json \
47
+ --save_dir ./results/json_pred_canny
48
+ ```
49
+
50
+ For more details on training, dataset formatting, and generating final images using the Stage 2 FLUX ControlNet, please refer to the [GitHub Repository](https://github.com/liuxiaoyu1104/InstanceControl).
51
+
52
+ ## Citation
53
+
54
+ If you find this model or the project useful, please cite:
55
+
56
+ ```bibtex
57
+ @article{instancecontrol,
58
+ title = {InstanceControl: Controllable Complex Image Generation without Instance Labeling},
59
+ author = {Xiaoyu Liu and Huan Wang and Fan Li and Zhixin Wang and Jiaqi Xu and Ming Liu and Wangmeng Zuo},
60
+ journal = {arXiv preprint arXiv:2606.31924},
61
+ year = {2026}
62
+ }
63
+ ```