Astropulse commited on
Commit
5424fc5
·
verified ·
1 Parent(s): 83bcd7a

Bundle the prompt reader (Qwen3-VL-4B-Instruct layers 0-26, Apache 2.0) in text_encoder/; fix the gallery and size table

Browse files
README.md CHANGED
@@ -29,13 +29,21 @@ each pixel from a palette that it generates along with the image. The result is
29
  deliberate, colours are limited (about 37 per image on average), and sprites have real transparency.
30
 
31
  <Gallery>
 
32
  ![A red health potion, transparent sprite](samples/red-potion.png)
 
33
  ![A green slime, transparent sprite](samples/slime.png)
 
34
  ![A nine-tailed fox, transparent sprite](samples/kitsune.png)
 
35
  ![A mushroom house, transparent sprite](samples/mushroom-house.png)
 
36
  ![A tavern interior, full-frame scene](samples/tavern.png)
 
37
  ![A snowy village under the northern lights, full-frame scene](samples/snowy-village.png)
 
38
  ![An autumn forest path, full-frame scene](samples/autumn-forest.png)
 
39
  </Gallery>
40
 
41
  ## Demo
@@ -45,13 +53,18 @@ Try RD Flow 64 directly in your browser, free and with no account:
45
 
46
  ## Small on purpose
47
 
48
- | | Parameters | vs RD Flow 64 |
 
 
49
  | --- | --- | --- |
50
- | **RD Flow 64** | **0.27B** (542 MB file) | |
51
- | Stable Diffusion 1.5 | 0.86B | 3x larger |
52
- | SDXL | 2.6B | 10x larger |
53
- | FLUX.1 | 12B | 44x larger |
54
- | Qwen-Image | 20B | 74x larger |
 
 
 
55
 
56
  The drawing model fits on a 2 GB GPU, and the whole pipeline runs on an ordinary laptop's CPU.
57
  An RTX 4090 draws 4 images in 0.7 s. A PC whose GPU has only 2 GB draws them in under a second, with the prompt
@@ -96,7 +109,7 @@ and a system prompt that turns a short idea into a full caption with any LLM.
96
  | --- | --- |
97
  | Output | 64 x 64 RGBA, with an exact palette (pixels point to palette entries) and binary transparency |
98
  | Drawing model | 270.9M parameters, hourglass flow transformer, fp16 weights (542 MB); runs in bf16 or fp32 |
99
- | Prompt reader | first 27 of 36 layers of [Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct), frozen, 3.1B parameters (Apache 2.0, downloaded from Qwen's repository) |
100
  | Sampling | flow matching, 16 Euler steps, classifier-free guidance 4 |
101
  | Training data | 525,430 whole 64 x 64 images: 67% generated by Retro Diffusion's own models, 33% hand-made pixel art and illustrations reduced to 64 x 64; every image captioned in detail by a vision model |
102
 
@@ -117,6 +130,7 @@ same caption cost only the drawing.
117
  | --- | --- |
118
  | `rd-flow-64.safetensors` | the drawing model, fp16, 270.9M parameters |
119
  | `config.json` | architecture, sampler defaults and the prompt reader's pinned revision |
 
120
  | `samples/` | the images on this page |
121
 
122
  ## How it works
@@ -161,6 +175,7 @@ through the API.
161
 
162
  ## License
163
 
164
- The weights are licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/): free for
165
- non-commercial use with attribution to Retro Diffusion. For commercial use, generate with
 
