AliceKJ commited on
Commit
9c1b82c
·
verified ·
1 Parent(s): 9cefe8e

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -33,3 +33,13 @@ 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
+ tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ examples/ex3_concept.png filter=lfs diff=lfs merge=lfs -text
38
+ examples/ex2_preview.png filter=lfs diff=lfs merge=lfs -text
39
+ examples/ex1_preview.png filter=lfs diff=lfs merge=lfs -text
40
+ examples/ex2_skin.png filter=lfs diff=lfs merge=lfs -text
41
+ examples/ex3_skin.png filter=lfs diff=lfs merge=lfs -text
42
+ examples/ex3_preview.png filter=lfs diff=lfs merge=lfs -text
43
+ examples/ex2_concept.png filter=lfs diff=lfs merge=lfs -text
44
+ examples/ex1_concept.png filter=lfs diff=lfs merge=lfs -text
45
+ examples/ex1_skin.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BLOCKv0.5
2
+
3
+ BLOCKv0.5 is an image-to-image model for converting a **3D Minecraft character preview** into a **2D skin texture file**.
4
+
5
+ It is based on `black-forest-labs/FLUX.2-klein-base-9B` with merged LoRA weights and was trained with **[cond, target]** token order.
6
+ For best results, use the included custom pipeline: `Flux2KleinPipelineTrainOrder`.
7
+
8
+ ## What This Model Does
9
+
10
+ - Input: a character preview image (RGB, square recommended)
11
+ - Optional control: text prompt for style/details
12
+ - Output: a generated skin texture image (PNG)
13
+
14
+ ## Quick Start
15
+
16
+ ```python
17
+ import torch
18
+ from PIL import Image
19
+ from pipeline_flux2_klein_train_order import Flux2KleinPipelineTrainOrder
20
+
21
+ model_id = "your-username/BLOCKv0.5" # or local path
22
+
23
+ pipe = Flux2KleinPipelineTrainOrder.from_pretrained(
24
+ model_id,
25
+ torch_dtype=torch.bfloat16,
26
+ )
27
+ pipe.to("cuda")
28
+
29
+ preview = Image.open("examples/ex1_preview.png").convert("RGB").resize((1024, 1024))
30
+
31
+ result = pipe(
32
+ prompt="clean minecraft skin texture, readable details, game-ready layout",
33
+ image=preview,
34
+ num_inference_steps=30,
35
+ guidance_scale=4.0,
36
+ ).images[0]
37
+
38
+ result.save("generated_skin.png")
39
+ ```
40
+
41
+ ## Example Results
42
+
43
+ | Preview | Generated Skin |
44
+ |---|---|
45
+ | ![ex1 preview](examples/ex1_preview.png) | ![ex1 skin](examples/ex1_skin.png) |
46
+ | ![ex2 preview](examples/ex2_preview.png) | ![ex2 skin](examples/ex2_skin.png) |
47
+ | ![ex3 preview](examples/ex3_preview.png) | ![ex3 skin](examples/ex3_skin.png) |
48
+
49
+ ## Notes
50
+
51
+ - This checkpoint is designed for img2img skin generation, not general text-to-image generation.
52
+ - The included custom pipeline matches the training token order and is recommended for inference.
53
+ - The model is large; use a high-memory GPU for practical inference speed.
54
+
55
+ ## Dependencies
56
+
57
+ - diffusers
58
+ - transformers
59
+ - torch
60
+ - safetensors
examples/ex1_concept.png ADDED

Git LFS Details

  • SHA256: 10daec0242574b9f1579a230c17b3a569018ce0e73adfe0dd5bcb692ae656d01
  • Pointer size: 131 Bytes
  • Size of remote file: 117 kB
examples/ex1_preview.png ADDED

Git LFS Details

  • SHA256: e620254325d1a5231ff210820ddcbec77b3a292f37ac510e351a8103ab7a97e2
  • Pointer size: 131 Bytes
  • Size of remote file: 460 kB
examples/ex1_skin.png ADDED

Git LFS Details

  • SHA256: 3d1fde8948037e1c62e3c66b3e61fb03458f05833aa84ed79650ea8e46b75b68
  • Pointer size: 131 Bytes
  • Size of remote file: 276 kB
