rootonchair commited on
Commit
8fdcb1d
·
verified ·
1 Parent(s): b85c1ec

Upload converted Nunchaku Lite pipeline

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* 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
 
 
 
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
+ output_comparison.png filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Tongyi-MAI/Z-Image-Turbo
4
+ pipeline_tag: text-to-image
5
+ library_name: diffusers
6
+ tags:
7
+ - z-image
8
+ - nunchaku
9
+ - svdquant
10
+ - int4
11
+ - quantization
12
+ ---
13
+
14
+ # Z-Image-Turbo Nunchaku Lite INT4 r32
15
+
16
+ Diffusers-loadable conversion of:
17
+
18
+ - Base model: `Tongyi-MAI/Z-Image-Turbo`
19
+ - Source repo: `nunchaku-ai/nunchaku-z-image-turbo`
20
+ - Source checkpoint: `svdq-int4_r32-z-image-turbo.safetensors`
21
+
22
+ The transformer uses `quant_method: nunchaku_lite`, INT4 SVDQ, group size 64, rank 32, and 238 quantized targets. Packed fused QKV and SwiGLU projections are split in logical layout into the stock Z-Image graph. The Qwen3 text encoder is packaged with BitsAndBytes 4-bit NF4.
23
+
24
+ ## Benchmark
25
+
26
+ | Checkpoint | Latency | Max VRAM |
27
+ | --- | ---: | ---: |
28
+ | Converted Diffusers Nunchaku Lite INT4 r32 + BNB4 Qwen3 | 6.03 s (stdev 0.00 s) | 12.01 GiB |
29
+
30
+ RTX 5090, 1024×1024, 9 scheduler steps (8 DiT forwards), guidance scale 0, seed 42, one warmup and three measured runs. VRAM is peak total device usage sampled through `nvidia-smi`. The native row uses the base model's BF16 Qwen3 encoder.
31
+
32
+ ## Output Comparison
33
+
34
+ ![Native reference (left) and converted output (right)](output_comparison.png)
35
+
36
+ Both images use the same prompt, seed, scheduler, resolution, and step count. Native Nunchaku 1.x selects NVFP4 kernels on Blackwell, so the comparison uses native NVFP4 as a visual reference only (cross-precision MAE 23.37, RMSE 30.81).
37
+
38
+ ## Run
39
+
40
+ Requires the Hugging Face `kernels` package and an NVIDIA Turing, Ampere, Ada, or Blackwell (not Hopper) GPU.
41
+
42
+ ```python
43
+ import torch
44
+ from diffusers import ZImagePipeline
45
+
46
+ pipe = ZImagePipeline.from_pretrained(
47
+ "lite-infer/z-image-turbo-nunchaku-lite-int4_r32-bnb4-text-encoder",
48
+ torch_dtype=torch.bfloat16,
49
+ ).to("cuda")
50
+
51
+ image = pipe(
52
+ prompt='A cinematic portrait of a red fox in a misty forest at sunrise, detailed fur, volumetric light',
53
+ height=1024,
54
+ width=1024,
55
+ num_inference_steps=9,
56
+ guidance_scale=0.0,
57
+ generator=torch.Generator("cuda").manual_seed(42),
58
+ ).images[0]
59
+ image.save("output.png")
60
+ ```
model_index.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ZImagePipeline",
3
+ "_diffusers_version": "0.36.0.dev0",
4
+ "scheduler": [
5
+ "diffusers",
6
+ "FlowMatchEulerDiscreteScheduler"
7
+ ],
8
+ "text_encoder": [
9
+ "transformers",
10
+ "Qwen3Model"
11
+ ],
12
+ "tokenizer": [
13
+ "transformers",
14
+ "Qwen2Tokenizer"
15
+ ],
16
+ "transformer": [
17
+ "diffusers",
18
+ "ZImageTransformer2DModel"
19
+ ],
20
+ "vae": [
21
+ "diffusers",
22
+ "AutoencoderKL"
23
+ ]
24
+ }
output_comparison.png ADDED

