Add tiny random Qwen-Image-2.1 (t2i + i2i, non-collapsing outputs)

#1
.gitattributes CHANGED
@@ -33,3 +33,4 @@ 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
+ processor/tokenizer.json filter=lfs diff=lfs merge=lfs -text
model_index.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "QwenImage21Pipeline",
3
+ "_diffusers_version": "0.41.0.dev0",
4
+ "processor": [
5
+ "transformers",
6
+ "Qwen3VLProcessor"
7
+ ],
8
+ "scheduler": [
9
+ "diffusers",
10
+ "FlowMatchEulerDiscreteScheduler"
11
+ ],
12
+ "text_encoder": [
13
+ "transformers",
14
+ "Qwen3VLForConditionalGeneration"
15
+ ],
16
+ "transformer": [
17
+ "diffusers",
18
+ "QwenImage21Transformer2DModel"
19
+ ],
20
+ "vae": [
21
+ "diffusers",
22
+ "AutoencoderKLQwenImage21"
23
+ ]
24
+ }
processor/chat_template.jinja ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {%- if messages[0].content is string %}
5
+ {{- messages[0].content }}
6
+ {%- else %}
7
+ {%- for content in messages[0].content %}
8
+ {%- if 'text' in content %}
9
+ {{- content.text }}
10
+ {%- endif %}
11
+ {%- endfor %}
12
+ {%- endif %}
13
+ {{- '\n\n' }}
14
+ {%- endif %}
15
+ {{- "# 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>" }}
16
+ {%- for tool in tools %}
17
+ {{- "\n" }}
18
+ {{- tool | tojson }}
19
+ {%- endfor %}
20
+ {{- "\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" }}
21
+ {%- else %}
22
+ {%- if messages[0].role == 'system' %}
23
+ {{- '<|im_start|>system\n' }}
24
+ {%- if messages[0].content is string %}
25
+ {{- messages[0].content }}
26
+ {%- else %}
27
+ {%- for content in messages[0].content %}
28
+ {%- if 'text' in content %}
29
+ {{- content.text }}
30
+ {%- endif %}
31
+ {%- endfor %}
32
+ {%- endif %}
33
+ {{- '<|im_end|>\n' }}
34
+ {%- endif %}
35
+ {%- endif %}
36
+ {%- set image_count = namespace(value=0) %}
37
+ {%- set video_count = namespace(value=0) %}
38
+ {%- for message in messages %}
39
+ {%- if message.role == "user" %}
40
+ {{- '<|im_start|>' + message.role + '\n' }}
41
+ {%- if message.content is string %}
42
+ {{- message.content }}
43
+ {%- else %}
44
+ {%- for content in message.content %}
45
+ {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
46
+ {%- set image_count.value = image_count.value + 1 %}
47
+ {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
48
+ <|vision_start|><|image_pad|><|vision_end|>
49
+ {%- elif content.type == 'video' or 'video' in content %}
50
+ {%- set video_count.value = video_count.value + 1 %}
51
+ {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
52
+ <|vision_start|><|video_pad|><|vision_end|>
53
+ {%- elif 'text' in content %}
54
+ {{- content.text }}
55
+ {%- endif %}
56
+ {%- endfor %}
57
+ {%- endif %}
58
+ {{- '<|im_end|>\n' }}
59
+ {%- elif message.role == "assistant" %}
60
+ {{- '<|im_start|>' + message.role + '\n' }}
61
+ {%- if message.content is string %}
62
+ {{- message.content }}
63
+ {%- else %}
64
+ {%- for content_item in message.content %}
65
+ {%- if 'text' in content_item %}
66
+ {{- content_item.text }}
67
+ {%- endif %}
68
+ {%- endfor %}
69
+ {%- endif %}
70
+ {%- if message.tool_calls %}
71
+ {%- for tool_call in message.tool_calls %}
72
+ {%- if (loop.first and message.content) or (not loop.first) %}
73
+ {{- '\n' }}
74
+ {%- endif %}
75
+ {%- if tool_call.function %}
76
+ {%- set tool_call = tool_call.function %}
77
+ {%- endif %}
78
+ {{- '<tool_call>\n{"name": "' }}
79
+ {{- tool_call.name }}
80
+ {{- '", "arguments": ' }}
81
+ {%- if tool_call.arguments is string %}
82
+ {{- tool_call.arguments }}
83
+ {%- else %}
84
+ {{- tool_call.arguments | tojson }}
85
+ {%- endif %}
86
+ {{- '}\n</tool_call>' }}
87
+ {%- endfor %}
88
+ {%- endif %}
89
+ {{- '<|im_end|>\n' }}
90
+ {%- elif message.role == "tool" %}
91
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
92
+ {{- '<|im_start|>user' }}
93
+ {%- endif %}
94
+ {{- '\n<tool_response>\n' }}
95
+ {%- if message.content is string %}
96
+ {{- message.content }}
97
+ {%- else %}
98
+ {%- for content in message.content %}
99
+ {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
100
+ {%- set image_count.value = image_count.value + 1 %}
101
+ {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
102
+ <|vision_start|><|image_pad|><|vision_end|>
103
+ {%- elif content.type == 'video' or 'video' in content %}
104
+ {%- set video_count.value = video_count.value + 1 %}
105
+ {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
106
+ <|vision_start|><|video_pad|><|vision_end|>
107
+ {%- elif 'text' in content %}
108
+ {{- content.text }}
109
+ {%- endif %}
110
+ {%- endfor %}
111
+ {%- endif %}
112
+ {{- '\n</tool_response>' }}
113
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
114
+ {{- '<|im_end|>\n' }}
115
+ {%- endif %}
116
+ {%- endif %}
117
+ {%- endfor %}
118
+ {%- if add_generation_prompt %}
119
+ {{- '<|im_start|>assistant\n' }}
120
+ {%- endif %}
processor/processor_config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "data_format": "channels_first",
4
+ "default_to_square": true,
5
+ "do_convert_rgb": true,
6
+ "do_normalize": true,
7
+ "do_rescale": true,
8
+ "do_resize": true,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_processor_type": "Qwen2VLImageProcessor",
15
+ "image_std": [
16
+ 0.5,
17
+ 0.5,
18
+ 0.5
19
+ ],
20
+ "merge_size": 2,
21
+ "patch_size": 16,
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "longest_edge": 16777216,
26
+ "shortest_edge": 65536
27
+ },
28
+ "temporal_patch_size": 2
29
+ },
30
+ "processor_class": "Qwen3VLProcessor",
31
+ "video_processor": {
32
+ "data_format": "channels_first",
33
+ "default_to_square": true,
34
+ "do_convert_rgb": true,
35
+ "do_normalize": true,
36
+ "do_rescale": true,
37
+ "do_resize": true,
38
+ "do_sample_frames": true,
39
+ "fps": 2,
40
+ "image_mean": [
41
+ 0.5,
42
+ 0.5,
43
+ 0.5
44
+ ],
45
+ "image_std": [
46
+ 0.5,
47
+ 0.5,
48
+ 0.5
49
+ ],
50
+ "max_frames": 768,
51
+ "merge_size": 2,
52
+ "min_frames": 4,
53
+ "patch_size": 16,
54
+ "resample": 3,
55
+ "rescale_factor": 0.00392156862745098,
56
+ "return_metadata": false,
57
+ "size": {
58
+ "longest_edge": 25165824,
59
+ "shortest_edge": 4096
60
+ },
61
+ "temporal_patch_size": 2,
62
+ "video_processor_type": "Qwen3VLVideoProcessor"
63
+ }
64
+ }
processor/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
3
+ size 11422650
processor/tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "is_local": true,
9
+ "local_files_only": true,
10
+ "model_max_length": 262144,
11
+ "pad_token": "<|endoftext|>",
12
+ "processor_class": "Qwen3VLProcessor",
13
+ "split_special_tokens": false,
14
+ "tokenizer_class": "Qwen2Tokenizer",
15
+ "unk_token": null
16
+ }
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "FlowMatchEulerDiscreteScheduler",
3
+ "_diffusers_version": "0.41.0.dev0",
4
+ "base_image_seq_len": 256,
5
+ "base_shift": 0.5,
6
+ "invert_sigmas": false,
7
+ "max_image_seq_len": 8192,
8
+ "max_shift": 0.9,
9
+ "num_train_timesteps": 1000,
10
+ "shift": 1.0,
11
+ "shift_terminal": 0.02,
12
+ "stochastic_sampling": false,
13
+ "time_shift_type": "exponential",
14
+ "use_beta_sigmas": false,
15
+ "use_dynamic_shifting": true,
16
+ "use_exponential_sigmas": false,
17
+ "use_karras_sigmas": false
18
+ }
text_encoder/config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3VLForConditionalGeneration"
4
+ ],
5
+ "dtype": "float32",
6
+ "image_token_id": 151655,
7
+ "model_type": "qwen3_vl",
8
+ "text_config": {
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "bos_token_id": 151643,
12
+ "eos_token_id": 151645,
13
+ "head_dim": 8,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 16,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 32,
18
+ "max_position_embeddings": 262144,
19
+ "model_type": "qwen3_vl_text",
20
+ "num_attention_heads": 2,
21
+ "num_hidden_layers": 2,
22
+ "num_key_value_heads": 1,
23
+ "pad_token_id": null,
24
+ "rms_norm_eps": 1e-06,
25
+ "rope_parameters": {
26
+ "mrope_interleaved": true,
27
+ "mrope_section": [
28
+ 2,
29
+ 1,
30
+ 1
31
+ ],
32
+ "rope_theta": 5000000,
33
+ "rope_type": "default"
34
+ },
35
+ "use_cache": true,
36
+ "vocab_size": 151936
37
+ },
38
+ "tie_word_embeddings": true,
39
+ "transformers_version": "5.10.4",
40
+ "video_token_id": 151656,
41
+ "vision_config": {
42
+ "deepstack_visual_indexes": [
43
+ 0,
44
+ 1,
45
+ 2
46
+ ],
47
+ "depth": 3,
48
+ "hidden_act": "gelu_pytorch_tanh",
49
+ "hidden_size": 16,
50
+ "in_channels": 3,
51
+ "initializer_range": 0.02,
52
+ "intermediate_size": 32,
53
+ "model_type": "qwen3_vl_vision",
54
+ "num_heads": 2,
55
+ "num_position_embeddings": 2304,
56
+ "out_hidden_size": 16,
57
+ "patch_size": 16,
58
+ "spatial_merge_size": 2,
59
+ "temporal_patch_size": 2
60
+ },
61
+ "vision_end_token_id": 151653,
62
+ "vision_start_token_id": 151652
63
+ }
text_encoder/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 151643,
4
+ "eos_token_id": 151645,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "transformers_version": "5.10.4",
8
+ "use_cache": true
9
+ }
text_encoder/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51e2948a80852a8985b37cd35939207cdb066df20fde5cad392fd0c6aa6c4150
3
+ size 10109760
transformer/config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "QwenImage21Transformer2DModel",
3
+ "_diffusers_version": "0.41.0.dev0",
4
+ "attention_head_dim": 16,
5
+ "axes_dims_rope": [
6
+ 4,
7
+ 6,
8
+ 6
9
+ ],
10
+ "causal_condition": true,
11
+ "context_in_dim": 16,
12
+ "eps": 1e-06,
13
+ "in_channels": 64,
14
+ "mlp_ratio": 3,
15
+ "num_attention_heads": 2,
16
+ "num_layers": 2,
17
+ "out_channels": 64,
18
+ "patch_size": 1
19
+ }
transformer/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c571d7b4489f1c3f78afc53f50f8f28e248d2ba0e63b29650413795739bf133
3
+ size 189416
vae/config.json ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKLQwenImage21",
3
+ "_diffusers_version": "0.41.0.dev0",
4
+ "attn_scales": [],
5
+ "base_dim": 8,
6
+ "decoder_base_dim": 8,
7
+ "dim_mult": [
8
+ 1,
9
+ 2,
10
+ 4,
11
+ 8,
12
+ 8
13
+ ],
14
+ "dropout": 0.0,
15
+ "in_channels": 4,
16
+ "is_residual": true,
17
+ "latents_mean": [
18
+ 0.5126,
19
+ 0.7721,
20
+ -0.0631,
21
+ 1.3506,
22
+ -0.7855,
23
+ -2.1025,
24
+ -0.3458,
25
+ 1.3722,
26
+ 1.8873,
27
+ -1.7177,
28
+ -0.651,
29
+ 0.2732,
30
+ 0.7562,
31
+ -0.6163,
32
+ -1.0277,
33
+ 3.8363,
34
+ 2.021,
35
+ 0.0472,
36
+ 0.932,
37
+ 2.0087,
38
+ 2.4954,
39
+ -0.1391,
40
+ -1.4249,
41
+ 1.8464,
42
+ -0.5236,
43
+ 1.2826,
44
+ 3.7046,
45
+ -1.3035,
46
+ 2.7286,
47
+ -1.4518,
48
+ -1.9036,
49
+ -1.9955,
50
+ -0.0342,
51
+ -1.0265,
52
+ -0.7636,
53
+ 3.0555,
54
+ 0.0746,
55
+ -3.0751,
56
+ -0.1076,
57
+ 1.7376,
58
+ -1.0914,
59
+ -1.9435,
60
+ -0.2784,
61
+ -1.368,
62
+ 0.4809,
63
+ -0.4433,
64
+ 0.3764,
65
+ 0.5729,
66
+ -2.0595,
67
+ 1.096,
68
+ -1.326,
69
+ -2.0211,
70
+ -5.0179,
71
+ 0.5275,
72
+ 4.0162,
73
+ 1.8505,
74
+ 0.3026,
75
+ 1.9373,
76
+ 1.4937,
77
+ 0.2632,
78
+ 0.5547,
79
+ -1.7121,
80
+ -0.1562,
81
+ 0.0304
82
+ ],
83
+ "latents_std": [
84
+ 3.2001,
85
+ 3.2936,
86
+ 3.4321,
87
+ 3.0091,
88
+ 3.1061,
89
+ 4.0379,
90
+ 4.0705,
91
+ 3.791,
92
+ 3.0785,
93
+ 3.65,
94
+ 3.9308,
95
+ 3.0904,
96
+ 2.8778,
97
+ 3.7675,
98
+ 3.732,
99
+ 5.0756,
100
+ 3.2864,
101
+ 4.0397,
102
+ 3.1317,
103
+ 4.0443,
104
+ 2.9249,
105
+ 3.9454,
106
+ 3.0988,
107
+ 4.2489,
108
+ 3.4896,
109
+ 3.8513,
110
+ 3.9323,
111
+ 3.4719,
112
+ 3.7498,
113
+ 4.283,
114
+ 3.5694,
115
+ 4.2467,
116
+ 3.9037,
117
+ 3.2947,
118
+ 5.077,
119
+ 3.5075,
120
+ 3.27,
121
+ 3.4767,
122
+ 2.8063,
123
+ 5.1125,
124
+ 3.5327,
125
+ 4.7833,
126
+ 3.1286,
127
+ 4.1819,
128
+ 3.8527,
129
+ 3.8312,
130
+ 3.5605,
131
+ 4.3875,
132
+ 3.9624,
133
+ 4.0168,
134
+ 3.5643,
135
+ 4.055,
136
+ 5.5614,
137
+ 4.2963,
138
+ 4.408,
139
+ 3.4959,
140
+ 3.8747,
141
+ 3.7608,
142
+ 3.5735,
143
+ 3.149,
144
+ 3.7662,
145
+ 3.6746,
146
+ 3.4563,
147
+ 3.8161
148
+ ],
149
+ "num_res_blocks": 1,
150
+ "out_channels": 4,
151
+ "patch_size": null,
152
+ "scale_factor_spatial": 8,
153
+ "scale_factor_temporal": 8,
154
+ "temperal_downsample": [
155
+ false,
156
+ true,
157
+ true,
158
+ true
159
+ ],
160
+ "z_dim": 64
161
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6d9c2a41b8fc23a724ed0871cff7b0f6a7128ff75c48ac5472b42ff4f682c14
3
+ size 4542792