166
  [Retro Diffusion](https://retrodiffusion.ai). The inference code on GitHub is MIT licensed.
 
29
  deliberate, colours are limited (about 37 per image on average), and sprites have real transparency.
30
 
31
  <Gallery>
32
+
33
  ![A red health potion, transparent sprite](samples/red-potion.png)
34
+
35
  ![A green slime, transparent sprite](samples/slime.png)
36
+
37
  ![A nine-tailed fox, transparent sprite](samples/kitsune.png)
38
+
39
  ![A mushroom house, transparent sprite](samples/mushroom-house.png)
40
+
41
  ![A tavern interior, full-frame scene](samples/tavern.png)
42
+
43
  ![A snowy village under the northern lights, full-frame scene](samples/snowy-village.png)
44
+
45
  ![An autumn forest path, full-frame scene](samples/autumn-forest.png)
46
+
47
  </Gallery>
48
 
49
  ## Demo
 
53
 
54
  ## Small on purpose
55
 
56
+ How many parameters each image model has, and how many times bigger it is than RD Flow 64:
57
+
58
+ | Image model | Parameters | Size compared with RD Flow 64 |
59
  | --- | --- | --- |
60
+ | **RD Flow 64** | **0.27B** (a 542 MB file) | 1x |
61
+ | Stable Diffusion 1.5 | 0.86B | 3x bigger |
62
+ | SDXL | 2.6B | 10x bigger |
63
+ | FLUX.1 | 12B | 44x bigger |
64
+ | Qwen-Image | 20B | 74x bigger |
65
+
66
+ These are the image models alone. Each also reads your prompt with a separate text model; RD Flow 64's is a 3.1B
67
+ cut of Qwen3-VL-4B, included in this repo.
68
 
69
  The drawing model fits on a 2 GB GPU, and the whole pipeline runs on an ordinary laptop's CPU.
70
  An RTX 4090 draws 4 images in 0.7 s. A PC whose GPU has only 2 GB draws them in under a second, with the prompt
 
109
  | --- | --- |
110
  | Output | 64 x 64 RGBA, with an exact palette (pixels point to palette entries) and binary transparency |
111
  | Drawing model | 270.9M parameters, hourglass flow transformer, fp16 weights (542 MB); runs in bf16 or fp32 |
112
+ | Prompt reader | the embeddings, first 27 of 36 decoder layers and final norm of [Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct), frozen and unchanged, 3.1B parameters, bf16 (6.2 GB); included in `text_encoder/` under Apache 2.0 |
113
  | Sampling | flow matching, 16 Euler steps, classifier-free guidance 4 |
114
  | Training data | 525,430 whole 64 x 64 images: 67% generated by Retro Diffusion's own models, 33% hand-made pixel art and illustrations reduced to 64 x 64; every image captioned in detail by a vision model |
115
 
 
130
  | --- | --- |
131
  | `rd-flow-64.safetensors` | the drawing model, fp16, 270.9M parameters |
132
  | `config.json` | architecture, sampler defaults and the prompt reader's pinned revision |
133
+ | `text_encoder/` | the prompt reader: `model.safetensors` (6.2 GB), Qwen's config and tokenizer, its Apache 2.0 `LICENSE` and a `NOTICE` saying what was kept |
134
  | `samples/` | the images on this page |
135
 
136
  ## How it works
 
175
 
176
  ## License
177
 
178
+ The RD Flow 64 weights are licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/): free for
179
+ non-commercial use with attribution to Retro Diffusion. The prompt reader in `text_encoder/` is part of Qwen3-VL-4B-Instruct
180
+ by the Qwen team and stays under the Apache 2.0 license. For commercial use, generate with
181
  [Retro Diffusion](https://retrodiffusion.ai). The inference code on GitHub is MIT licensed.
config.json CHANGED
@@ -1,51 +1,53 @@
1
- {
2
- "model": "RD Flow 64",
3
- "architecture": "pixflow hourglass flow transformer, palette-pointer head",
4
- "library": "rdflow (https://github.com/Retro-Diffusion/rd-flow-64)",
5
- "parameters": 270932357,
6
- "resolution": 64,
7
- "dtype": "float16",
8
- "text_encoder": {
9
- "repo": "Qwen/Qwen3-VL-4B-Instruct",
10
- "revision": "ebb281ec70b05090aa6165b016eac8ec08e71b17",
11
- "layers": 27,
12
- "max_tokens": 512
13
- },
14
- "sampler": {
15
- "steps": 16,
16
- "guidance": 4.0,
17
- "guidance_interval": [
18
- 0.0,
19
- 0.9
20
- ],
21
- "shift": 3.0
22
- },
23
- "config": {
24
- "size": 64,
25
- "d0": 128,
26
- "d1": 256,
27
- "d2": 512,
28
- "dc": 1024,
29
- "head_dim": 64,
30
- "depth0": 2,
31
- "depth1": 2,
32
- "depth2": 2,
33
- "depth_core": 16,
34
- "window": 8,
35
- "mlp_ratio": 3.0,
36
- "text_dim": 2560,
37
- "n_registers": 4,
38
- "n_styles": 512,
39
- "n_sources": 16,
40
- "dk": 128,
41
- "colour_freqs": 8,
42
- "colour_hidden": 256,
43
- "rope_theta": 100.0,
44
- "core_level": 2,
45
- "palette_tokens": true,
46
- "attrs": true,
47
- "text_adapter": 2,
48
- "self_cond": true,
49
- "bg_mode": true
50
- }
51
- }
 
 
 
1
+ {
2
+ "model": "RD Flow 64",
3
+ "architecture": "pixflow hourglass flow transformer, palette-pointer head",
4
+ "library": "rdflow (https://github.com/Retro-Diffusion/rd-flow-64)",
5
+ "parameters": 270932357,
6
+ "resolution": 64,
7
+ "dtype": "float16",
8
+ "text_encoder": {
9
+ "subfolder": "text_encoder",
10
+ "source": "Qwen/Qwen3-VL-4B-Instruct",
11
+ "source_revision": "ebb281ec70b05090aa6165b016eac8ec08e71b17",
12
+ "layers": 27,
13
+ "max_tokens": 512,
14
+ "license": "apache-2.0"
15
+ },
16
+ "sampler": {
17
+ "steps": 16,
18
+ "guidance": 4.0,
19
+ "guidance_interval": [
20
+ 0.0,
21
+ 0.9
22
+ ],
23
+ "shift": 3.0
24
+ },
25
+ "config": {
26
+ "size": 64,
27
+ "d0": 128,
28
+ "d1": 256,
29
+ "d2": 512,
30
+ "dc": 1024,
31
+ "head_dim": 64,
32
+ "depth0": 2,
33
+ "depth1": 2,
34
+ "depth2": 2,
35
+ "depth_core": 16,
36
+ "window": 8,
37
+ "mlp_ratio": 3.0,
38
+ "text_dim": 2560,
39
+ "n_registers": 4,
40
+ "n_styles": 512,
41
+ "n_sources": 16,
42
+ "dk": 128,
43
+ "colour_freqs": 8,
44
+ "colour_hidden": 256,
45
+ "rope_theta": 100.0,
46
+ "core_level": 2,
47
+ "palette_tokens": true,
48
+ "attrs": true,
49
+ "text_adapter": 2,
50
+ "self_cond": true,
51
+ "bg_mode": true
52
+ }
53
+ }
text_encoder/LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
text_encoder/NOTICE ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ This folder contains part of Qwen3-VL-4B-Instruct by the Qwen team, Alibaba Cloud
2
+ (https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct, revision ebb281ec70b05090aa6165b016eac8ec08e71b17), licensed under the Apache License 2.0 (see LICENSE).
3
+
4
+ Modifications: only the weights RD Flow 64 uses were kept, unchanged: the token embeddings, decoder layers 0-26 of 36 and
5
+ the final norm. The vision tower, decoder layers 27-35 and the output head were removed, and the tensor names had their
6
+ "model.language_model." prefix dropped. config.json, the tokenizer files and generation_config.json are Qwen's own,
7
+ unchanged; RD Flow 64's loader builds the text model from config.json with 27 layers.
text_encoder/config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3VLForConditionalGeneration"
4
+ ],
5
+ "image_token_id": 151655,
6
+ "model_type": "qwen3_vl",
7
+ "text_config": {
8
+ "attention_bias": false,
9
+ "attention_dropout": 0.0,
10
+ "bos_token_id": 151643,
11
+ "dtype": "bfloat16",
12
+ "eos_token_id": 151645,
13
+ "head_dim": 128,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 2560,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 9728,
18
+ "max_position_embeddings": 262144,
19
+ "model_type": "qwen3_vl_text",
20
+ "num_attention_heads": 32,
21
+ "num_hidden_layers": 36,
22
+ "num_key_value_heads": 8,
23
+ "rms_norm_eps": 1e-06,
24
+ "rope_scaling": {
25
+ "mrope_interleaved": true,
26
+ "mrope_section": [
27
+ 24,
28
+ 20,
29
+ 20
30
+ ],
31
+ "rope_type": "default"
32
+ },
33
+ "rope_theta": 5000000,
34
+ "tie_word_embeddings": true,
35
+ "use_cache": true,
36
+ "vocab_size": 151936
37
+ },
38
+ "tie_word_embeddings": true,
39
+ "transformers_version": "4.57.0.dev0",
40
+ "video_token_id": 151656,
41
+ "vision_config": {
42
+ "deepstack_visual_indexes": [
43
+ 5,
44
+ 11,
45
+ 17
46
+ ],
47
+ "depth": 24,
48
+ "hidden_act": "gelu_pytorch_tanh",
49
+ "hidden_size": 1024,
50
+ "in_channels": 3,
51
+ "initializer_range": 0.02,
52
+ "intermediate_size": 4096,
53
+ "model_type": "qwen3_vl",
54
+ "num_heads": 16,
55
+ "num_position_embeddings": 2304,
56
+ "out_hidden_size": 2560,
57
+ "patch_size": 16,
58
+ "spatial_merge_size": 2,
59
+ "temporal_patch_size": 2
60
+ },
61
+ "vision_end_token_id": 151653,
62
+ "vision_start_token_id": 151652
63
+ }
text_encoder/generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "pad_token_id": 151643,
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 151645,
7
+ 151643
8
+ ],
9
+ "top_k": 20,
10
+ "top_p": 0.8,
11
+ "repetition_penalty": 1.0,
12
+ "temperature": 0.7,
13
+ "transformers_version": "4.56.0"
14
+ }
text_encoder/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
text_encoder/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0fa2131fe8ce16b19e2f8a1f5e17d88b07e5f458dabb22c2f725605eb299e2d2
3
+ size 6228214272
text_encoder/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
text_encoder/tokenizer_config.json ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ }
213
+ },
214
+ "additional_special_tokens": [
215
+ "<|im_start|>",
216
+ "<|im_end|>",
217
+ "<|object_ref_start|>",
218
+ "<|object_ref_end|>",
219
+ "<|box_start|>",
220
+ "<|box_end|>",
221
+ "<|quad_start|>",
222
+ "<|quad_end|>",
223
+ "<|vision_start|>",
224
+ "<|vision_end|>",
225
+ "<|vision_pad|>",
226
+ "<|image_pad|>",
227
+ "<|video_pad|>"
228
+ ],
229
+ "bos_token": null,
230
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- for message in messages %}\n {%- if message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content_item in message.content %}\n {%- if 'text' in content_item %}\n {{- content_item.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and message.content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
231
+ "clean_up_tokenization_spaces": false,
232
+ "eos_token": "<|im_end|>",
233
+ "errors": "replace",
234
+ "model_max_length": 262144,
235
+ "pad_token": "<|endoftext|>",
236
+ "split_special_tokens": false,
237
+ "tokenizer_class": "Qwen2Tokenizer",
238
+ "unk_token": null
239
+ }
text_encoder/vocab.json ADDED
The diff for this file is too large to render. See raw diff