weizhiwang TencentOpen commited on
Commit
dea9480
·
0 Parent(s):

Initial commit

Browse files

Co-authored-by: TencentOpen <TencentOpen@users.noreply.huggingface.co>

Files changed (46) hide show
  1. .gitattributes +38 -0
  2. DiT/base_ar/diffusion_pytorch_model_fp32.safetensors +3 -0
  3. DiT/distilled/diffusion_pytorch_model_ema_0_995.safetensors +3 -0
  4. DiT/distilled_int8/diffusion_pytorch_model_ema_0_995_int8.safetensors +3 -0
  5. DiT/lora_weights/cinematic/adapter.safetensors +3 -0
  6. DiT/lora_weights/cinematic/adapter_config.json +25 -0
  7. DiT/lora_weights/dual_arm_robotics/adapter.safetensors +3 -0
  8. DiT/lora_weights/dual_arm_robotics/adapter_config.json +25 -0
  9. LICENSE +201 -0
  10. PE/chat_template.jinja +170 -0
  11. PE/config.json +141 -0
  12. PE/generation_config.json +14 -0
  13. PE/model-00001-of-00018.safetensors +3 -0
  14. PE/model-00002-of-00018.safetensors +3 -0
  15. PE/model-00003-of-00018.safetensors +3 -0
  16. PE/model-00004-of-00018.safetensors +3 -0
  17. PE/model-00005-of-00018.safetensors +3 -0
  18. PE/model-00006-of-00018.safetensors +3 -0
  19. PE/model-00007-of-00018.safetensors +3 -0
  20. PE/model-00008-of-00018.safetensors +3 -0
  21. PE/model-00009-of-00018.safetensors +3 -0
  22. PE/model-00010-of-00018.safetensors +3 -0
  23. PE/model-00011-of-00018.safetensors +3 -0
  24. PE/model-00012-of-00018.safetensors +3 -0
  25. PE/model-00013-of-00018.safetensors +3 -0
  26. PE/model-00014-of-00018.safetensors +3 -0
  27. PE/model-00015-of-00018.safetensors +3 -0
  28. PE/model-00016-of-00018.safetensors +3 -0
  29. PE/model-00017-of-00018.safetensors +3 -0
  30. PE/model-00018-of-00018.safetensors +3 -0
  31. PE/model.safetensors.index.json +0 -0
  32. PE/preprocessor_config.json +27 -0
  33. PE/processor_config.json +63 -0
  34. PE/tokenizer.json +3 -0
  35. PE/tokenizer_config.json +32 -0
  36. PE/video_preprocessor_config.json +21 -0
  37. README.md +288 -0
  38. README_CN.md +288 -0
  39. VAE/DCAE-V/dc-ae-v-1.0-f32t4c32-bf16.pt +3 -0
  40. VAE/PixelUMM_FT/diffusion_pytorch_model.safetensors +3 -0
  41. VAE/PixelUMM_FT_FP8/diffusion_pytorch_model_fp8.safetensors +3 -0
  42. assets/logo-en.png +0 -0
  43. assets/logo-zh.png +0 -0
  44. assets/method_framework_h.png +3 -0
  45. assets/method_framework_h_cn.png +3 -0
  46. examples/prompts.json +32 -0