examples/ex2_concept.png ADDED

Git LFS Details

  • SHA256: 3087574726ef834707c6728314c1693a8897151641b557a19c5032fef7485cd9
  • Pointer size: 131 Bytes
  • Size of remote file: 298 kB
examples/ex2_preview.png ADDED

Git LFS Details

  • SHA256: e3e92041883ecfe6eda7eb753803e0599435b715bcbb1b8e78b0affdade38270
  • Pointer size: 131 Bytes
  • Size of remote file: 718 kB
examples/ex2_skin.png ADDED

Git LFS Details

  • SHA256: dff747a1c5aef7a8a0235898953e5b76d33c8b4b5f96695a2d07d090258525de
  • Pointer size: 131 Bytes
  • Size of remote file: 344 kB
examples/ex3_concept.png ADDED

Git LFS Details

  • SHA256: 317bd2579df0ec4a6be4163ff775dde75b363a4121a44052b04d39b9c30cfb6d
  • Pointer size: 131 Bytes
  • Size of remote file: 192 kB
examples/ex3_preview.png ADDED

Git LFS Details

  • SHA256: 006ffd46c709b73f48da335dd20746638f665f058c1f8ea7e7b04ecc7719a808
  • Pointer size: 131 Bytes
  • Size of remote file: 104 kB
examples/ex3_skin.png ADDED

Git LFS Details

  • SHA256: 4c817794e5d741a131fe7eb910721467e93eef166e4db59ca4d60bd2f4536173
  • Pointer size: 131 Bytes
  • Size of remote file: 274 kB