Git LFS Details

  • SHA256: 7beadb49c1114fa2371bb0f53b8ef1c88629ecd763376c10725a067540703ec7
  • Pointer size: 132 Bytes
  • Size of remote file: 2.31 MB
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "FlowMatchEulerDiscreteScheduler",
3
+ "_diffusers_version": "0.36.0.dev0",
4
+ "num_train_timesteps": 1000,
5
+ "use_dynamic_shifting": false,
6
+ "shift": 3.0
7
+ }
text_encoder/config.json ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3Model"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 151643,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": 151645,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 2560,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 9728,
15
+ "layer_types": [
16
+ "full_attention",
17
+ "full_attention",
18
+ "full_attention",
19
+ "full_attention",
20
+ "full_attention",
21
+ "full_attention",
22
+ "full_attention",
23
+ "full_attention",
24
+ "full_attention",
25
+ "full_attention",
26
+ "full_attention",
27
+ "full_attention",
28
+ "full_attention",
29
+ "full_attention",
30
+ "full_attention",
31
+ "full_attention",
32
+ "full_attention",
33
+ "full_attention",
34
+ "full_attention",
35
+ "full_attention",
36
+ "full_attention",
37
+ "full_attention",
38
+ "full_attention",
39
+ "full_attention",
40
+ "full_attention",
41
+ "full_attention",
42
+ "full_attention",
43
+ "full_attention",
44
+ "full_attention",
45
+ "full_attention",
46
+ "full_attention",
47
+ "full_attention",
48
+ "full_attention",
49
+ "full_attention",
50
+ "full_attention",
51
+ "full_attention"
52
+ ],
53
+ "max_position_embeddings": 40960,
54
+ "max_window_layers": 36,
55
+ "model_type": "qwen3",
56
+ "num_attention_heads": 32,
57
+ "num_hidden_layers": 36,
58
+ "num_key_value_heads": 8,
59
+ "pad_token_id": null,
60
+ "quantization_config": {
61
+ "_load_in_4bit": true,
62
+ "_load_in_8bit": false,
63
+ "bnb_4bit_compute_dtype": "bfloat16",
64
+ "bnb_4bit_quant_storage": "uint8",
65
+ "bnb_4bit_quant_type": "nf4",
66
+ "bnb_4bit_use_double_quant": false,
67
+ "llm_int8_enable_fp32_cpu_offload": false,
68
+ "llm_int8_has_fp16_weight": false,
69
+ "llm_int8_skip_modules": null,
70
+ "llm_int8_threshold": 6.0,
71
+ "load_in_4bit": true,
72
+ "load_in_8bit": false,
73
+ "quant_method": "bitsandbytes"
74
+ },
75
+ "rms_norm_eps": 1e-06,
76
+ "rope_parameters": {
77
+ "rope_theta": 1000000,
78
+ "rope_type": "default"
79
+ },
80
+ "sliding_window": null,
81
+ "tie_word_embeddings": true,
82
+ "transformers_version": "5.13.1",
83
+ "use_cache": true,
84
+ "use_sliding_window": false,
85
+ "vocab_size": 151936
86
+ }
text_encoder/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46738664bad81b157a67ed7c46f20c233172a821cc6694f6518392c16becf479
3
+ size 2822212864
tokenizer/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4
3
+ size 11422654
tokenizer/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 {{- messages[0].content + '\\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' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and 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 {{- content }}\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 {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
231
+ "clean_up_tokenization_spaces": false,
232
+ "eos_token": "<|im_end|>",
233
+ "errors": "replace",
234
+ "model_max_length": 131072,
235
+ "pad_token": "<|endoftext|>",
236
+ "split_special_tokens": false,
237
+ "tokenizer_class": "Qwen2Tokenizer",
238
+ "unk_token": null
239
+ }
tokenizer/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
transformer/config.json ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ZImageTransformer2DModel",
3
+ "_diffusers_version": "0.36.0.dev0",
4
+ "all_f_patch_size": [
5
+ 1
6
+ ],
7
+ "all_patch_size": [
8
+ 2
9
+ ],
10
+ "axes_dims": [
11
+ 32,
12
+ 48,
13
+ 48
14
+ ],
15
+ "axes_lens": [
16
+ 1536,
17
+ 512,
18
+ 512
19
+ ],
20
+ "cap_feat_dim": 2560,
21
+ "dim": 3840,
22
+ "in_channels": 16,
23
+ "n_heads": 30,
24
+ "n_kv_heads": 30,
25
+ "n_layers": 30,
26
+ "n_refiner_layers": 2,
27
+ "norm_eps": 1e-05,
28
+ "qk_norm": true,
29
+ "rope_theta": 256.0,
30
+ "t_scale": 1000.0,
31
+ "quantization_config": {
32
+ "quant_method": "nunchaku_lite",
33
+ "compute_dtype": "bfloat16",
34
+ "svdq_w4a4": {
35
+ "precision": "int4",
36
+ "group_size": 64,
37
+ "rank": 32,
38
+ "targets": [
39
+ "context_refiner.0.attention.to_k",
40
+ "context_refiner.0.attention.to_out.0",
41
+ "context_refiner.0.attention.to_q",
42
+ "context_refiner.0.attention.to_v",
43
+ "context_refiner.0.feed_forward.w1",
44
+ "context_refiner.0.feed_forward.w2",
45
+ "context_refiner.0.feed_forward.w3",
46
+ "context_refiner.1.attention.to_k",
47
+ "context_refiner.1.attention.to_out.0",
48
+ "context_refiner.1.attention.to_q",
49
+ "context_refiner.1.attention.to_v",
50
+ "context_refiner.1.feed_forward.w1",
51
+ "context_refiner.1.feed_forward.w2",
52
+ "context_refiner.1.feed_forward.w3",
53
+ "layers.0.attention.to_k",
54
+ "layers.0.attention.to_out.0",
55
+ "layers.0.attention.to_q",
56
+ "layers.0.attention.to_v",
57
+ "layers.0.feed_forward.w1",
58
+ "layers.0.feed_forward.w2",
59
+ "layers.0.feed_forward.w3",
60
+ "layers.1.attention.to_k",
61
+ "layers.1.attention.to_out.0",
62
+ "layers.1.attention.to_q",
63
+ "layers.1.attention.to_v",
64
+ "layers.1.feed_forward.w1",
65
+ "layers.1.feed_forward.w2",
66
+ "layers.1.feed_forward.w3",
67
+ "layers.10.attention.to_k",
68
+ "layers.10.attention.to_out.0",
69
+ "layers.10.attention.to_q",
70
+ "layers.10.attention.to_v",
71
+ "layers.10.feed_forward.w1",
72
+ "layers.10.feed_forward.w2",
73
+ "layers.10.feed_forward.w3",
74
+ "layers.11.attention.to_k",
75
+ "layers.11.attention.to_out.0",
76
+ "layers.11.attention.to_q",
77
+ "layers.11.attention.to_v",
78
+ "layers.11.feed_forward.w1",
79
+ "layers.11.feed_forward.w2",
80
+ "layers.11.feed_forward.w3",
81
+ "layers.12.attention.to_k",
82
+ "layers.12.attention.to_out.0",
83
+ "layers.12.attention.to_q",
84
+ "layers.12.attention.to_v",
85
+ "layers.12.feed_forward.w1",
86
+ "layers.12.feed_forward.w2",
87
+ "layers.12.feed_forward.w3",
88
+ "layers.13.attention.to_k",
89
+ "layers.13.attention.to_out.0",
90
+ "layers.13.attention.to_q",
91
+ "layers.13.attention.to_v",
92
+ "layers.13.feed_forward.w1",
93
+ "layers.13.feed_forward.w2",
94
+ "layers.13.feed_forward.w3",
95
+ "layers.14.attention.to_k",
96
+ "layers.14.attention.to_out.0",
97
+ "layers.14.attention.to_q",
98
+ "layers.14.attention.to_v",
99
+ "layers.14.feed_forward.w1",
100
+ "layers.14.feed_forward.w2",
101
+ "layers.14.feed_forward.w3",
102
+ "layers.15.attention.to_k",
103
+ "layers.15.attention.to_out.0",
104
+ "layers.15.attention.to_q",
105
+ "layers.15.attention.to_v",
106
+ "layers.15.feed_forward.w1",
107
+ "layers.15.feed_forward.w2",
108
+ "layers.15.feed_forward.w3",
109
+ "layers.16.attention.to_k",
110
+ "layers.16.attention.to_out.0",
111
+ "layers.16.attention.to_q",
112
+ "layers.16.attention.to_v",
113
+ "layers.16.feed_forward.w1",
114
+ "layers.16.feed_forward.w2",
115
+ "layers.16.feed_forward.w3",
116
+ "layers.17.attention.to_k",
117
+ "layers.17.attention.to_out.0",
118
+ "layers.17.attention.to_q",
119
+ "layers.17.attention.to_v",
120
+ "layers.17.feed_forward.w1",
121
+ "layers.17.feed_forward.w2",
122
+ "layers.17.feed_forward.w3",
123
+ "layers.18.attention.to_k",
124
+ "layers.18.attention.to_out.0",
125
+ "layers.18.attention.to_q",
126
+ "layers.18.attention.to_v",
127
+ "layers.18.feed_forward.w1",
128
+ "layers.18.feed_forward.w2",
129
+ "layers.18.feed_forward.w3",
130
+ "layers.19.attention.to_k",
131
+ "layers.19.attention.to_out.0",
132
+ "layers.19.attention.to_q",
133
+ "layers.19.attention.to_v",
134
+ "layers.19.feed_forward.w1",
135
+ "layers.19.feed_forward.w2",
136
+ "layers.19.feed_forward.w3",
137
+ "layers.2.attention.to_k",
138
+ "layers.2.attention.to_out.0",
139
+ "layers.2.attention.to_q",
140
+ "layers.2.attention.to_v",
141
+ "layers.2.feed_forward.w1",
142
+ "layers.2.feed_forward.w2",
143
+ "layers.2.feed_forward.w3",
144
+ "layers.20.attention.to_k",
145
+ "layers.20.attention.to_out.0",
146
+ "layers.20.attention.to_q",
147
+ "layers.20.attention.to_v",
148
+ "layers.20.feed_forward.w1",
149
+ "layers.20.feed_forward.w2",
150
+ "layers.20.feed_forward.w3",
151
+ "layers.21.attention.to_k",
152
+ "layers.21.attention.to_out.0",
153
+ "layers.21.attention.to_q",
154
+ "layers.21.attention.to_v",
155
+ "layers.21.feed_forward.w1",
156
+ "layers.21.feed_forward.w2",
157
+ "layers.21.feed_forward.w3",
158
+ "layers.22.attention.to_k",
159
+ "layers.22.attention.to_out.0",
160
+ "layers.22.attention.to_q",
161
+ "layers.22.attention.to_v",
162
+ "layers.22.feed_forward.w1",
163
+ "layers.22.feed_forward.w2",
164
+ "layers.22.feed_forward.w3",
165
+ "layers.23.attention.to_k",
166
+ "layers.23.attention.to_out.0",
167
+ "layers.23.attention.to_q",
168
+ "layers.23.attention.to_v",
169
+ "layers.23.feed_forward.w1",
170
+ "layers.23.feed_forward.w2",
171
+ "layers.23.feed_forward.w3",
172
+ "layers.24.attention.to_k",
173
+ "layers.24.attention.to_out.0",
174
+ "layers.24.attention.to_q",
175
+ "layers.24.attention.to_v",
176
+ "layers.24.feed_forward.w1",
177
+ "layers.24.feed_forward.w2",
178
+ "layers.24.feed_forward.w3",
179
+ "layers.25.attention.to_k",
180
+ "layers.25.attention.to_out.0",
181
+ "layers.25.attention.to_q",
182
+ "layers.25.attention.to_v",
183
+ "layers.25.feed_forward.w1",
184
+ "layers.25.feed_forward.w2",
185
+ "layers.25.feed_forward.w3",
186
+ "layers.26.attention.to_k",
187
+ "layers.26.attention.to_out.0",
188
+ "layers.26.attention.to_q",
189
+ "layers.26.attention.to_v",
190
+ "layers.26.feed_forward.w1",
191
+ "layers.26.feed_forward.w2",
192
+ "layers.26.feed_forward.w3",
193
+ "layers.27.attention.to_k",
194
+ "layers.27.attention.to_out.0",
195
+ "layers.27.attention.to_q",
196
+ "layers.27.attention.to_v",
197
+ "layers.27.feed_forward.w1",
198
+ "layers.27.feed_forward.w2",
199
+ "layers.27.feed_forward.w3",
200
+ "layers.28.attention.to_k",
201
+ "layers.28.attention.to_out.0",
202
+ "layers.28.attention.to_q",
203
+ "layers.28.attention.to_v",
204
+ "layers.28.feed_forward.w1",
205
+ "layers.28.feed_forward.w2",
206
+ "layers.28.feed_forward.w3",
207
+ "layers.29.attention.to_k",
208
+ "layers.29.attention.to_out.0",
209
+ "layers.29.attention.to_q",
210
+ "layers.29.attention.to_v",
211
+ "layers.29.feed_forward.w1",
212
+ "layers.29.feed_forward.w2",
213
+ "layers.29.feed_forward.w3",
214
+ "layers.3.attention.to_k",
215
+ "layers.3.attention.to_out.0",
216
+ "layers.3.attention.to_q",
217
+ "layers.3.attention.to_v",
218
+ "layers.3.feed_forward.w1",
219
+ "layers.3.feed_forward.w2",
220
+ "layers.3.feed_forward.w3",
221
+ "layers.4.attention.to_k",
222
+ "layers.4.attention.to_out.0",
223
+ "layers.4.attention.to_q",
224
+ "layers.4.attention.to_v",
225
+ "layers.4.feed_forward.w1",
226
+ "layers.4.feed_forward.w2",
227
+ "layers.4.feed_forward.w3",
228
+ "layers.5.attention.to_k",
229
+ "layers.5.attention.to_out.0",
230
+ "layers.5.attention.to_q",
231
+ "layers.5.attention.to_v",
232
+ "layers.5.feed_forward.w1",
233
+ "layers.5.feed_forward.w2",
234
+ "layers.5.feed_forward.w3",
235
+ "layers.6.attention.to_k",
236
+ "layers.6.attention.to_out.0",
237
+ "layers.6.attention.to_q",
238
+ "layers.6.attention.to_v",
239
+ "layers.6.feed_forward.w1",
240
+ "layers.6.feed_forward.w2",
241
+ "layers.6.feed_forward.w3",
242
+ "layers.7.attention.to_k",
243
+ "layers.7.attention.to_out.0",
244
+ "layers.7.attention.to_q",
245
+ "layers.7.attention.to_v",
246
+ "layers.7.feed_forward.w1",
247
+ "layers.7.feed_forward.w2",
248
+ "layers.7.feed_forward.w3",
249
+ "layers.8.attention.to_k",
250
+ "layers.8.attention.to_out.0",
251
+ "layers.8.attention.to_q",
252
+ "layers.8.attention.to_v",
253
+ "layers.8.feed_forward.w1",
254
+ "layers.8.feed_forward.w2",
255
+ "layers.8.feed_forward.w3",
256
+ "layers.9.attention.to_k",
257
+ "layers.9.attention.to_out.0",
258
+ "layers.9.attention.to_q",
259
+ "layers.9.attention.to_v",
260
+ "layers.9.feed_forward.w1",
261
+ "layers.9.feed_forward.w2",
262
+ "layers.9.feed_forward.w3",
263
+ "noise_refiner.0.attention.to_k",
264
+ "noise_refiner.0.attention.to_out.0",
265
+ "noise_refiner.0.attention.to_q",
266
+ "noise_refiner.0.attention.to_v",
267
+ "noise_refiner.0.feed_forward.w1",
268
+ "noise_refiner.0.feed_forward.w2",
269
+ "noise_refiner.0.feed_forward.w3",
270
+ "noise_refiner.1.attention.to_k",
271
+ "noise_refiner.1.attention.to_out.0",
272
+ "noise_refiner.1.attention.to_q",
273
+ "noise_refiner.1.attention.to_v",
274
+ "noise_refiner.1.feed_forward.w1",
275
+ "noise_refiner.1.feed_forward.w2",
276
+ "noise_refiner.1.feed_forward.w3"
277
+ ]
278
+ }
279
+ }
280
+ }
transformer/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:093a286e6d8849ba15808221c37b43b16e6b5f5b40ecc0b6661e3027c488ec49
3
+ size 3634700712
vae/config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKL",
3
+ "_diffusers_version": "0.36.0.dev0",
4
+ "_name_or_path": "flux-dev",
5
+ "act_fn": "silu",
6
+ "block_out_channels": [
7
+ 128,
8
+ 256,
9
+ 512,
10
+ 512
11
+ ],
12
+ "down_block_types": [
13
+ "DownEncoderBlock2D",
14
+ "DownEncoderBlock2D",
15
+ "DownEncoderBlock2D",
16
+ "DownEncoderBlock2D"
17
+ ],
18
+ "force_upcast": true,
19
+ "in_channels": 3,
20
+ "latent_channels": 16,
21
+ "latents_mean": null,
22
+ "latents_std": null,
23
+ "layers_per_block": 2,
24
+ "mid_block_add_attention": true,
25
+ "norm_num_groups": 32,
26
+ "out_channels": 3,
27
+ "sample_size": 1024,
28
+ "scaling_factor": 0.3611,
29
+ "shift_factor": 0.1159,
30
+ "up_block_types": [
31
+ "UpDecoderBlock2D",
32
+ "UpDecoderBlock2D",
33
+ "UpDecoderBlock2D",
34
+ "UpDecoderBlock2D"
35
+ ],
36
+ "use_post_quant_conv": false,
37
+ "use_quant_conv": false
38
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5b59a26851551b67ae1fe58d32e76486e1e812def4696a4bea97f16604d40a3
3
+ size 167666902