WhiteYC commited on
Commit
556b2ab
Β·
verified Β·
1 Parent(s): 7737ef2

Initial release

Browse files
HiDream-8B/config.json ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backbone_type": "hidream-o1",
3
+ "resolution": 2048,
4
+ "patch_size": 32,
5
+ "noise_scale": 8.0,
6
+ "downscale": "area",
7
+ "prompt": "Transform to matting map while maintaining original composition",
8
+ "prompt_ids": [
9
+ 151644,
10
+ 872,
11
+ 198,
12
+ 8963,
13
+ 311,
14
+ 5517,
15
+ 1280,
16
+ 2415,
17
+ 1393,
18
+ 20337,
19
+ 4024,
20
+ 18037,
21
+ 151645,
22
+ 198,
23
+ 151644,
24
+ 77091,
25
+ 198,
26
+ 151669,
27
+ 151673
28
+ ],
29
+ "refiner": {
30
+ "channels": 96,
31
+ "dilations": [
32
+ 1,
33
+ 2,
34
+ 4,
35
+ 8,
36
+ 1,
37
+ 2,
38
+ 4,
39
+ 8
40
+ ],
41
+ "sigma": 24.0,
42
+ "amplitude": 0.5
43
+ },
44
+ "backbone": {
45
+ "add_cross_attention": false,
46
+ "architectures": [
47
+ "Qwen3VLForConditionalGeneration"
48
+ ],
49
+ "bad_words_ids": null,
50
+ "begin_suppress_tokens": null,
51
+ "bos_token_id": null,
52
+ "chunk_size_feed_forward": 0,
53
+ "cross_attention_hidden_size": null,
54
+ "decoder_start_token_id": null,
55
+ "diversity_penalty": 0.0,
56
+ "do_sample": false,
57
+ "dtype": "bfloat16",
58
+ "early_stopping": false,
59
+ "encoder_no_repeat_ngram_size": 0,
60
+ "eos_token_id": null,
61
+ "exponential_decay_length_penalty": null,
62
+ "finetuning_task": null,
63
+ "forced_bos_token_id": null,
64
+ "forced_eos_token_id": null,
65
+ "id2label": {
66
+ "0": "LABEL_0",
67
+ "1": "LABEL_1"
68
+ },
69
+ "image_token_id": 151655,
70
+ "is_decoder": false,
71
+ "is_encoder_decoder": false,
72
+ "label2id": {
73
+ "LABEL_0": 0,
74
+ "LABEL_1": 1
75
+ },
76
+ "length_penalty": 1.0,
77
+ "max_length": 20,
78
+ "min_length": 0,
79
+ "model_type": "qwen3_vl",
80
+ "no_repeat_ngram_size": 0,
81
+ "num_beam_groups": 1,
82
+ "num_beams": 1,
83
+ "num_return_sequences": 1,
84
+ "output_attentions": false,
85
+ "output_hidden_states": false,
86
+ "output_scores": false,
87
+ "pad_token_id": null,
88
+ "prefix": null,
89
+ "problem_type": null,
90
+ "pruned_heads": {},
91
+ "remove_invalid_values": false,
92
+ "repetition_penalty": 1.0,
93
+ "return_dict": true,
94
+ "return_dict_in_generate": false,
95
+ "sep_token_id": null,
96
+ "suppress_tokens": null,
97
+ "task_specific_params": null,
98
+ "temperature": 1.0,
99
+ "text_config": {
100
+ "add_cross_attention": false,
101
+ "architectures": null,
102
+ "attention_bias": false,
103
+ "attention_dropout": 0.0,
104
+ "bad_words_ids": null,
105
+ "begin_suppress_tokens": null,
106
+ "bos_token_id": 151643,
107
+ "chunk_size_feed_forward": 0,
108
+ "cross_attention_hidden_size": null,
109
+ "decoder_start_token_id": null,
110
+ "diversity_penalty": 0.0,
111
+ "do_sample": false,
112
+ "dtype": "bfloat16",
113
+ "early_stopping": false,
114
+ "encoder_no_repeat_ngram_size": 0,
115
+ "eos_token_id": 151645,
116
+ "exponential_decay_length_penalty": null,
117
+ "finetuning_task": null,
118
+ "forced_bos_token_id": null,
119
+ "forced_eos_token_id": null,
120
+ "head_dim": 128,
121
+ "hidden_act": "silu",
122
+ "hidden_size": 4096,
123
+ "id2label": {
124
+ "0": "LABEL_0",
125
+ "1": "LABEL_1"
126
+ },
127
+ "initializer_range": 0.02,
128
+ "intermediate_size": 12288,
129
+ "is_decoder": false,
130
+ "is_encoder_decoder": false,
131
+ "label2id": {
132
+ "LABEL_0": 0,
133
+ "LABEL_1": 1
134
+ },
135
+ "length_penalty": 1.0,
136
+ "max_length": 20,
137
+ "max_position_embeddings": 262144,
138
+ "min_length": 0,
139
+ "model_type": "qwen3_vl_text",
140
+ "no_repeat_ngram_size": 0,
141
+ "num_attention_heads": 32,
142
+ "num_beam_groups": 1,
143
+ "num_beams": 1,
144
+ "num_hidden_layers": 36,
145
+ "num_key_value_heads": 8,
146
+ "num_return_sequences": 1,
147
+ "output_attentions": false,
148
+ "output_hidden_states": false,
149
+ "output_scores": false,
150
+ "pad_token_id": null,
151
+ "prefix": null,
152
+ "problem_type": null,
153
+ "pruned_heads": {},
154
+ "remove_invalid_values": false,
155
+ "repetition_penalty": 1.0,
156
+ "return_dict": true,
157
+ "return_dict_in_generate": false,
158
+ "rms_norm_eps": 1e-06,
159
+ "rope_scaling": {
160
+ "mrope_interleaved": true,
161
+ "mrope_section": [
162
+ 24,
163
+ 20,
164
+ 20
165
+ ],
166
+ "rope_type": "default"
167
+ },
168
+ "rope_theta": 5000000,
169
+ "sep_token_id": null,
170
+ "suppress_tokens": null,
171
+ "task_specific_params": null,
172
+ "temperature": 1.0,
173
+ "tf_legacy_loss": false,
174
+ "tie_encoder_decoder": false,
175
+ "tie_word_embeddings": false,
176
+ "tokenizer_class": null,
177
+ "top_k": 50,
178
+ "top_p": 1.0,
179
+ "torchscript": false,
180
+ "typical_p": 1.0,
181
+ "use_bfloat16": false,
182
+ "use_cache": true,
183
+ "vocab_size": 151936
184
+ },
185
+ "tf_legacy_loss": false,
186
+ "tie_encoder_decoder": false,
187
+ "tie_word_embeddings": false,
188
+ "tokenizer_class": null,
189
+ "top_k": 50,
190
+ "top_p": 1.0,
191
+ "torchscript": false,
192
+ "typical_p": 1.0,
193
+ "use_bfloat16": false,
194
+ "video_token_id": 151656,
195
+ "vision_config": {
196
+ "add_cross_attention": false,
197
+ "architectures": null,
198
+ "bad_words_ids": null,
199
+ "begin_suppress_tokens": null,
200
+ "bos_token_id": null,
201
+ "chunk_size_feed_forward": 0,
202
+ "cross_attention_hidden_size": null,
203
+ "decoder_start_token_id": null,
204
+ "deepstack_visual_indexes": [
205
+ 8,
206
+ 16,
207
+ 24
208
+ ],
209
+ "depth": 27,
210
+ "diversity_penalty": 0.0,
211
+ "do_sample": false,
212
+ "dtype": "bfloat16",
213
+ "early_stopping": false,
214
+ "encoder_no_repeat_ngram_size": 0,
215
+ "eos_token_id": null,
216
+ "exponential_decay_length_penalty": null,
217
+ "finetuning_task": null,
218
+ "forced_bos_token_id": null,
219
+ "forced_eos_token_id": null,
220
+ "hidden_act": "gelu_pytorch_tanh",
221
+ "hidden_size": 1152,
222
+ "id2label": {
223
+ "0": "LABEL_0",
224
+ "1": "LABEL_1"
225
+ },
226
+ "in_channels": 3,
227
+ "initializer_range": 0.02,
228
+ "intermediate_size": 4304,
229
+ "is_decoder": false,
230
+ "is_encoder_decoder": false,
231
+ "label2id": {
232
+ "LABEL_0": 0,
233
+ "LABEL_1": 1
234
+ },
235
+ "length_penalty": 1.0,
236
+ "max_length": 20,
237
+ "min_length": 0,
238
+ "model_type": "qwen3_vl",
239
+ "no_repeat_ngram_size": 0,
240
+ "num_beam_groups": 1,
241
+ "num_beams": 1,
242
+ "num_heads": 16,
243
+ "num_position_embeddings": 2304,
244
+ "num_return_sequences": 1,
245
+ "out_hidden_size": 4096,
246
+ "output_attentions": false,
247
+ "output_hidden_states": false,
248
+ "output_scores": false,
249
+ "pad_token_id": null,
250
+ "patch_size": 16,
251
+ "prefix": null,
252
+ "problem_type": null,
253
+ "pruned_heads": {},
254
+ "remove_invalid_values": false,
255
+ "repetition_penalty": 1.0,
256
+ "return_dict": true,
257
+ "return_dict_in_generate": false,
258
+ "sep_token_id": null,
259
+ "spatial_merge_size": 2,
260
+ "suppress_tokens": null,
261
+ "task_specific_params": null,
262
+ "temperature": 1.0,
263
+ "temporal_patch_size": 2,
264
+ "tf_legacy_loss": false,
265
+ "tie_encoder_decoder": false,
266
+ "tie_word_embeddings": true,
267
+ "tokenizer_class": null,
268
+ "top_k": 50,
269
+ "top_p": 1.0,
270
+ "torchscript": false,
271
+ "typical_p": 1.0,
272
+ "use_bfloat16": false
273
+ },
274
+ "vision_end_token_id": 151653,
275
+ "vision_start_token_id": 151652
276
+ }
277
+ }
HiDream-8B/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a579691c8d9060df3bcf94d3a3331d4267978c8f4ad986e0835cf266e5c4846
3
+ size 15218324788
PRX-7B/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backbone_type": "prx",
3
+ "resolution": 1024,
4
+ "patch_size": 16,
5
+ "noise_scale": 2.0,
6
+ "downscale": "bilinear",
7
+ "prompt": "Transform to matting map while maintaining original composition",
8
+ "refiner": {
9
+ "channels": 96,
10
+ "dilations": [
11
+ 1,
12
+ 2,
13
+ 4,
14
+ 8,
15
+ 1,
16
+ 2,
17
+ 4,
18
+ 8
19
+ ],
20
+ "sigma": 24.0,
21
+ "amplitude": 0.5
22
+ },
23
+ "backbone": {
24
+ "in_channels": 3,
25
+ "patch_size": 16,
26
+ "context_in_dim": 2048,
27
+ "hidden_size": 3584,
28
+ "mlp_ratio": 3.5,
29
+ "num_heads": 28,
30
+ "depth": 24,
31
+ "axes_dim": [
32
+ 64,
33
+ 64
34
+ ],
35
+ "theta": 10000,
36
+ "time_factor": 1000.0,
37
+ "time_max_period": 10000,
38
+ "bottleneck_size": 768
39
+ }
40
+ }
PRX-7B/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9bf155f619616f373ec8585d0cf04b6bb804fe01b930ad37f61926e9af604ef1
3
+ size 14012835444
README.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: pytorch
4
+ pipeline_tag: image-segmentation
5
+ tags:
6
+ - image-matting
7
+ - matting
8
+ - alpha-matte
9
+ - diffusion-transformer
10
+ base_model:
11
+ - HiDream-ai/HiDream-O1-Image
12
+ - Photoroom/prxpixel-t2i
13
+ ---
14
+
15
+ # High-Fidelity Image Matting with Pixel-Space Diffusion Transformers
16
+
17
+ [![Page](https://img.shields.io/badge/Project-Page-pink?logo=googlechrome&logoColor=white)](https://white-yc.github.io/pixelmatte/)
18
+ [![Paper](https://img.shields.io/badge/arXiv-Paper-b31b1b?logo=arxiv&logoColor=white)](https://arxiv.org/abs/2611.34929)
19
+ [![GitHub](https://img.shields.io/github/stars/White-YC/pixelmatte?style=default&label=GitHub%20β˜…&logo=github)](https://github.com/White-YC/pixelmatte)
20
+ [![Demo](https://img.shields.io/badge/%F0%9F%A4%97%20HF-Demo-yellow)](https://huggingface.co/spaces/WhiteYC/PixelMatte)
21
+
22
+ PixelMatte predicts an alpha matte from an image and a trimap with a pixel-space diffusion transformer, in a single network
23
+ evaluation and without a VAE. Please visit our [GitHub repository](https://github.com/White-YC/pixelmatte) for how to use these
24
+ models.
25
+
26
+ ## Structure
27
+
28
+ ```
29
+ PixelMatte/
30
+ β”œβ”€β”€ HiDream-8B/ built on HiDream-O1-Image, network input with short side 2048
31
+ β”‚ β”œβ”€β”€ config.json
32
+ β”‚ └── model.safetensors
33
+ └── PRX-7B/ built on PRX, network input with short side 1024
34
+ β”œβ”€β”€ config.json
35
+ └── model.safetensors
36
+ ```
37
+
38
+ Each `model.safetensors` contains the backbone, LayerShift and the High-Pass Refiner, stored in bfloat16. No text encoder or
39
+ VAE is needed.
40
+
41
+ ## Usage
42
+
43
+ ```python
44
+ from PIL import Image
45
+ from pixelmatte import PixelMattePipeline # from the GitHub repository
46
+
47
+ pipe = PixelMattePipeline.from_pretrained("WhiteYC/PixelMatte", subfolder="HiDream-8B") # or subfolder="PRX-7B"
48
+ alpha = pipe(Image.open("photo.jpg"), Image.open("trimap.png")) # float32 array [H, W] in [0, 1]
49
+ ```
50
+
51
+ The trimap is a single-channel image of the same size as the photo: 0 marks background, 255 foreground and any value in
52
+ between (usually 128) the unknown region.
53
+
54
+ ## BibTeX
55
+
56
+ ```bibtex
57
+ @misc{yang2026pixelmatte,
58
+ title = {High-Fidelity Image Matting with Pixel-Space Diffusion Transformers},
59
+ author = {Baihan Yang and Xin Lin and Yufan Wei and Baiang Li and Yuheng Liu and Juanxi Tian and Xiaohui Xie and Truong Nguyen},
60
+ year = {2026},
61
+ eprint = {2611.34929},
62
+ archivePrefix = {arXiv},
63
+ primaryClass = {cs.CV},
64
+ url = {https://arxiv.org/abs/2611.34929}
65
+ }
66
+ ```
67
+
68
+ ## Licence
69
+
70
+ The weights are released under the Apache License 2.0. `HiDream-8B` is fine-tuned from
71
+ [HiDream-O1-Image](https://huggingface.co/HiDream-ai/HiDream-O1-Image) (MIT licence) and `PRX-7B` from
72
+ [PRX](https://huggingface.co/Photoroom/prxpixel-t2i) (Apache License 2.0).