model_index.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "Flux2KleinPipeline",
3
+ "_diffusers_version": "0.37.0.dev0",
4
+ "_name_or_path": "black-forest-labs/FLUX.2-klein-base-9B",
5
+ "is_distilled": false,
6
+ "scheduler": [
7
+ "diffusers",
8
+ "FlowMatchEulerDiscreteScheduler"
9
+ ],
10
+ "text_encoder": [
11
+ "transformers",
12
+ "Qwen3ForCausalLM"
13
+ ],
14
+ "tokenizer": [
15
+ "transformers",
16
+ "Qwen2Tokenizer"
17
+ ],
18
+ "transformer": [
19
+ "diffusers",
20
+ "Flux2Transformer2DModel"
21
+ ],
22
+ "vae": [
23
+ "diffusers",
24
+ "AutoencoderKLFlux2"
25
+ ]
26
+ }
pipeline_flux2_klein_train_order.py ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2025 GenMC. Custom pipeline for [cond, target] token order (aligned with BLOCKv0.5 training).
2
+ #
3
+ # This pipeline overrides Flux2KleinPipeline's img2img behavior:
4
+ # - Default: [target, cond], output first part
5
+ # - Ours: [cond, target], output last part
6
+ #
7
+ # Use: pipe = Flux2KleinPipelineTrainOrder.from_pretrained("path/to/BLOCKv0.5")
8
+ # image = pipe(prompt="...", image=cond_img).images[0]
9
+
10
+ import contextlib
11
+ import numpy as np
12
+ import torch
13
+ from PIL import Image
14
+
15
+ from diffusers import Flux2KleinPipeline
16
+ from diffusers.pipelines.flux2.pipeline_flux2_klein import compute_empirical_mu, retrieve_timesteps
17
+ from diffusers.pipelines.flux2.pipeline_output import Flux2PipelineOutput
18
+
19
+
20
+ def _maybe_cache_context(model, name: str):
21
+ fn = getattr(model, "cache_context", None)
22
+ if fn is None:
23
+ return contextlib.nullcontext()
24
+ return fn(name)
25
+
26
+
27
+ class Flux2KleinPipelineTrainOrder(Flux2KleinPipeline):
28
+ """
29
+ Flux2KleinPipeline with [cond, target] token order for img2img (aligned with BLOCKv0.5 training).
30
+ When image is provided, uses train-order concat and output slicing.
31
+ """
32
+
33
+ @torch.no_grad()
34
+ def __call__(self, image=None, **kwargs):
35
+ if image is not None:
36
+ return self._call_img2img_train_order(image=image, **kwargs)
37
+ return super().__call__(image=image, **kwargs)
38
+
39
+ def _call_img2img_train_order(
40
+ self,
41
+ image,
42
+ prompt=None,
43
+ height=None,
44
+ width=None,
45
+ num_inference_steps=50,
46
+ guidance_scale=4.0,
47
+ generator=None,
48
+ **kwargs,
49
+ ):
50
+ """Img2img with [cond, target] order. Mirrors flux2_infer.generate_img2img_train_order."""
51
+ device = self._execution_device
52
+ tf_dtype = self.transformer.dtype
53
+ vae_dtype = self.vae.dtype
54
+
55
+ if not isinstance(image, list):
56
+ image = [image]
57
+ self.check_inputs(prompt=prompt, height=height, width=width, guidance_scale=guidance_scale)
58
+ self._guidance_scale = guidance_scale
59
+ self._attention_kwargs = kwargs.get("attention_kwargs")
60
+
61
+ batch_size = 1 if isinstance(prompt, str) else len(prompt)
62
+ prompt_embeds, text_ids = self.encode_prompt(prompt=prompt, device=device)
63
+ prompt_embeds = prompt_embeds.to(device=device, dtype=tf_dtype)
64
+ text_ids = text_ids.to(device=device)
65
+
66
+ do_cfg = (guidance_scale is not None) and (float(guidance_scale) > 1.0)
67
+ if do_cfg:
68
+ neg_embeds, neg_text_ids = self.encode_prompt(prompt="", device=device)
69
+ neg_embeds = neg_embeds.to(device=device, dtype=tf_dtype)
70
+ neg_text_ids = neg_text_ids.to(device=device)
71
+
72
+ # Preprocess cond image
73
+ img = image[0]
74
+ if hasattr(img, "size"):
75
+ h, w = height or img.size[1], width or img.size[0]
76
+ else:
77
+ h, w = height or 512, width or 512
78
+ cond_tensor = self.image_processor.preprocess(
79
+ img, height=h, width=w, resize_mode="crop"
80
+ ).to(device=device, dtype=vae_dtype)
81
+ image_latents, image_latent_ids = self.prepare_image_latents(
82
+ images=[cond_tensor], batch_size=batch_size, generator=generator, device=device, dtype=vae_dtype
83
+ )
84
+ image_latents = image_latents.to(device=device, dtype=tf_dtype)
85
+ image_latent_ids = image_latent_ids.clone()
86
+ image_latent_ids[..., 0] = 0 # cond t_index=0
87
+
88
+ # Init target latents
89
+ num_channels_latents = self.transformer.config.in_channels // 4
90
+ latents, latent_ids = self.prepare_latents(
91
+ batch_size=batch_size,
92
+ num_latents_channels=num_channels_latents,
93
+ height=h,
94
+ width=w,
95
+ dtype=vae_dtype,
96
+ device=device,
97
+ generator=generator,
98
+ latents=None,
99
+ )
100
+ latents = latents.to(device=device, dtype=tf_dtype)
101
+ latent_ids = latent_ids.clone()
102
+ latent_ids[..., 0] = 1 # target t_index=1
103
+
104
+ # Timesteps
105
+ sigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps)
106
+ if hasattr(self.scheduler.config, "use_flow_sigmas") and self.scheduler.config.use_flow_sigmas:
107
+ sigmas = None
108
+ mu = compute_empirical_mu(image_seq_len=latents.shape[1], num_steps=num_inference_steps)
109
+ timesteps, _ = retrieve_timesteps(self.scheduler, num_inference_steps, device, sigmas=sigmas, mu=mu)
110
+
111
+ if hasattr(self.scheduler, "set_begin_index"):
112
+ self.scheduler.set_begin_index(0)
113
+
114
+ attn_kwargs = getattr(self, "attention_kwargs", None) or getattr(self, "_attention_kwargs", None)
115
+
116
+ for t in timesteps:
117
+ timestep = t.expand(latents.shape[0]).to(latents.dtype)
118
+ latent_model_input = torch.cat([image_latents, latents], dim=1).to(tf_dtype)
119
+ latent_image_ids = torch.cat([image_latent_ids, latent_ids], dim=1)
120
+
121
+ with _maybe_cache_context(self.transformer, "cond"):
122
+ out_all = self.transformer(
123
+ hidden_states=latent_model_input,
124
+ timestep=timestep / 1000,
125
+ guidance=None,
126
+ encoder_hidden_states=prompt_embeds,
127
+ txt_ids=text_ids,
128
+ img_ids=latent_image_ids,
129
+ joint_attention_kwargs=attn_kwargs,
130
+ return_dict=False,
131
+ )[0]
132
+ noise_pred = out_all[:, -latents.size(1) :, :]
133
+
134
+ if do_cfg:
135
+ with _maybe_cache_context(self.transformer, "uncond"):
136
+ neg_all = self.transformer(
137
+ hidden_states=latent_model_input,
138
+ timestep=timestep / 1000,
139
+ guidance=None,
140
+ encoder_hidden_states=neg_embeds,
141
+ txt_ids=neg_text_ids,
142
+ img_ids=latent_image_ids,
143
+ joint_attention_kwargs=attn_kwargs,
144
+ return_dict=False,
145
+ )[0]
146
+ neg_pred = neg_all[:, -latents.size(1) :, :]
147
+ noise_pred = neg_pred + float(guidance_scale) * (noise_pred - neg_pred)
148
+
149
+ latents = self.scheduler.step(noise_pred, t, latents, return_dict=False)[0]
150
+
151
+ latents = self._unpack_latents_with_ids(latents, latent_ids)
152
+ latents_bn_mean = self.vae.bn.running_mean.view(1, -1, 1, 1).to(latents.device, latents.dtype)
153
+ latents_bn_std = torch.sqrt(
154
+ self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps
155
+ ).to(latents.device, latents.dtype)
156
+ latents = latents * latents_bn_std + latents_bn_mean
157
+ latents = self._unpatchify_latents(latents)
158
+ if latents.dtype != self.vae.dtype:
159
+ latents = latents.to(self.vae.dtype)
160
+ image_out = self.vae.decode(latents, return_dict=False)[0]
161
+ image_out = self.image_processor.postprocess(image_out, output_type="pil")
162
+ self.maybe_free_model_hooks()
163
+ return Flux2PipelineOutput(images=image_out)
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "FlowMatchEulerDiscreteScheduler",
3
+ "_diffusers_version": "0.37.0.dev0",
4
+ "base_image_seq_len": 256,
5
+ "base_shift": 0.5,
6
+ "invert_sigmas": false,
7
+ "max_image_seq_len": 4096,
8
+ "max_shift": 1.15,
9
+ "num_train_timesteps": 1000,
10
+ "shift": 3.0,
11
+ "shift_terminal": null,
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,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ForCausalLM"
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": 4096,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 12288,
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
+ "rms_norm_eps": 1e-06,
61
+ "rope_parameters": {
62
+ "rope_theta": 1000000,
63
+ "rope_type": "default"
64
+ },
65
+ "sliding_window": null,
66
+ "tie_word_embeddings": false,
67
+ "transformers_version": "5.2.0",
68
+ "use_cache": true,
69
+ "use_sliding_window": false,
70
+ "vocab_size": 151936
71
+ }
text_encoder/generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 151643,
4
+ "eos_token_id": 151645,
5
+ "transformers_version": "5.2.0",
6
+ "use_cache": true
7
+ }
text_encoder/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e620a91ee8ea327930fe1f64d26c16bb64445bede25a68a3b6f252df3490475
3
+ size 16381517208
tokenizer/chat_template.jinja ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# 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>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\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" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for message in messages[::-1] %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- 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>')) %}
21
+ {%- set ns.multi_step_tool = false %}
22
+ {%- set ns.last_query_index = index %}
23
+ {%- endif %}
24
+ {%- endfor %}
25
+ {%- for message in messages %}
26
+ {%- if message.content is string %}
27
+ {%- set content = message.content %}
28
+ {%- else %}
29
+ {%- set content = '' %}
30
+ {%- endif %}
31
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
32
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
33
+ {%- elif message.role == "assistant" %}
34
+ {%- set reasoning_content = '' %}
35
+ {%- if message.reasoning_content is string %}
36
+ {%- set reasoning_content = message.reasoning_content %}
37
+ {%- else %}
38
+ {%- if '</think>' in content %}
39
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
40
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- if loop.index0 > ns.last_query_index %}
44
+ {%- if loop.last or (not loop.last and reasoning_content) %}
45
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
46
+ {%- else %}
47
+ {{- '<|im_start|>' + message.role + '\n' + content }}
48
+ {%- endif %}
49
+ {%- else %}
50
+ {{- '<|im_start|>' + message.role + '\n' + content }}
51
+ {%- endif %}
52
+ {%- if message.tool_calls %}
53
+ {%- for tool_call in message.tool_calls %}
54
+ {%- if (loop.first and content) or (not loop.first) %}
55
+ {{- '\n' }}
56
+ {%- endif %}
57
+ {%- if tool_call.function %}
58
+ {%- set tool_call = tool_call.function %}
59
+ {%- endif %}
60
+ {{- '<tool_call>\n{"name": "' }}
61
+ {{- tool_call.name }}
62
+ {{- '", "arguments": ' }}
63
+ {%- if tool_call.arguments is string %}
64
+ {{- tool_call.arguments }}
65
+ {%- else %}
66
+ {{- tool_call.arguments | tojson }}
67
+ {%- endif %}
68
+ {{- '}\n</tool_call>' }}
69
+ {%- endfor %}
70
+ {%- endif %}
71
+ {{- '<|im_end|>\n' }}
72
+ {%- elif message.role == "tool" %}
73
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
74
+ {{- '<|im_start|>user' }}
75
+ {%- endif %}
76
+ {{- '\n<tool_response>\n' }}
77
+ {{- content }}
78
+ {{- '\n</tool_response>' }}
79
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
80
+ {{- '<|im_end|>\n' }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- endfor %}
84
+ {%- if add_generation_prompt %}
85
+ {{- '<|im_start|>assistant\n' }}
86
+ {%- if enable_thinking is defined and enable_thinking is false %}
87
+ {{- '<think>\n\n</think>\n\n' }}
88
+ {%- endif %}
89
+ {%- endif %}
tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
3
+ size 11422650
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "model_max_length": 131072,
10
+ "pad_token": "<|endoftext|>",
11
+ "split_special_tokens": false,
12
+ "tokenizer_class": "Qwen2Tokenizer",
13
+ "unk_token": null
14
+ }
transformer/config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "Flux2Transformer2DModel",
3
+ "_diffusers_version": "0.37.0.dev0",
4
+ "_name_or_path": "/home/guohq2021/.cache/huggingface/hub/models--black-forest-labs--FLUX.2-klein-base-9B/snapshots/32773329fbe7e81a90ef971740e8ba4b0364ecf3/transformer",
5
+ "attention_head_dim": 128,
6
+ "axes_dims_rope": [
7
+ 32,
8
+ 32,
9
+ 32,
10
+ 32
11
+ ],
12
+ "eps": 1e-06,
13
+ "guidance_embeds": false,
14
+ "in_channels": 128,
15
+ "joint_attention_dim": 12288,
16
+ "mlp_ratio": 3.0,
17
+ "num_attention_heads": 32,
18
+ "num_layers": 8,
19
+ "num_single_layers": 24,
20
+ "out_channels": null,
21
+ "patch_size": 1,
22
+ "rope_theta": 2000,
23
+ "timestep_guidance_channels": 256
24
+ }
transformer/diffusion_pytorch_model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7f7afa7c84dbc9b145964de7a75be3aea9ad07fe6137c8af11016390f84d7c5
3
+ size 9801069272
transformer/diffusion_pytorch_model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d891d8c65a14816e84148cb81d9455acd666f66ef703df497659ff0b1c1516ca
3
+ size 8356121608
transformer/diffusion_pytorch_model.safetensors.index.json ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 18157162496
4
+ },
5
+ "weight_map": {
6
+ "context_embedder.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
7
+ "double_stream_modulation_img.linear.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
8
+ "double_stream_modulation_txt.linear.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
9
+ "norm_out.linear.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
10
+ "proj_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
11
+ "single_stream_modulation.linear.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
12
+ "single_transformer_blocks.0.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
13
+ "single_transformer_blocks.0.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
14
+ "single_transformer_blocks.0.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
15
+ "single_transformer_blocks.0.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
16
+ "single_transformer_blocks.1.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
17
+ "single_transformer_blocks.1.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
18
+ "single_transformer_blocks.1.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
19
+ "single_transformer_blocks.1.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
20
+ "single_transformer_blocks.10.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
21
+ "single_transformer_blocks.10.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
22
+ "single_transformer_blocks.10.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
23
+ "single_transformer_blocks.10.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
24
+ "single_transformer_blocks.11.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
25
+ "single_transformer_blocks.11.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
26
+ "single_transformer_blocks.11.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
27
+ "single_transformer_blocks.11.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
28
+ "single_transformer_blocks.12.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
29
+ "single_transformer_blocks.12.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
30
+ "single_transformer_blocks.12.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
31
+ "single_transformer_blocks.12.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
32
+ "single_transformer_blocks.13.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
33
+ "single_transformer_blocks.13.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
34
+ "single_transformer_blocks.13.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
35
+ "single_transformer_blocks.13.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
36
+ "single_transformer_blocks.14.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
37
+ "single_transformer_blocks.14.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
38
+ "single_transformer_blocks.14.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
39
+ "single_transformer_blocks.14.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
40
+ "single_transformer_blocks.15.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
41
+ "single_transformer_blocks.15.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
42
+ "single_transformer_blocks.15.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
43
+ "single_transformer_blocks.15.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
44
+ "single_transformer_blocks.16.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
45
+ "single_transformer_blocks.16.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
46
+ "single_transformer_blocks.16.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
47
+ "single_transformer_blocks.16.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
48
+ "single_transformer_blocks.17.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
49
+ "single_transformer_blocks.17.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
50
+ "single_transformer_blocks.17.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
51
+ "single_transformer_blocks.17.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
52
+ "single_transformer_blocks.18.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
53
+ "single_transformer_blocks.18.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
54
+ "single_transformer_blocks.18.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
55
+ "single_transformer_blocks.18.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
56
+ "single_transformer_blocks.19.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
57
+ "single_transformer_blocks.19.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
58
+ "single_transformer_blocks.19.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
59
+ "single_transformer_blocks.19.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
60
+ "single_transformer_blocks.2.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
61
+ "single_transformer_blocks.2.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
62
+ "single_transformer_blocks.2.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
63
+ "single_transformer_blocks.2.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
64
+ "single_transformer_blocks.20.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
65
+ "single_transformer_blocks.20.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
66
+ "single_transformer_blocks.20.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
67
+ "single_transformer_blocks.20.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
68
+ "single_transformer_blocks.21.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
69
+ "single_transformer_blocks.21.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
70
+ "single_transformer_blocks.21.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
71
+ "single_transformer_blocks.21.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
72
+ "single_transformer_blocks.22.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
73
+ "single_transformer_blocks.22.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
74
+ "single_transformer_blocks.22.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
75
+ "single_transformer_blocks.22.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
76
+ "single_transformer_blocks.23.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
77
+ "single_transformer_blocks.23.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
78
+ "single_transformer_blocks.23.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
79
+ "single_transformer_blocks.23.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
80
+ "single_transformer_blocks.3.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
81
+ "single_transformer_blocks.3.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
82
+ "single_transformer_blocks.3.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
83
+ "single_transformer_blocks.3.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
84
+ "single_transformer_blocks.4.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
85
+ "single_transformer_blocks.4.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
86
+ "single_transformer_blocks.4.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
87
+ "single_transformer_blocks.4.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
88
+ "single_transformer_blocks.5.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
89
+ "single_transformer_blocks.5.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
90
+ "single_transformer_blocks.5.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
91
+ "single_transformer_blocks.5.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
92
+ "single_transformer_blocks.6.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
93
+ "single_transformer_blocks.6.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
94
+ "single_transformer_blocks.6.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
95
+ "single_transformer_blocks.6.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
96
+ "single_transformer_blocks.7.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
97
+ "single_transformer_blocks.7.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
98
+ "single_transformer_blocks.7.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
99
+ "single_transformer_blocks.7.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
100
+ "single_transformer_blocks.8.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
101
+ "single_transformer_blocks.8.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
102
+ "single_transformer_blocks.8.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
103
+ "single_transformer_blocks.8.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
104
+ "single_transformer_blocks.9.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
105
+ "single_transformer_blocks.9.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
106
+ "single_transformer_blocks.9.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
107
+ "single_transformer_blocks.9.attn.to_qkv_mlp_proj.weight": "diffusion_pytorch_model-00002-of-00002.safetensors",
108
+ "time_guidance_embed.timestep_embedder.linear_1.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
109
+ "time_guidance_embed.timestep_embedder.linear_2.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
110
+ "transformer_blocks.0.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
111
+ "transformer_blocks.0.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
112
+ "transformer_blocks.0.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
113
+ "transformer_blocks.0.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
114
+ "transformer_blocks.0.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
115
+ "transformer_blocks.0.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
116
+ "transformer_blocks.0.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
117
+ "transformer_blocks.0.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
118
+ "transformer_blocks.0.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
119
+ "transformer_blocks.0.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
120
+ "transformer_blocks.0.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
121
+ "transformer_blocks.0.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
122
+ "transformer_blocks.0.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
123
+ "transformer_blocks.0.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
124
+ "transformer_blocks.0.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
125
+ "transformer_blocks.0.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
126
+ "transformer_blocks.1.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
127
+ "transformer_blocks.1.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
128
+ "transformer_blocks.1.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
129
+ "transformer_blocks.1.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
130
+ "transformer_blocks.1.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
131
+ "transformer_blocks.1.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
132
+ "transformer_blocks.1.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
133
+ "transformer_blocks.1.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
134
+ "transformer_blocks.1.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
135
+ "transformer_blocks.1.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
136
+ "transformer_blocks.1.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
137
+ "transformer_blocks.1.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
138
+ "transformer_blocks.1.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
139
+ "transformer_blocks.1.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
140
+ "transformer_blocks.1.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
141
+ "transformer_blocks.1.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
142
+ "transformer_blocks.2.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
143
+ "transformer_blocks.2.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
144
+ "transformer_blocks.2.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
145
+ "transformer_blocks.2.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
146
+ "transformer_blocks.2.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
147
+ "transformer_blocks.2.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
148
+ "transformer_blocks.2.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
149
+ "transformer_blocks.2.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
150
+ "transformer_blocks.2.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
151
+ "transformer_blocks.2.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
152
+ "transformer_blocks.2.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
153
+ "transformer_blocks.2.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
154
+ "transformer_blocks.2.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
155
+ "transformer_blocks.2.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
156
+ "transformer_blocks.2.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
157
+ "transformer_blocks.2.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
158
+ "transformer_blocks.3.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
159
+ "transformer_blocks.3.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
160
+ "transformer_blocks.3.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
161
+ "transformer_blocks.3.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
162
+ "transformer_blocks.3.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
163
+ "transformer_blocks.3.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
164
+ "transformer_blocks.3.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
165
+ "transformer_blocks.3.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
166
+ "transformer_blocks.3.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
167
+ "transformer_blocks.3.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
168
+ "transformer_blocks.3.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
169
+ "transformer_blocks.3.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
170
+ "transformer_blocks.3.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
171
+ "transformer_blocks.3.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
172
+ "transformer_blocks.3.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
173
+ "transformer_blocks.3.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
174
+ "transformer_blocks.4.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
175
+ "transformer_blocks.4.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
176
+ "transformer_blocks.4.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
177
+ "transformer_blocks.4.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
178
+ "transformer_blocks.4.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
179
+ "transformer_blocks.4.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
180
+ "transformer_blocks.4.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
181
+ "transformer_blocks.4.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
182
+ "transformer_blocks.4.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
183
+ "transformer_blocks.4.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
184
+ "transformer_blocks.4.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
185
+ "transformer_blocks.4.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
186
+ "transformer_blocks.4.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
187
+ "transformer_blocks.4.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
188
+ "transformer_blocks.4.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
189
+ "transformer_blocks.4.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
190
+ "transformer_blocks.5.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
191
+ "transformer_blocks.5.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
192
+ "transformer_blocks.5.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
193
+ "transformer_blocks.5.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
194
+ "transformer_blocks.5.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
195
+ "transformer_blocks.5.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
196
+ "transformer_blocks.5.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
197
+ "transformer_blocks.5.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
198
+ "transformer_blocks.5.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
199
+ "transformer_blocks.5.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
200
+ "transformer_blocks.5.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
201
+ "transformer_blocks.5.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
202
+ "transformer_blocks.5.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
203
+ "transformer_blocks.5.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
204
+ "transformer_blocks.5.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
205
+ "transformer_blocks.5.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
206
+ "transformer_blocks.6.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
207
+ "transformer_blocks.6.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
208
+ "transformer_blocks.6.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
209
+ "transformer_blocks.6.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
210
+ "transformer_blocks.6.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
211
+ "transformer_blocks.6.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
212
+ "transformer_blocks.6.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
213
+ "transformer_blocks.6.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
214
+ "transformer_blocks.6.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
215
+ "transformer_blocks.6.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
216
+ "transformer_blocks.6.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
217
+ "transformer_blocks.6.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
218
+ "transformer_blocks.6.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
219
+ "transformer_blocks.6.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
220
+ "transformer_blocks.6.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
221
+ "transformer_blocks.6.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
222
+ "transformer_blocks.7.attn.add_k_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
223
+ "transformer_blocks.7.attn.add_q_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
224
+ "transformer_blocks.7.attn.add_v_proj.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
225
+ "transformer_blocks.7.attn.norm_added_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
226
+ "transformer_blocks.7.attn.norm_added_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
227
+ "transformer_blocks.7.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
228
+ "transformer_blocks.7.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
229
+ "transformer_blocks.7.attn.to_add_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
230
+ "transformer_blocks.7.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
231
+ "transformer_blocks.7.attn.to_out.0.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
232
+ "transformer_blocks.7.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
233
+ "transformer_blocks.7.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
234
+ "transformer_blocks.7.ff.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
235
+ "transformer_blocks.7.ff.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
236
+ "transformer_blocks.7.ff_context.linear_in.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
237
+ "transformer_blocks.7.ff_context.linear_out.weight": "diffusion_pytorch_model-00001-of-00002.safetensors",
238
+ "x_embedder.weight": "diffusion_pytorch_model-00001-of-00002.safetensors"
239
+ }
240
+ }
vae/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKLFlux2",
3
+ "_diffusers_version": "0.37.0.dev0",
4
+ "_name_or_path": "/home/guohq2021/.cache/huggingface/hub/models--black-forest-labs--FLUX.2-klein-base-9B/snapshots/32773329fbe7e81a90ef971740e8ba4b0364ecf3/vae",
5
+ "act_fn": "silu",
6
+ "batch_norm_eps": 0.0001,
7
+ "batch_norm_momentum": 0.1,
8
+ "block_out_channels": [
9
+ 128,
10
+ 256,
11
+ 512,
12
+ 512
13
+ ],
14
+ "down_block_types": [
15
+ "DownEncoderBlock2D",
16
+ "DownEncoderBlock2D",
17
+ "DownEncoderBlock2D",
18
+ "DownEncoderBlock2D"
19
+ ],
20
+ "force_upcast": true,
21
+ "in_channels": 3,
22
+ "latent_channels": 32,
23
+ "layers_per_block": 2,
24
+ "mid_block_add_attention": true,
25
+ "norm_num_groups": 32,
26
+ "out_channels": 3,
27
+ "patch_size": [
28
+ 2,
29
+ 2
30
+ ],
31
+ "sample_size": 1024,
32
+ "up_block_types": [
33
+ "UpDecoderBlock2D",
34
+ "UpDecoderBlock2D",
35
+ "UpDecoderBlock2D",
36
+ "UpDecoderBlock2D"
37
+ ],
38
+ "use_post_quant_conv": true,
39
+ "use_quant_conv": true
40
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca70d2202afe6415bdbcb8793ba8cd99fd159cfe6192381504d6c4d3036e0f04
3
+ size 168120878