.gitattributes ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ PE/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ assets/method_framework_h.png filter=lfs diff=lfs merge=lfs -text
38
+ assets/method_framework_h_cn.png filter=lfs diff=lfs merge=lfs -text
DiT/base_ar/diffusion_pytorch_model_fp32.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aca12a37bd1e829a45491b9b7b13ee7ca8c202ebe99954f7a2dee417a7f0132e
3
+ size 34213991280
DiT/distilled/diffusion_pytorch_model_ema_0_995.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73819bcf3b82b090116dd1a1748795de95eef703c304e7443963d00ea8aa4d70
3
+ size 34213991280
DiT/distilled_int8/diffusion_pytorch_model_ema_0_995_int8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:973fa409f3b009232db3c83feddc89c5326fc3a5672feb791f0989ea8bf83252
3
+ size 9059126120
DiT/lora_weights/cinematic/adapter.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:765426a6c417eed70a57d72f67cfe002076cfc92b6b35fe185091012ba80c7c2
3
+ size 6122591632
DiT/lora_weights/cinematic/adapter_config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format_version": 1,
3
+ "rank": 256,
4
+ "alpha": 512.0,
5
+ "dropout": 0.0,
6
+ "targets": [
7
+ "double_blocks.*.img_attn_q",
8
+ "double_blocks.*.img_attn_k",
9
+ "double_blocks.*.img_attn_v",
10
+ "double_blocks.*.img_attn_proj",
11
+ "double_blocks.*.txt_attn_q",
12
+ "double_blocks.*.txt_attn_k",
13
+ "double_blocks.*.txt_attn_v",
14
+ "double_blocks.*.txt_attn_proj",
15
+ "double_blocks.*.img_mlp.fc1",
16
+ "double_blocks.*.img_mlp.fc2",
17
+ "double_blocks.*.txt_mlp.fc1",
18
+ "double_blocks.*.txt_mlp.fc2",
19
+ "double_blocks.*.img_mod.linear",
20
+ "double_blocks.*.txt_mod.linear",
21
+ "action_modules.*.img_attn_q",
22
+ "action_modules.*.keyboard_attn_kv",
23
+ "action_modules.*.proj_keyboard"
24
+ ]
25
+ }
DiT/lora_weights/dual_arm_robotics/adapter.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c96a8cefbf93ecd563fe34497f9aaeb3d353cf81773802663c22ddc47ed909d2
3
+ size 12244965688
DiT/lora_weights/dual_arm_robotics/adapter_config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format_version": 1,
3
+ "rank": 512,
4
+ "alpha": 512.0,
5
+ "dropout": 0.0,
6
+ "targets": [
7
+ "double_blocks.*.img_attn_q",
8
+ "double_blocks.*.img_attn_k",
9
+ "double_blocks.*.img_attn_v",
10
+ "double_blocks.*.img_attn_proj",
11
+ "double_blocks.*.txt_attn_q",
12
+ "double_blocks.*.txt_attn_k",
13
+ "double_blocks.*.txt_attn_v",
14
+ "double_blocks.*.txt_attn_proj",
15
+ "double_blocks.*.img_mlp.fc1",
16
+ "double_blocks.*.img_mlp.fc2",
17
+ "double_blocks.*.txt_mlp.fc1",
18
+ "double_blocks.*.txt_mlp.fc2",
19
+ "double_blocks.*.img_mod.linear",
20
+ "double_blocks.*.txt_mod.linear",
21
+ "action_modules.*.img_attn_q",
22
+ "action_modules.*.keyboard_attn_kv",
23
+ "action_modules.*.proj_keyboard"
24
+ ]
25
+ }
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.
PE/chat_template.jinja ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- set reasoning_instructions = '' %}
46
+ {%- if enable_thinking is undefined or enable_thinking is true %}
47
+ {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
48
+ {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
49
+ {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
50
+ {%- endif %}
51
+ {%- if resolved_reasoning_effort == 'xhigh' %}
52
+ {%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
53
+ {%- elif resolved_reasoning_effort == 'low' %}
54
+ {%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
55
+ {%- endif %}
56
+ {%- endif %}
57
+ {%- if tools and tools is iterable and tools is not mapping %}
58
+ {{- '<|im_start|>system\n' }}
59
+ {%- if reasoning_instructions %}
60
+ {{- reasoning_instructions + '\n\n' }}
61
+ {%- endif %}
62
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
63
+ {%- for tool in tools %}
64
+ {{- "\n" }}
65
+ {{- tool | tojson }}
66
+ {%- endfor %}
67
+ {{- "\n</tools>" }}
68
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
69
+ {%- if messages[0].role == 'system' %}
70
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
71
+ {%- if content %}
72
+ {{- '\n\n' + content }}
73
+ {%- endif %}
74
+ {%- endif %}
75
+ {{- '<|im_end|>\n' }}
76
+ {%- else %}
77
+ {%- if messages[0].role == 'system' %}
78
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
79
+ {%- if content %}
80
+ {{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
81
+ {%- elif reasoning_instructions %}
82
+ {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
83
+ {%- endif %}
84
+ {%- elif reasoning_instructions %}
85
+ {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
86
+ {%- endif %}
87
+ {%- endif %}
88
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
89
+ {%- for message in messages[::-1] %}
90
+ {%- set index = (messages|length - 1) - loop.index0 %}
91
+ {%- if ns.multi_step_tool and message.role == "user" %}
92
+ {%- set content = render_content(message.content, false)|trim %}
93
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
94
+ {%- set ns.multi_step_tool = false %}
95
+ {%- set ns.last_query_index = index %}
96
+ {%- endif %}
97
+ {%- endif %}
98
+ {%- endfor %}
99
+ {%- if ns.multi_step_tool %}
100
+ {{- raise_exception('No user query found in messages.') }}
101
+ {%- endif %}
102
+ {%- for message in messages %}
103
+ {%- set content = render_content(message.content, true)|trim %}
104
+ {%- if message.role == "system" %}
105
+ {%- if not loop.first %}
106
+ {{- raise_exception('System message must be at the beginning.') }}
107
+ {%- endif %}
108
+ {%- elif message.role == "user" %}
109
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
110
+ {%- elif message.role == "assistant" %}
111
+ {%- set reasoning_content = '' %}
112
+ {%- if message.reasoning_content is string %}
113
+ {%- set reasoning_content = message.reasoning_content %}
114
+ {%- endif %}
115
+ {%- set reasoning_content = reasoning_content|trim %}
116
+ {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
117
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
118
+ {%- else %}
119
+ {{- '<|im_start|>' + message.role + '\n' + content }}
120
+ {%- endif %}
121
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
122
+ {%- for tool_call in message.tool_calls %}
123
+ {%- if tool_call.function is defined %}
124
+ {%- set tool_call = tool_call.function %}
125
+ {%- endif %}
126
+ {%- if loop.first %}
127
+ {%- if content|trim %}
128
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
129
+ {%- else %}
130
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
131
+ {%- endif %}
132
+ {%- else %}
133
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
134
+ {%- endif %}
135
+ {%- if tool_call.arguments is defined and tool_call.arguments != '' %}
136
+ {%- for args_name, args_value in tool_call.arguments|items %}
137
+ {{- '<parameter=' + args_name + '>\n' }}
138
+ {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
139
+ {{- args_value }}
140
+ {{- '\n</parameter>\n' }}
141
+ {%- endfor %}
142
+ {%- endif %}
143
+ {{- '</function>\n</tool_call>' }}
144
+ {%- endfor %}
145
+ {%- endif %}
146
+ {{- '<|im_end|>\n' }}
147
+ {%- elif message.role == "tool" %}
148
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
149
+ {{- '<|im_start|>user' }}
150
+ {%- endif %}
151
+ {{- '\n<tool_response>\n' }}
152
+ {{- content }}
153
+ {{- '\n</tool_response>' }}
154
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
155
+ {{- '<|im_end|>\n' }}
156
+ {%- elif loop.last %}
157
+ {{- '<|im_end|>\n' }}
158
+ {%- endif %}
159
+ {%- else %}
160
+ {{- raise_exception('Unexpected message role.') }}
161
+ {%- endif %}
162
+ {%- endfor %}
163
+ {%- if add_generation_prompt %}
164
+ {{- '<|im_start|>assistant\n' }}
165
+ {%- if enable_thinking is defined and enable_thinking is false %}
166
+ {{- '<think>\n\n</think>\n\n' }}
167
+ {%- else %}
168
+ {{- '<think>\n' }}
169
+ {%- endif %}
170
+ {%- endif %}
PE/config.json ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5ForConditionalGeneration"
4
+ ],
5
+ "image_token_id": 248056,
6
+ "language_model_only": false,
7
+ "model_type": "qwen3_5",
8
+ "text_config": {
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "attn_output_gate": true,
12
+ "bos_token_id": 248044,
13
+ "dtype": "bfloat16",
14
+ "eos_token_id": 248044,
15
+ "full_attention_interval": 4,
16
+ "head_dim": 256,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 5120,
19
+ "initializer_range": 0.02,
20
+ "intermediate_size": 17408,
21
+ "layer_types": [
22
+ "linear_attention",
23
+ "linear_attention",
24
+ "linear_attention",
25
+ "full_attention",
26
+ "linear_attention",
27
+ "linear_attention",
28
+ "linear_attention",
29
+ "full_attention",
30
+ "linear_attention",
31
+ "linear_attention",
32
+ "linear_attention",
33
+ "full_attention",
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "linear_attention",
37
+ "full_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "linear_attention",
41
+ "full_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "linear_attention",
45
+ "full_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "linear_attention",
49
+ "full_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "linear_attention",
53
+ "full_attention",
54
+ "linear_attention",
55
+ "linear_attention",
56
+ "linear_attention",
57
+ "full_attention",
58
+ "linear_attention",
59
+ "linear_attention",
60
+ "linear_attention",
61
+ "full_attention",
62
+ "linear_attention",
63
+ "linear_attention",
64
+ "linear_attention",
65
+ "full_attention",
66
+ "linear_attention",
67
+ "linear_attention",
68
+ "linear_attention",
69
+ "full_attention",
70
+ "linear_attention",
71
+ "linear_attention",
72
+ "linear_attention",
73
+ "full_attention",
74
+ "linear_attention",
75
+ "linear_attention",
76
+ "linear_attention",
77
+ "full_attention",
78
+ "linear_attention",
79
+ "linear_attention",
80
+ "linear_attention",
81
+ "full_attention",
82
+ "linear_attention",
83
+ "linear_attention",
84
+ "linear_attention",
85
+ "full_attention"
86
+ ],
87
+ "linear_conv_kernel_dim": 4,
88
+ "linear_key_head_dim": 128,
89
+ "linear_num_key_heads": 16,
90
+ "linear_num_value_heads": 48,
91
+ "linear_value_head_dim": 128,
92
+ "mamba_ssm_dtype": "float32",
93
+ "max_position_embeddings": 262144,
94
+ "model_type": "qwen3_5_text",
95
+ "mtp_num_hidden_layers": 1,
96
+ "mtp_use_dedicated_embeddings": false,
97
+ "num_attention_heads": 24,
98
+ "num_hidden_layers": 64,
99
+ "num_key_value_heads": 4,
100
+ "output_gate_type": "swish",
101
+ "pad_token_id": null,
102
+ "partial_rotary_factor": 0.25,
103
+ "rms_norm_eps": 1e-06,
104
+ "rope_parameters": {
105
+ "mrope_interleaved": true,
106
+ "mrope_section": [
107
+ 11,
108
+ 11,
109
+ 10
110
+ ],
111
+ "partial_rotary_factor": 0.25,
112
+ "rope_theta": 10000000,
113
+ "rope_type": "default"
114
+ },
115
+ "tie_word_embeddings": false,
116
+ "use_cache": true,
117
+ "vocab_size": 248320
118
+ },
119
+ "tie_word_embeddings": false,
120
+ "transformers_version": "5.2.0",
121
+ "video_token_id": 248057,
122
+ "vision_config": {
123
+ "deepstack_visual_indexes": [],
124
+ "depth": 27,
125
+ "dtype": "bfloat16",
126
+ "hidden_act": "gelu_pytorch_tanh",
127
+ "hidden_size": 1152,
128
+ "in_channels": 3,
129
+ "initializer_range": 0.02,
130
+ "intermediate_size": 4304,
131
+ "model_type": "qwen3_5",
132
+ "num_heads": 16,
133
+ "num_position_embeddings": 2304,
134
+ "out_hidden_size": 5120,
135
+ "patch_size": 16,
136
+ "spatial_merge_size": 2,
137
+ "temporal_patch_size": 2
138
+ },
139
+ "vision_end_token_id": 248054,
140
+ "vision_start_token_id": 248053
141
+ }
PE/generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 248044,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 248046,
6
+ 248044
7
+ ],
8
+ "pad_token_id": 248044,
9
+ "temperature": 1.0,
10
+ "top_k": 20,
11
+ "top_p": 0.95,
12
+ "transformers_version": "5.2.0",
13
+ "trust_remote_code": true
14
+ }
PE/model-00001-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21378cddb8af1e4762b49ee854f7feb7313af587c11000aabff74c80a83357ef
3
+ size 3966730520
PE/model-00002-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5507c88114438c3db3183000ba1ff89a54a67a5c386a77a9c08e3790834b6c24
3
+ size 3043080296
PE/model-00003-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfb4d95041d0f45bd10c3842a83261417580224dd183585d14c7140d1ddae8a6
3
+ size 2542796928
PE/model-00004-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e5c5b4671ed0ef1ab5258a044053af20f986eb1b840bd1ddf75d04488233f67
3
+ size 3988973120
PE/model-00005-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbf710e0943b267d5ca7a5e50113d148b25780ddf340f08e7bbe2efb30013c47
3
+ size 2099339832
PE/model-00006-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50328e5d8f742e8744c31315122bd70d1f5504881e24b4a243ace8d73860fb46
3
+ size 3979553664
PE/model-00007-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d7b4ad46aeffc72028cb21a6703f69a10cadf7c4900c27f353116113fbab25a
3
+ size 2108759312
PE/model-00008-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:711ac5079086c3bc02ef346413f532f02ae9b94097ff1acd38283a85049249b2
3
+ size 3979553664
PE/model-00009-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcb1196f840dd1ac1ef2b0996244e0a720878f8b0ff026ed0f80ff9e3a41f12c
3
+ size 2108759312
PE/model-00010-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e29fff61699cc0d4203622692f602e4dd9cd679a5b3f4b8e0d16d9ab2300117
3
+ size 3979553664
PE/model-00011-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f8bb69f6a54060ff54715df425112b12b470cac6cfbd6b6445664755bccee48
3
+ size 2108759312
PE/model-00012-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:168605230ef0ad1fcca51902ac7ab222f33f1980af30adbf37deeceb099fd204
3
+ size 3979553664
PE/model-00013-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:faf02b649a7e64a08c3c7310a819ec85c5a000959840d05cc312826d77f3ee6d
3
+ size 2108759312
PE/model-00014-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f73e2191c0a1849f023823f62c85fec7c0236b1bd8cf49fada3bfffb4376557
3
+ size 3979553664
PE/model-00015-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb1fb4e1e00ee33c896ad427be4dcd42075d2b6982e8c631b119a2ceb107e5ea
3
+ size 2108759312
PE/model-00016-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0fe0742ee6faba0fd73ecaf58483840250c894196660a121a3bc9f93a63be549
3
+ size 3979564008
PE/model-00017-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7838bd2919c05a0f8afabba1a7b0509f5a69b2b5115594e1cc2a19aa4fac4e9f
3
+ size 2108759312
PE/model-00018-of-00018.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36e15aa729908346909ee6e92fc44618f19c8a19512f9b0400da99bfaa9397de
3
+ size 3392197320
PE/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
PE/preprocessor_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_format": "channels_first",
3
+ "do_convert_rgb": true,
4
+ "do_normalize": true,
5
+ "do_rescale": true,
6
+ "do_resize": true,
7
+ "image_mean": [
8
+ 0.5,
9
+ 0.5,
10
+ 0.5
11
+ ],
12
+ "image_processor_type": "Qwen2VLImageProcessorFast",
13
+ "image_std": [
14
+ 0.5,
15
+ 0.5,
16
+ 0.5
17
+ ],
18
+ "merge_size": 2,
19
+ "patch_size": 16,
20
+ "resample": 3,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "size": {
23
+ "longest_edge": 16777216,
24
+ "shortest_edge": 65536
25
+ },
26
+ "temporal_patch_size": 2
27
+ }
PE/processor_config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "data_format": "channels_first",
4
+ "do_convert_rgb": true,
5
+ "do_normalize": true,
6
+ "do_rescale": true,
7
+ "do_resize": true,
8
+ "image_mean": [
9
+ 0.5,
10
+ 0.5,
11
+ 0.5
12
+ ],
13
+ "image_processor_type": "Qwen2VLImageProcessorFast",
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "merge_size": 2,
20
+ "patch_size": 16,
21
+ "resample": 3,
22
+ "rescale_factor": 0.00392156862745098,
23
+ "size": {
24
+ "longest_edge": 16777216,
25
+ "shortest_edge": 65536
26
+ },
27
+ "temporal_patch_size": 2
28
+ },
29
+ "processor_class": "Qwen3VLProcessor",
30
+ "video_processor": {
31
+ "data_format": "channels_first",
32
+ "default_to_square": true,
33
+ "do_convert_rgb": true,
34
+ "do_normalize": true,
35
+ "do_rescale": true,
36
+ "do_resize": true,
37
+ "do_sample_frames": true,
38
+ "fps": 2,
39
+ "image_mean": [
40
+ 0.5,
41
+ 0.5,
42
+ 0.5
43
+ ],
44
+ "image_std": [
45
+ 0.5,
46
+ 0.5,
47
+ 0.5
48
+ ],
49
+ "max_frames": 768,
50
+ "merge_size": 2,
51
+ "min_frames": 4,
52
+ "patch_size": 16,
53
+ "resample": 3,
54
+ "rescale_factor": 0.00392156862745098,
55
+ "return_metadata": false,
56
+ "size": {
57
+ "longest_edge": 25165824,
58
+ "shortest_edge": 4096
59
+ },
60
+ "temporal_patch_size": 2,
61
+ "video_processor_type": "Qwen3VLVideoProcessor"
62
+ }
63
+ }
PE/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
PE/tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": true,
13
+ "model_max_length": 262144,
14
+ "model_specific_special_tokens": {
15
+ "audio_bos_token": "<|audio_start|>",
16
+ "audio_eos_token": "<|audio_end|>",
17
+ "audio_token": "<|audio_pad|>",
18
+ "image_token": "<|image_pad|>",
19
+ "video_token": "<|video_pad|>",
20
+ "vision_bos_token": "<|vision_start|>",
21
+ "vision_eos_token": "<|vision_end|>"
22
+ },
23
+ "pad_token": "<|endoftext|>",
24
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
25
+ "processor_class": "Qwen3VLProcessor",
26
+ "split_special_tokens": false,
27
+ "tokenizer_class": "TokenizersBackend",
28
+ "unk_token": null,
29
+ "video_token": "<|video_pad|>",
30
+ "vision_bos_token": "<|vision_start|>",
31
+ "vision_eos_token": "<|vision_end|>"
32
+ }
PE/video_preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 25165824,
4
+ "shortest_edge": 4096
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "video_processor_type": "Qwen3VLVideoProcessor"
21
+ }
README.md ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: text-to-video
4
+ tags:
5
+ - hy-nomas
6
+ - world-model
7
+ - video-generation
8
+ - interactive-video-generation
9
+ - camera-control
10
+ - autoregressive
11
+ - diffusion-transformer
12
+ - pytorch
13
+ ---
14
+
15
+ <p align="left">
16
+ <a href="README_CN.md">中文</a>&nbsp;|&nbsp;English
17
+ </p>
18
+
19
+ <p align="center">
20
+ <img src="assets/logo-en.png" alt="Hy-Nomas" width="400"/>
21
+ </p>
22
+
23
+ <h1 align="center">Hy-Nomas: Towards Free-Form Interactive World Generation</h1>
24
+
25
+ <p align="center">
26
+ <a href="https://github.com/Tencent-Hunyuan/Hy-Nomas"><img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&amp;logo=github&amp;logoColor=white" alt="GitHub"/></a>
27
+ <a href="https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/main/Hy_Nomas_Tech_Report.pdf"><img src="https://img.shields.io/badge/Technical%20Report%20%28Coming%20Soon%29-B31B1B?style=flat-square&amp;logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMTQgMkg1djIwaDE0Vjd6TTE0IDJ2NWg1TTggMTJoOE04IDE2aDgiLz48L3N2Zz4%3D" alt="Technical Report (Coming Soon)"/></a>
28
+ <a href="https://huggingface.co/datasets/tencent/Hy-Nomas-Bench"><img src="https://img.shields.io/badge/Benchmark-FFD21E?style=flat-square&amp;logo=huggingface&amp;logoColor=black" alt="Benchmark"/></a>
29
+ <a href="https://hy-nomas.hy.tencent.com/"><img src="https://img.shields.io/badge/Official%20Website-666666?style=flat-square&amp;logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIvPjxlbGxpcHNlIGN4PSIxMiIgY3k9IjEyIiByeD0iNCIgcnk9IjEwIi8%2BPHBhdGggZD0iTTIgMTJoMjAiLz48L3N2Zz4%3D" alt="Official Website"/></a>
30
+ </p>
31
+
32
+ <h3 align="center">
33
+ 🚀 <a href="https://hy-nomas.hy.tencent.com/">Try the Demo →</a>
34
+ </h3>
35
+
36
+ ## Model Introduction
37
+
38
+ **Hy-Nomas** is a video world generation model that supports free-form, multi-turn interaction through text instructions and camera control. It generates a world one video segment at a time, allowing users to introduce objects, change styles and scenes, describe actions, or control the camera as generation continues.
39
+
40
+ The model combines a segment-autoregressive diffusion transformer (DiT), a Qwen text encoder, camera-conditioning modules, and a PixelUMM video decoder. A persistent key/value (KV) cache carries context between segments. The distilled inference configuration uses **8 denoising steps**, with **720 × 1280** output at **24 FPS**. A separate configuration supports video generation on a **single NVIDIA GeForce RTX 4090** using INT8 DiT weights, an INT8 KV cache, an FP8 decoder, and CPU offload.
41
+
42
+ ## Key Features
43
+
44
+ - **Free-form interaction:** Guide successive segments with instructions about subjects, actions, appearance, style, and environment.
45
+ - **Camera control:** Supply camera trajectories alongside text to control viewpoint and movement.
46
+ - **Continuous generation:** Reuse earlier context through a KV cache when extending the same world.
47
+ - **Distilled inference:** Generate each segment with 8 DiT denoising steps and decode its latents with a fine-tuned PixelUMM decoder.
48
+ - **Flexible deployment:** Use the standard sequence-parallel configuration or the single-GPU configuration, and interact through the web demo.
49
+
50
+ ## Hy-Nomas-Bench
51
+
52
+ We also release **[Hy-Nomas-Bench](https://huggingface.co/datasets/tencent/Hy-Nomas-Bench)**, a suite of four benchmarks with **280 test cases** covering multi-turn free-form text interaction, camera navigation, interleaved text and camera control, and spatial memory. It evaluates interactive controllability and consistency during continuous world generation, providing structured prompts, interaction sequences, keyboard timelines, and reference camera trajectories. See the [Hy-Nomas-Bench dataset repository](https://huggingface.co/datasets/tencent/Hy-Nomas-Bench) for downloads, data formats, and inference instructions.
53
+
54
+ ## Model Architecture
55
+
56
+ Hy-Nomas performs diffusion in a compressed video latent space and autoregression across video segments. Text, camera motion, and cached history condition the generation of each new segment.
57
+
58
+ ![Hy-Nomas framework: structured prompts, video latents, and camera trajectories feed dual-stream MMDiT blocks with segment-wise causal joint attention, timestep modulation, camera cross-attention, and a persistent KV cache.](assets/method_framework_h.png)
59
+
60
+ *Hy-Nomas framework. The inference configuration uses 54 dual-stream MMDiT blocks (N = 54). Purple, blue, and green indicate the text, video, and camera paths, respectively.*
61
+
62
+ The figure's video-encoder path illustrates how video is represented as DCAE-V latents. In the text-to-video inference flow below, each new segment starts from Gaussian noise in that latent space and uses the KV cache for generated history. The MLLM is the Qwen text encoder, and the default video decoder is the fine-tuned PixelUMM described below.
63
+
64
+ ### Text and Camera Conditioning
65
+
66
+ **Text conditioning.** The text encoder uses the language-model component of **Qwen/Qwen2.5-VL-7B-Instruct**. Its 3,584-dimensional hidden states pass through a two-layer token refiner and are projected into the DiT's 2,048-dimensional hidden space. Segment-specific prompts let users change the requested content as generation proceeds.
67
+
68
+ **Online prompt enhancement.** In the web demo, **Nomas-PE** first converts user instructions into structured generation prompts. It is a separate service from the text encoder and is required by the demo. Offline inference can read prepared prompt files directly.
69
+
70
+ **Camera conditioning.** The inference configuration uses `extrinsics_attn`. Normalized 4 × 4 camera extrinsic matrices are grouped over four video frames and flattened into 64-dimensional inputs, aligning camera features with the temporal compression of the video latents. Learned pose embeddings and projections implement the figure's **Pose Encoder → Camera Proj** path. At each double-stream block, video tokens query the projected camera features through cross-attention after the video MLP. With `per_chunk_camera_attn=true` and `camera_chunk_size=1`, camera attention is aligned to individual latent frames.
71
+
72
+ ### Segment-Autoregressive Diffusion Transformer
73
+
74
+ The generation backbone is a **dense multimodal diffusion transformer (MMDiT)**. Video latents enter through **Patch Embed**, while refined text tokens enter a separate stream. The **Timestep Embed** supplies noise-level conditioning: each block uses it to modulate the two streams with learned shifts, scales, and residual gates.
75
+
76
+ Within a block, text and video interact through **segment-wise causal joint attention**, with 3D RoPE encoding video positions and the layer's KV cache supplying context from earlier segments. The two streams then pass through separate MLPs. **Camera cross-attention** updates the video branch using video queries and camera keys/values. Text features continue to the next block; after the last block, the output head uses only the video stream to predict latent-space flow velocity. The sampler uses these predictions to denoise the segment before video decoding.
77
+
78
+ The model architecture is illustrated in the following table:
79
+
80
+ | Property | Configuration |
81
+ |:---|:---|
82
+ | Model identifier | `Hy-Nomas` |
83
+ | Transformer blocks | 54 double-stream blocks; 0 single-stream blocks |
84
+ | Hidden size | 2,048 |
85
+ | Attention heads | 16 heads; 128 dimensions per head |
86
+ | Feed-forward expansion | 4×; intermediate size 8,192 |
87
+ | Latent input / output channels | 32 / 32 |
88
+ | Latent patch size, time × height × width | 1 × 1 × 1 |
89
+ | Position encoding | 3D RoPE; temporal/height/width dimensions `[16, 56, 56]`; theta 256 |
90
+ | Text conditioning | 3,584-dimensional Qwen features; two-layer token refiner |
91
+ | Camera conditioning | Extrinsic embeddings with cross-attention in the double-stream blocks |
92
+ | Denoising prediction | Flow velocity; Euler ODE sampling in the inference configuration |
93
+
94
+ At each turn, the DiT denoises the current segment while attending to all past KV cache and the current conditioning. Attention is causal across segments, so future segments are not required to generate the current one. Cached attention keys and values are reused when generation advances to the next segment.
95
+
96
+ The standard configuration keeps the full history (`max_cache_segments=null`, sliding window disabled). The single-GPU configuration selects a bounded set of historical latent frames for GPU attention and retains an archive on CPU. Its default history budget is **18 latent frames**; that budget applies to historical context, not to the length of the current segment.
97
+
98
+ ### Video Latents and PixelUMM Decoder
99
+
100
+ Hy-Nomas uses **DCAE-V `f32t4c32` latents**: 32 channels, 32× spatial compression in each dimension, and 4× temporal compression. The DiT produces latents in this representation. The default inference pipeline decodes them with a **fine-tuned PixelUMM decoder**.
101
+
102
+ The decoder uses a transformer with **36 layers**, a **4,096-dimensional hidden size**, **32 query heads**, and **8 KV heads**. It conditions pixel reconstruction on the generated DCAE-V latents and processes RGB video in 4 × 16 × 16 tubelets. The configuration uses **one PixelUMM decoding step**, with temporal windows of 10 latent frames and an overlap of 5 latent frames. This decoding step is separate from the DiT's 8 denoising steps.
103
+
104
+ Architecture values are specified in the [DiT model definitions](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/dit/modules/__init__.py), [DiT implementation](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/dit/nomas_cpt.py), [PixelUMM implementation](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/vae/pixelumm_decoder/model.py), and [inference configuration](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/configs/experiment/inference.yaml).
105
+
106
+ ## Model Assets
107
+
108
+ Select compatible generation and decoding checkpoints for the inference configuration you use.
109
+
110
+ | Component | Asset | Role | Path in this repository |
111
+ |:---|:---|:---|:---|
112
+ | DiT | **Distilled DiT (FP32)** | Main checkpoint for 8-step inference and the interactive demo; the standard configuration loads the DiT in BF16. | `DiT/distilled/diffusion_pytorch_model_ema_0_995.safetensors` |
113
+ | DiT | **Quantized Distilled DiT (INT8)** | Quantized checkpoint for the single-GPU configuration; weights are stored in INT8 and DiT linear computation remains BF16. | `DiT/distilled_int8/diffusion_pytorch_model_ema_0_995_int8.safetensors` |
114
+ | DiT | **Base autoregressive DiT (FP32)** | Non-distilled model; use the distilled model with the 8-step examples below. | `DiT/base_ar/diffusion_pytorch_model_fp32.safetensors` |
115
+ | Adapter | **Cinematic LoRA** | Optional visual-quality adapter for a compatible floating-point DiT. | `DiT/lora_weights/cinematic/` |
116
+ | Adapter | **Robotics LoRA** | LoRA adapter trained on the [RealSource-World](https://huggingface.co/datasets/RealmanRobot/RealSource-World) real-world robotic-arm dataset, to be merged into the distilled DiT to enhance the robotics simulation capability of generated worlds. | `DiT/lora_weights/dual_arm_robotics/` |
117
+ | Video autoencoder | **DCAE-V** | Defines the 32-channel compressed video representation and provides video encoding and decoding. | `VAE/DCAE-V/dc-ae-v-1.0-f32t4c32-bf16.pt` |
118
+ | Video decoder | **Fine-tuned PixelUMM** | Default decoder for generated DCAE-V latents. | `VAE/PixelUMM_FT/diffusion_pytorch_model.safetensors` |
119
+ | Video decoder | **Quantized PixelUMM (FP8)** | Decoder checkpoint for the low-memory configuration. | `VAE/PixelUMM_FT_FP8/diffusion_pytorch_model_fp8.safetensors` |
120
+ | Prompt enhancement | **Nomas-PE** | Separate online service that converts user instructions into structured prompts for the web demo. | `PE/` |
121
+
122
+ Standard offline inference requires the **distilled DiT**, a **matching PixelUMM checkpoint**, and the **Qwen text encoder**. The single-GPU configuration requires the compatible **INT8 DiT** and **FP8 PixelUMM** pair. The INT8 loader does not support loading a separate LoRA adapter at inference time.
123
+
124
+ Download the applicable assets from this repository, preserving the `DiT/`, `VAE/`, and `PE/` directory layout. The inference commands below use `HY_NOMAS_MODEL_DIR` to locate the downloaded model repository. The text encoder is automatically downloaded from `Qwen/Qwen2.5-VL-7B-Instruct` by Huggingface and reused from the local cache. To use an existing local copy, append `model.text_encoder.model_name=/path/to/Qwen2.5-VL-7B-Instruct`.
125
+
126
+ ## Usage
127
+
128
+ ### Environment Setup
129
+
130
+ Run inference with the [Hy-Nomas code repository](https://github.com/Tencent-Hunyuan/Hy-Nomas):
131
+
132
+ ```bash
133
+ git clone https://github.com/Tencent-Hunyuan/Hy-Nomas.git
134
+ cd Hy-Nomas
135
+ ```
136
+
137
+ Choose one of the following two setup options. **We strongly recommend the pre-packaged Docker image**, which provides the Python environment, PyTorch, and the required CUDA attention kernels together.
138
+
139
+ #### Option 1: Pre-packaged Docker Image (Recommended)
140
+
141
+ Prepare a Linux host with a compatible NVIDIA driver, Docker, and NVIDIA Container Toolkit. Run these commands from the code repository root:
142
+
143
+ ```bash
144
+ export HY_NOMAS_IMAGE="hynomasoss/hynomasoss:cu130"
145
+
146
+ docker pull "$HY_NOMAS_IMAGE"
147
+ docker run --rm -it --gpus all --ipc=host --network=host \
148
+ -v "$PWD:/workspace/Hy-Nomas" \
149
+ -w /workspace/Hy-Nomas \
150
+ "$HY_NOMAS_IMAGE" bash
151
+ ```
152
+
153
+ Run the remaining commands inside the container, using its pre-installed Python environment. Place model assets under the mounted repository or add a volume mount for your model directory; use the paths visible inside the container in the launch commands below.
154
+
155
+ #### Option 2: Manual Installation
156
+
157
+ Prepare Linux, Python 3.12+, uv, a compatible NVIDIA driver, the CUDA 13.0 Toolkit (`nvcc`), and a C++ compiler. Run the following from the code repository root:
158
+
159
+ ```bash
160
+ uv sync --extra all
161
+ source .venv/bin/activate
162
+ ```
163
+
164
+ The `all` extra includes PyTorch 2.10.0 (CUDA 13.0), FlashAttention 2, FlashAttention 3, and MagiAttention. `pyproject.toml` configures the PyTorch CUDA index, the official FA3 source, and disables build isolation for the attention kernels so their builds can use the environment's PyTorch. Kernel compilation may take some time.
165
+
166
+ ### Model Paths
167
+
168
+ In the environment used for inference, set `HY_NOMAS_MODEL_DIR` to the local model repository root containing the weight paths listed above. When using Docker, use a path visible inside the container.
169
+
170
+ ```bash
171
+ export HY_NOMAS_MODEL_DIR="/path/to/Hy-Nomas-models"
172
+ ```
173
+
174
+ Run the commands below from the Hy-Nomas **code repository root**. They use this variable to read the weights and example prompts from the model repository.
175
+
176
+ ### Prepare Prompts
177
+
178
+ Offline inference accepts a JSON list of video-generation requests. Each request can contain multiple `segments` with start and end timestamps in seconds. The first segment describes the initial world, and later segments use `description_change` to describe how it should evolve.
179
+
180
+ The inference commands below use the bundled [example prompt file](examples/prompts.json) in the model repository. For custom content, save a JSON file in the following format and set `inference.prompt=/path/to/prompts.json`:
181
+
182
+ ```json
183
+ [
184
+ {
185
+ "test_id": "forest_world",
186
+ "Style": "Cinematic fantasy",
187
+ "perspective_view": "Third-person view",
188
+ "subject_list": [
189
+ {
190
+ "subject_id": "fox",
191
+ "display_name": "a small orange fox",
192
+ "subject_attribute": "Orange fur, white chest, and a fluffy tail."
193
+ }
194
+ ],
195
+ "segments": [
196
+ {
197
+ "start_time": 0,
198
+ "end_time": 2,
199
+ "visual_description_long": "A small orange fox stands on a stone path in a luminous forest. Blue fireflies drift between the trees.",
200
+ "contained_actions": [
201
+ {"start_time": 0, "end_time": 2, "action_description": "The fox walks slowly along the path."}
202
+ ]
203
+ },
204
+ {
205
+ "start_time": 2,
206
+ "end_time": 4,
207
+ "description_change": "Glowing blue flowers open beside the path as the fox continues forward.",
208
+ "contained_actions": [
209
+ {"start_time": 2, "end_time": 4, "action_description": "The fox passes the flowers and looks around."}
210
+ ]
211
+ }
212
+ ]
213
+ }
214
+ ]
215
+ ```
216
+
217
+ The configuration derives segment lengths from event timestamps (`inference.video_length=event`). Action timestamps in this example use the same video timeline; the configuration normalizes them to each segment internally.
218
+
219
+ ### Standard Inference
220
+
221
+ The standard configuration uses **8-way sequence parallelism** (`sp_size=8`) and distributed PixelUMM decoding. Its default launch therefore requires eight GPUs in one inference group. Run from the code repository root:
222
+
223
+ ```bash
224
+ bash scripts/inference/inference_from_config.sh configs/experiment/inference.yaml \
225
+ dit_weight="$HY_NOMAS_MODEL_DIR/DiT/distilled/diffusion_pytorch_model_ema_0_995.safetensors" \
226
+ model.vae.checkpoint="$HY_NOMAS_MODEL_DIR/VAE/PixelUMM_FT/diffusion_pytorch_model.safetensors" \
227
+ inference.prompt="$HY_NOMAS_MODEL_DIR/examples/prompts.json" \
228
+ inference.save_path=./outputs/distill
229
+ ```
230
+
231
+ Generated videos are written under `inference.save_path`. The configuration also saves generated latents and prompt text.
232
+
233
+ | Setting | Default | Override |
234
+ |:---|:---|:---|
235
+ | Output resolution, height × width | 720 × 1280 | `'inference.video_size=[480,832]'` |
236
+ | Output video frame rate | 24 FPS | `inference.video_fps=24` |
237
+ | DiT denoising steps | 8 | `inference.infer_steps_video=8` |
238
+ | Solver | Euler ODE | `inference.solver_type=euler` |
239
+ | Text / camera guidance scale | 1.0 / 1.0 | `inference.cfg_scale_video=1.0 inference.camera_cfg_scale=1.0` |
240
+ | Random seed | 42 | `inference.seed=42` |
241
+ | Camera translation / rotation strength | 1.0 / 2.5 | `inference.trajectory_translation_scale=1.0 inference.trajectory_rotation_scale=2.5` |
242
+
243
+ For camera-controlled generation, append `inference.camera_trajectory=/path/to/camera.npz`. The trajectory file contains camera-to-world matrices `c2ws` with shape `[N, 4, 4]` and camera `intrinsics` with shape `[N, 3, 3]`; align it with the requested video duration and frame rate. The repository includes [camera trajectory utilities](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/camera/geometry/generate_npz_trajectories.py).
244
+
245
+ ### Single-GPU Low-Memory Inference
246
+
247
+ Use `configs/experiment/single_gpu_low_mem_inference.yaml` for **single NVIDIA GeForce RTX 4090** inference. This configuration inherits the standard architecture, prompt processing, resolution, frame rate, and 8-step DiT schedule, and changes memory management and execution:
248
+
249
+ - **INT8 DiT and KV storage:** Store DiT weights and cached keys/values in INT8 while retaining BF16 DiT linear and attention computation.
250
+ - **Bounded GPU history:** Select up to 18 historical latent frames using `temporal_context` sampling, with earlier history archived on CPU.
251
+ - **CPU offload:** Move the text encoder, DiT, and decoder to the GPU for their processing stages and return them to CPU afterward.
252
+ - **Single-GPU kernels:** Use FlexAttention for the DiT, CUTLASS FP8 for the decoder, and `sp_size=1`.
253
+
254
+ Prepare the compatible INT8 DiT and FP8 PixelUMM checkpoints. Run on a host or in a container exposing **one GPU to `nvidia-smi`**, which the launcher uses to count GPUs:
255
+
256
+ ```bash
257
+ bash scripts/inference/inference_from_config.sh configs/experiment/single_gpu_low_mem_inference.yaml \
258
+ dit_weight="$HY_NOMAS_MODEL_DIR/DiT/distilled_int8/diffusion_pytorch_model_ema_0_995_int8.safetensors" \
259
+ model.vae.checkpoint="$HY_NOMAS_MODEL_DIR/VAE/PixelUMM_FT_FP8/diffusion_pytorch_model_fp8.safetensors" \
260
+ inference.prompt="$HY_NOMAS_MODEL_DIR/examples/prompts.json" \
261
+ inference.save_path=./outputs/single_gpu
262
+ ```
263
+
264
+ System RAM must accommodate the offloaded models and the growing history archive. CPU–GPU transfers add latency. Peak GPU memory also depends on output resolution and the current segment length; the history budget does not cap current-segment memory.
265
+
266
+ ### Interactive Demo
267
+
268
+ Try the [online interactive demo](https://hy-nomas.hy.tencent.com/) to start a world, continue it with text instructions or camera paths, and download the generated video.
269
+
270
+ For local deployment, follow the [web demo deployment guide](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/apps/README.md). It covers the frontend, gateway, GPU workers, single-GPU mode, and multiple-host deployment. **Nomas-PE is required for the web demo** and uses separate serving resources; the single-GPU claim above applies to video inference. The demo enables streaming decoding at segment boundaries.
271
+
272
+ ## Runtime Considerations
273
+
274
+ - Full-history inference retains more context as generation continues and consumes increasing cache memory. The single-GPU configuration bounds the active GPU history while its CPU archive can continue to grow.
275
+ - The 24 FPS setting specifies the output video's playback frame rate. Generation speed depends on hardware, resolution, segment length, history, and the selected configuration.
276
+ - The 8-step examples require the distilled DiT and its compatible decoder. Architecture and sampling defaults are configuration details, rather than benchmark results.
277
+
278
+ ## License
279
+
280
+ Hy-Nomas is licensed under the [Apache License, Version 2.0](LICENSE). Third-party models and components remain subject to their respective licenses.
281
+
282
+ ## Acknowledgement
283
+
284
+ We thank the teams behind [Gemma 4](https://deepmind.google/models/gemma/gemma-4/), [Qwen3.8](https://qwen.ai/blog?id=qwen3.8), [Kimi-K3](https://github.com/MoonshotAI/Kimi-K3), [DC-AE](https://github.com/dc-ai-projects/DC-Gen), and [MagiAttention](https://github.com/SandAI-org/MagiAttention) for their valuable contributions to the community and the models, research, and tools that support this project.
285
+
286
+ ## Contact
287
+
288
+ For questions, non-security bug reports, or suggestions, open an issue in the [Hy-Nomas repository](https://github.com/Tencent-Hunyuan/Hy-Nomas/issues) or contact [hy_nomas@tencent.com](mailto:hy_nomas@tencent.com). Report suspected security vulnerabilities through the repository's [security guidance](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/SECURITY.md).
README_CN.md ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: text-to-video
4
+ tags:
5
+ - hy-nomas
6
+ - world-model
7
+ - video-generation
8
+ - interactive-video-generation
9
+ - camera-control
10
+ - autoregressive
11
+ - diffusion-transformer
12
+ - pytorch
13
+ ---
14
+
15
+ <p align="left">
16
+ <a href="README.md">English</a>&nbsp;|&nbsp;中文
17
+ </p>
18
+
19
+ <p align="center">
20
+ <img src="assets/logo-zh.png" alt="Hy-Nomas" width="400"/>
21
+ </p>
22
+
23
+ <h1 align="center">Hy-Nomas: Towards Free-Form Interactive World Generation</h1>
24
+
25
+ <p align="center">
26
+ <a href="https://github.com/Tencent-Hunyuan/Hy-Nomas"><img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&amp;logo=github&amp;logoColor=white" alt="GitHub"/></a>
27
+ <a href="https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/main/Hy_Nomas_Tech_Report.pdf"><img src="https://img.shields.io/badge/%E6%8A%80%E6%9C%AF%E6%8A%A5%E5%91%8A%20%28Coming%20Soon%29-B31B1B?style=flat-square&amp;logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMTQgMkg1djIwaDE0Vjd6TTE0IDJ2NWg1TTggMTJoOE04IDE2aDgiLz48L3N2Zz4%3D" alt="技术报告 (Coming Soon)"/></a>
28
+ <a href="https://huggingface.co/datasets/tencent/Hy-Nomas-Bench"><img src="https://img.shields.io/badge/%E8%AF%84%E6%B5%8B%E5%9F%BA%E5%87%86-FFD21E?style=flat-square&amp;logo=huggingface&amp;logoColor=black" alt="评测基准"/></a>
29
+ <a href="https://hy-nomas.hy.tencent.com/"><img src="https://img.shields.io/badge/Official%20Website-666666?style=flat-square&amp;logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIvPjxlbGxpcHNlIGN4PSIxMiIgY3k9IjEyIiByeD0iNCIgcnk9IjEwIi8%2BPHBhdGggZD0iTTIgMTJoMjAiLz48L3N2Zz4%3D" alt="Official Website"/></a>
30
+ </p>
31
+
32
+ <h3 align="center">
33
+ 🚀 <a href="https://hy-nomas.hy.tencent.com/">体验演示 →</a>
34
+ </h3>
35
+
36
+ ## 模型介绍
37
+
38
+ **Hy-Nomas** 是一个支持自由形式、多轮交互的视频世界生成模型,可通过文本指令和相机控制信号逐段生成视频世界。用户可以在生成过程中引入物体、改变风格和场景、描述动作,或控制相机运动。
39
+
40
+ 模型由分段自回归扩散 Transformer(DiT)、Qwen 文本编码器、相机条件模块和 PixelUMM 视频解码器组成,通过持久化的键值(KV)缓存在片段之间传递上下文。蒸馏推理预设采用 **8 步去噪**,默认输出分辨率为 **720 × 1280**,视频帧率为 **24 FPS**。另提供 **NVIDIA GeForce RTX 4090 单卡**视频推理配置,结合 INT8 DiT 权重、INT8 KV cache、FP8 解码器和 CPU offload 降低显存占用。
41
+
42
+ ## 核心特性
43
+
44
+ - **自由形式交互:** 通过多轮指令控制主体、动作、外观、风格和环境。
45
+ - **相机控制:** 将相机轨迹与文本提示词一起作为条件,控制视角与镜头运动。
46
+ - **连续生成:** 通过 KV cache 复用历史上下文,在同一世界中持续生成后续片段。
47
+ - **蒸馏推理:** 每个片段使用 8 步 DiT 去噪,再由微调版 PixelUMM 将潜变量解码为视频。
48
+ - **灵活部署:** 支持标准序列并行配置、单卡配置和 Web 交互式演示。
49
+
50
+ ## Hy-Nomas-Bench
51
+
52
+ 我们同时发布 **[Hy-Nomas-Bench](https://huggingface.co/datasets/tencent/Hy-Nomas-Bench)**,包含 **280 个测试案例**,覆盖多轮自由形式文本交互、相机导航、文本与相机交替控制,以及空间记忆四项基准,用于评估视频世界模型在连续生成过程中的交互可控性与一致性。数据集提供结构化提示词、交互序列、按键时间线和参考相机轨迹。数据下载、格式说明及推理指南请参阅 [Hy-Nomas-Bench 数据集仓库](https://huggingface.co/datasets/tencent/Hy-Nomas-Bench)。
53
+
54
+ ## 模型架构
55
+
56
+ Hy-Nomas 在压缩的视频潜空间中进行扩散去噪,在视频片段之间进行自回归生成。文本、相机运动和缓存的历史共同作为新片段的生成条件。
57
+
58
+ ![Hy-Nomas 中文框架:结构化提示词、视频潜变量和相机轨迹输入双流 MMDiT,通过分段因果联合注意力、时间步调制、相机交叉注意力和持久化 KV cache 生成视频片段。](assets/method_framework_h_cn.png)
59
+
60
+ *Hy-Nomas 整体框架。推理预设使用 54 个双流 MMDiT 块(N = 54);紫色、蓝色和绿色分别表示文本、视频和相机路径。*
61
+
62
+ 图中的视频编码路径展示了视频如何表示为 DCAE-V 潜变量。下方文本生成视频的推理流程从该潜空间中的高斯噪声开始生成每个新片段,并通过 KV cache 获取已生成的历史上下文。图中的“多模态大模型”对应 Qwen 文本编码器,默认视频解码器使用下文介绍的微调版 PixelUMM。
63
+
64
+ ### 文本与相机条件
65
+
66
+ **文本条件。** 文本编码器使用 **Qwen/Qwen2.5-VL-7B-Instruct** 的语言模型部分,其 3,584 维��藏状态通过两层 token refiner,映射到 DiT 的 2,048 维隐藏空间。各片段使用相应的提示词,用户可随生成过程更新内容要求。
67
+
68
+ **在线提示词增强。** Web 演示首先通过 **Nomas-PE** 将用户指令转换为结构化生成提示词。它独立于文本编码器,以单独的服务运行,是演示的必要依赖。离线推理可以直接读取已准备好的提示词文件。
69
+
70
+ **相机条件。** 推理预设采用 `extrinsics_attn`:将归一化的 4 × 4 相机外参矩阵按四个视频帧分组,展平为 64 维输入,与视频潜变量的时间压缩比例对齐。可学习的位姿嵌入和投影对应图中的**位姿编码器 → 相机投影**路径。在每个双流块中,视频 token 经过视频 MLP 后,通过交叉注意力查询投影后的相机特征。`per_chunk_camera_attn=true`、`camera_chunk_size=1` 表示相机注意力按单个潜变量帧对齐。
71
+
72
+ ### 分段自回归扩散 Transformer
73
+
74
+ 生成主干是一个**稠密多模态扩散 Transformer(MMDiT)**。视频潜变量经过**时空块嵌入**进入视频流,细化后的文本 token 进入独立的文本流。**时间步嵌入**提供当前噪声水平的条件,各块据此生成偏移、缩放和残差门控,对两个分支分别进行调制。
75
+
76
+ 在每个块中,文本与视频通过**分段因果联合注意力**交换信息,使用 3D RoPE 编码视频位置,并从该层的 KV cache 读取历史片段上下文。随后,两个分支分别经过各自的 MLP。**相机交叉注意力**以视频 token 为 Query、相机特征为 Key/Value,进一步更新视频分支。文本特征继续传入下一块;经过最后一块后,输出头仅使用视频分支预测潜空间中的 flow velocity,采样器据此完成片段去噪,再进行视频解码。
77
+
78
+ 模型架构如下表所示:
79
+
80
+ | 属性 | 配置 |
81
+ |:---|:---|
82
+ | 模型标识 | `Hy-Nomas` |
83
+ | Transformer 层数 | 54 个双流块;0 个单流块 |
84
+ | 隐藏维度 | 2,048 |
85
+ | 注意力头 | 16 个头;每头 128 维 |
86
+ | 前馈网络扩展比例 | 4 倍;中间维度 8,192 |
87
+ | 潜变量输入 / 输出通道 | 32 / 32 |
88
+ | 潜变量 patch 大小,时间 × 高 × 宽 | 1 × 1 × 1 |
89
+ | 位置编码 | 3D RoPE;时间 / 高 / 宽维度为 `[16, 56, 56]`;theta 为 256 |
90
+ | 文本条件 | 3,584 维 Qwen 特征;两层 token refiner |
91
+ | 相机条件 | 相机外参嵌入,通过双流块中的交叉注意力注入 |
92
+ | 去噪预测 | 预测 flow velocity;推理预设采用 Euler ODE 采样 |
93
+
94
+ 每轮生成时,DiT 通过注意力访问全部历史 KV cache 和当前条件,对当前片段进行去噪。片段之间采用因果注意力,因此生成当前片段无需访问未来片段。进入下一片段时,复用已缓存的 Key 和 Value。
95
+
96
+ 标准预设保留完整历史(`max_cache_segments=null`,关闭滑动窗口)。单卡预设为 GPU 注意力选择有限数量的历史潜变量帧,并在 CPU 上保留历史存档。默认历史预算为 **18 个潜变量帧**,该预算限制的是历史上下文,不限制当前片段长度。
97
+
98
+ ### 视频潜变量与 PixelUMM 解码器
99
+
100
+ Hy-Nomas 使用 **DCAE-V `f32t4c32` 潜变量**,包含 32 个通道,空间高、宽各压缩 32 倍,时间压缩 4 倍。DiT 生成该表示下的潜变量,默认推理流程使用**微调版 PixelUMM 解码器**将其还原为视频。
101
+
102
+ 解码器包含 **36 层 Transformer**,隐藏维度为 **4,096**,采用 **32 个 Query 头**和 **8 个 KV 头**。它以生成的 DCAE-V 潜变量为条件重建像素,将 RGB 视频划分为 4 × 16 × 16 的时空块(tubelet)。预设使用 **1 步 PixelUMM 解码**,时间窗口为 10 个潜变量帧,相邻窗口重叠 5 个潜变量帧。该解码步数与 DiT 的 8 步去噪分别配置。
103
+
104
+ 架构参数见 [DiT 模型定义](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/dit/modules/__init__.py)、[DiT 实现](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/dit/nomas_cpt.py)、[PixelUMM 实现](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/vae/pixelumm_decoder/model.py)及[推理配置](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/configs/experiment/inference.yaml)。
105
+
106
+ ## 模型资源
107
+
108
+ 根据所用推理配置,选择匹配的生成模型与解码器权重。
109
+
110
+ | 组件 | 模型资源 | 用途 | 本仓库中的路径 |
111
+ |:---|:---|:---|:---|
112
+ | DiT | **蒸馏 DiT(FP32)** | 用于 8 步推理和交互式演示的主要检查点;标准配置以 BF16 加载 DiT。 | `DiT/distilled/diffusion_pytorch_model_ema_0_995.safetensors` |
113
+ | DiT | **量化蒸馏 DiT(INT8)** | 用于单卡配置的量化检查点;权重以 INT8 存储,DiT 线性运算仍采用 BF16。 | `DiT/distilled_int8/diffusion_pytorch_model_ema_0_995_int8.safetensors` |
114
+ | DiT | **基础自回归 DiT(FP32)** | 未蒸馏模型;下方的 8 步推理示例应使用蒸馏模型。 | `DiT/base_ar/diffusion_pytorch_model_fp32.safetensors` |
115
+ | 适配器 | **Cinematic LoRA** | 可选的视觉质��适配器,适用于兼容的浮点 DiT。 | `DiT/lora_weights/cinematic/` |
116
+ | 适配器 | **Robotics LoRA** | 在 [RealSource-World](https://huggingface.co/datasets/RealmanRobot/RealSource-World) 真实世界机械臂数据集上训练的 LoRA 适配器,合并到蒸馏 DiT 中,以增强生成世界的机器人仿真能力。 | `DiT/lora_weights/dual_arm_robotics/` |
117
+ | 视频自编码器 | **DCAE-V** | 定义 32 通道的压缩视频表示,并提供视频编码和解码功能。 | `VAE/DCAE-V/dc-ae-v-1.0-f32t4c32-bf16.pt` |
118
+ | 视频解码器 | **微调后的 PixelUMM 解码器** | 默认用于解码生成的 DCAE-V 潜变量。 | `VAE/PixelUMM_FT/diffusion_pytorch_model.safetensors` |
119
+ | 视频解码器 | **量化后的 PixelUMM 解码器(FP8)** | 用于低显存配置的解码器检查点。 | `VAE/PixelUMM_FT_FP8/diffusion_pytorch_model_fp8.safetensors` |
120
+ | 提示词增强 | **Nomas-PE** | 独立的在线服务,将用户指令转换为供 Web 演示使用的结构化提示词。 | `PE/` |
121
+
122
+ 标准离线推理需要**蒸馏 DiT**、**匹配的 PixelUMM 权重**和 **Qwen 文本编码器**。单卡预设需要兼容的 **INT8 DiT** 与 **FP8 PixelUMM** 组合。INT8 加载器不支持在推理时额外加载独立的 LoRA 适配器。
123
+
124
+ 从本仓库下载所需模型资源,并保留 `DiT/`、`VAE/` 和 `PE/` 的目录结构。下方推理命令通过 `HY_NOMAS_MODEL_DIR` 指定下载后的模型仓库根目录。文本编码器由 Hugging Face 自动从 `Qwen/Qwen2.5-VL-7B-Instruct` 下载,并复用本地缓存。如已有本地副本,可在命令后添加 `model.text_encoder.model_name=/path/to/Qwen2.5-VL-7B-Instruct`。
125
+
126
+ ## 使用指南
127
+
128
+ ### 环境配置
129
+
130
+ 使用 [Hy-Nomas 代码仓库](https://github.com/Tencent-Hunyuan/Hy-Nomas) 进行推理:
131
+
132
+ ```bash
133
+ git clone https://github.com/Tencent-Hunyuan/Hy-Nomas.git
134
+ cd Hy-Nomas
135
+ ```
136
+
137
+ 可选择以下两种环境配置方式。**强烈推荐使用我们发布的预打包 Docker 镜像**,其中已包含 Python 环境、PyTorch 和所需的 CUDA 注意力内核。
138
+
139
+ #### 方案一:预打包 Docker 镜像(推荐)
140
+
141
+ 准备一台安装了兼容 NVIDIA 驱动、Docker 和 NVIDIA Container Toolkit 的 Linux 主机。在代码仓库根目录运行:
142
+
143
+ ```bash
144
+ export HY_NOMAS_IMAGE="hynomasoss/hynomasoss:cu130"
145
+
146
+ docker pull "$HY_NOMAS_IMAGE"
147
+ docker run --rm -it --gpus all --ipc=host --network=host \
148
+ -v "$PWD:/workspace/Hy-Nomas" \
149
+ -w /workspace/Hy-Nomas \
150
+ "$HY_NOMAS_IMAGE" bash
151
+ ```
152
+
153
+ 后续命令在容器内执行,使用镜像预装的 Python 环境。将模型资源放在挂载的仓库目录下,或额外挂载模型目录;下方启动命令应使用容器内可见的路径。
154
+
155
+ #### 方案二:手动安装
156
+
157
+ 准备 Linux、Python 3.12+、uv、兼容的 NVIDIA 驱动、CUDA 13.0 Toolkit(`nvcc`)和 C++ 编译器。在代码仓库根目录运行:
158
+
159
+ ```bash
160
+ uv sync --extra all
161
+ source .venv/bin/activate
162
+ ```
163
+
164
+ `all` 可选依赖组包含 PyTorch 2.10.0(CUDA 13.0)、FlashAttention 2、FlashAttention 3 和 MagiAttention。`pyproject.toml` 已配置 PyTorch CUDA 包源和官方 FA3 源码,并为注意力内核禁用构建隔离,使其构建时能够使用当前环境中的 PyTorch。内核编译可能需要一些时间。
165
+
166
+ ### 模型路径
167
+
168
+ 在运行推理的环境中,将 `HY_NOMAS_MODEL_DIR` 设置为本地模型仓库根目录;该目录应包含上表所列的权重路径。使用 Docker 时,请填写容器内可见的路径。
169
+
170
+ ```bash
171
+ export HY_NOMAS_MODEL_DIR="/path/to/Hy-Nomas-models"
172
+ ```
173
+
174
+ 下方命令仍在 Hy-Nomas **代码仓库根目录**运行,通过此变量读取模型仓库中的权重和示例提示词。
175
+
176
+ ### 准备提示词
177
+
178
+ 离线推理支持包含多个视频生成请求的 JSON 列表。每个请求可包含多个 `segments`,用秒为单位的起止时间定义各片段。首个片段描述初始世界,后续片段通过 `description_change` 描述世界如何变化。
179
+
180
+ 下方推理命令使用模型仓库中随附的[提示词示例文件](examples/prompts.json)。如需自定义内容,可按以下格式保存 JSON,并通过 `inference.prompt=/path/to/prompts.json` 指定文件:
181
+
182
+ ```json
183
+ [
184
+ {
185
+ "test_id": "forest_world",
186
+ "Style": "Cinematic fantasy",
187
+ "perspective_view": "Third-person view",
188
+ "subject_list": [
189
+ {
190
+ "subject_id": "fox",
191
+ "display_name": "a small orange fox",
192
+ "subject_attribute": "Orange fur, white chest, and a fluffy tail."
193
+ }
194
+ ],
195
+ "segments": [
196
+ {
197
+ "start_time": 0,
198
+ "end_time": 2,
199
+ "visual_description_long": "A small orange fox stands on a stone path in a luminous forest. Blue fireflies drift between the trees.",
200
+ "contained_actions": [
201
+ {"start_time": 0, "end_time": 2, "action_description": "The fox walks slowly along the path."}
202
+ ]
203
+ },
204
+ {
205
+ "start_time": 2,
206
+ "end_time": 4,
207
+ "description_change": "Glowing blue flowers open beside the path as the fox continues forward.",
208
+ "contained_actions": [
209
+ {"start_time": 2, "end_time": 4, "action_description": "The fox passes the flowers and looks around."}
210
+ ]
211
+ }
212
+ ]
213
+ }
214
+ ]
215
+ ```
216
+
217
+ 预设通过事件时间戳计算片段长度(`inference.video_length=event`)。示例中的动作时间戳使用同一条视频时间轴,程序会将其转换为各片段的局部时间。
218
+
219
+ ### 标准推理
220
+
221
+ 标准预设采用 **8 路序列并行**(`sp_size=8`)和分布式 PixelUMM 解码,因此默认启动需要一个推理组内的八张 GPU。在代码仓库根目录执行:
222
+
223
+ ```bash
224
+ bash scripts/inference/inference_from_config.sh configs/experiment/inference.yaml \
225
+ dit_weight="$HY_NOMAS_MODEL_DIR/DiT/distilled/diffusion_pytorch_model_ema_0_995.safetensors" \
226
+ model.vae.checkpoint="$HY_NOMAS_MODEL_DIR/VAE/PixelUMM_FT/diffusion_pytorch_model.safetensors" \
227
+ inference.prompt="$HY_NOMAS_MODEL_DIR/examples/prompts.json" \
228
+ inference.save_path=./outputs/distill
229
+ ```
230
+
231
+ 生成的视频保存在 `inference.save_path` 下,预设还会保存生成的潜变量和提示词文本。
232
+
233
+ | 设置 | 默认值 | 覆盖参数 |
234
+ |:---|:---|:---|
235
+ | 输出分辨率,高 × 宽 | 720 × 1280 | `'inference.video_size=[480,832]'` |
236
+ | 输出视频帧率 | 24 FPS | `inference.video_fps=24` |
237
+ | DiT 去噪步数 | 8 | `inference.infer_steps_video=8` |
238
+ | 求解器 | Euler ODE | `inference.solver_type=euler` |
239
+ | 文本 / 相机引导强度 | 1.0 / 1.0 | `inference.cfg_scale_video=1.0 inference.camera_cfg_scale=1.0` |
240
+ | 随机种子 | 42 | `inference.seed=42` |
241
+ | 相机平移 / 旋转强度 | 1.0 / 2.5 | `inference.trajectory_translation_scale=1.0 inference.trajectory_rotation_scale=2.5` |
242
+
243
+ 进行相机控制生成时,可添加 `inference.camera_trajectory=/path/to/camera.npz`。轨迹文件包含形状为 `[N, 4, 4]` 的 camera-to-world 矩阵 `c2ws`,以及形状为 `[N, 3, 3]` 的相机内参 `intrinsics`;轨迹应与目标视频时长和帧率对齐。仓库提供[相机轨迹工具](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/hymm/models/camera/geometry/generate_npz_trajectories.py)。
244
+
245
+ ### 单卡低显存推理
246
+
247
+ 使用 `configs/experiment/single_gpu_low_mem_inference.yaml` 在 **NVIDIA GeForce RTX 4090 单卡**上推理。该配置继承标准预设的模型架构、提示词处理、分辨率、帧率及 8 步 DiT 去噪设置,并调整内存管理和执行方式:
248
+
249
+ - **INT8 DiT 与 KV 存储:** 使用 INT8 存储 DiT 权重及缓存的 Key/Value,DiT 线性层和注意力仍采用 BF16 计算。
250
+ - **有限的 GPU 历史上下文:** 使用 `temporal_context` 策略选择最多 18 个历史潜变量帧,将历史存档保存在 CPU 上。
251
+ - **CPU offload:** 文本编码器、DiT 和解码器在各自处理阶段移入 GPU,完成后移回 CPU。
252
+ - **单卡内核:** DiT 使用 FlexAttention,解码器使用 CUTLASS FP8,并设置 `sp_size=1`。
253
+
254
+ 准备兼容的 INT8 DiT 与 FP8 PixelUMM 权重。启动脚本通过 `nvidia-smi` 统计 GPU 数量,请在 **`nvidia-smi` 仅能看到一张 GPU** 的主机或容器中执行:
255
+
256
+ ```bash
257
+ bash scripts/inference/inference_from_config.sh configs/experiment/single_gpu_low_mem_inference.yaml \
258
+ dit_weight="$HY_NOMAS_MODEL_DIR/DiT/distilled_int8/diffusion_pytorch_model_ema_0_995_int8.safetensors" \
259
+ model.vae.checkpoint="$HY_NOMAS_MODEL_DIR/VAE/PixelUMM_FT_FP8/diffusion_pytorch_model_fp8.safetensors" \
260
+ inference.prompt="$HY_NOMAS_MODEL_DIR/examples/prompts.json" \
261
+ inference.save_path=./outputs/single_gpu
262
+ ```
263
+
264
+ 系统内存需要容纳卸载的模型以及随生成增长的历史存档。CPU–GPU 数据传输会增加延迟。峰值显存还取决于输出分辨率和当前片段长度;历史帧预算不限制当前片段的显存占用。
265
+
266
+ ### 交互式演示
267
+
268
+ 访问[在线交互式演示](https://hy-nomas.hy.tencent.com/),创建世界,通过文本指令或相机路径继续生成,并下载视频。
269
+
270
+ 本地部署请参阅 [Web 演示部署指南](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/apps/README.md),其中包含前端、网关、GPU 工作进程、单卡模式和多机部署说明。**Web 演示需要 Nomas-PE**,其服务资源单独计算;上文的单卡支持指视频推理部分。演示在片段边界进行流式解码。
271
+
272
+ ## 运行说明
273
+
274
+ - 完整历史推理会随生成持续增加上下文和缓存内存占用。单卡预设限制 GPU 上活跃的历史上下文,其 CPU 历史存档仍可增长。
275
+ - 24 FPS 指输出视频的播放帧率。实际生成速度取决于硬件、分辨率、片段长度、历史上下文和所选配置。
276
+ - 8 步示例需要蒸馏 DiT 及匹配的解码器。文中的架构和采样参数来自配置,不代表性能评测结果。
277
+
278
+ ## 许可证
279
+
280
+ Hy-Nomas 采用 [Apache License 2.0](LICENSE) 许可证。第三方模型和组件仍遵循各自的许可证。
281
+
282
+ ## 致谢
283
+
284
+ 感谢 [Gemma 4](https://deepmind.google/models/gemma/gemma-4/)、[Qwen3.8](https://qwen.ai/blog?id=qwen3.8)、[Kimi-K3](https://github.com/MoonshotAI/Kimi-K3)、[DC-AE](https://github.com/dc-ai-projects/DC-Gen) 和 [MagiAttention](https://github.com/SandAI-org/MagiAttention) 团队为社区作出的贡献,以及为本项目提供支持的模型、研究成果和工具。
285
+
286
+ ## 联系我们
287
+
288
+ 如有一般问题、非安全缺陷或建议,欢迎在 [Hy-Nomas 仓库](https://github.com/Tencent-Hunyuan/Hy-Nomas/issues)提交 issue,或通过 [hy_nomas@tencent.com](mailto:hy_nomas@tencent.com) 联系我们。疑似安全漏洞请按照仓库的[安全问题报告指南](https://github.com/Tencent-Hunyuan/Hy-Nomas/blob/HEAD/SECURITY.md)私下报告。
VAE/DCAE-V/dc-ae-v-1.0-f32t4c32-bf16.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebbee483c80890c7795a2babc06e1cb4d42564174cf3bae2b698c0589d95cc3b
3
+ size 4277389995
VAE/PixelUMM_FT/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0bbfe8fd44bd2ebf1059fe65079caba50fd6f52ea8e1b5b35393e3050b9b8378
3
+ size 31553868864
VAE/PixelUMM_FT_FP8/diffusion_pytorch_model_fp8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ada04d7cedf9fe95bbaf87b4a8c0334944b312af5571568853b37d9b7256d78
3
+ size 9134846208
assets/logo-en.png ADDED
assets/logo-zh.png ADDED
assets/method_framework_h.png ADDED

Git LFS Details

  • SHA256: 9f5078c0c14169193c5a7a33b3865ef9cdce905401ec4e37f4d9b7857a7aef37
  • Pointer size: 131 Bytes
  • Size of remote file: 250 kB
assets/method_framework_h_cn.png ADDED

Git LFS Details

  • SHA256: 0927c8c7d9983e1605d68b4d9a887b4f626400f77d020e337ac53da0d295d10c
  • Pointer size: 131 Bytes
  • Size of remote file: 254 kB
examples/prompts.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "test_id": "forest_world",
4
+ "Style": "Cinematic fantasy",
5
+ "perspective_view": "Third-person view",
6
+ "subject_list": [
7
+ {
8
+ "subject_id": "fox",
9
+ "display_name": "a small orange fox",
10
+ "subject_attribute": "Orange fur, white chest, and a fluffy tail."
11
+ }
12
+ ],
13
+ "segments": [
14
+ {
15
+ "start_time": "00:00.000",
16
+ "end_time": "00:05.000",
17
+ "visual_description_long": "A small orange fox stands on a stone path in a luminous forest. Blue fireflies drift between the trees.",
18
+ "contained_actions": [
19
+ {"start_time": "00:00.000", "end_time": "00:05.000", "action_description": "The fox walks slowly along the path."}
20
+ ]
21
+ },
22
+ {
23
+ "start_time": "00:05.000",
24
+ "end_time": "00:10.000",
25
+ "description_change": "Glowing blue flowers open beside the path as the fox continues forward.",
26
+ "contained_actions": [
27
+ {"start_time": "00:05.000", "end_time": "00:10.000", "action_description": "The fox passes the flowers and looks around."}
28
+ ]
29
+ }
30
+ ]
31
+ }
32
+ ]