Instructions to use weaiunit/FLUX.2-klein-4B-no-text-encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use weaiunit/FLUX.2-klein-4B-no-text-encoder with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("weaiunit/FLUX.2-klein-4B-no-text-encoder", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- model_index.json +26 -0
- scheduler/scheduler_config.json +18 -0
- transformer/config.json +24 -0
- transformer/diffusion_pytorch_model.safetensors +3 -0
- vae/config.json +41 -0
- vae/diffusion_pytorch_model.safetensors +3 -0
model_index.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "Flux2KleinPipeline",
|
| 3 |
+
"_diffusers_version": "0.39.0.dev0",
|
| 4 |
+
"_name_or_path": "black-forest-labs/FLUX.2-klein-4B",
|
| 5 |
+
"is_distilled": true,
|
| 6 |
+
"scheduler": [
|
| 7 |
+
"diffusers",
|
| 8 |
+
"FlowMatchEulerDiscreteScheduler"
|
| 9 |
+
],
|
| 10 |
+
"text_encoder": [
|
| 11 |
+
null,
|
| 12 |
+
null
|
| 13 |
+
],
|
| 14 |
+
"tokenizer": [
|
| 15 |
+
null,
|
| 16 |
+
null
|
| 17 |
+
],
|
| 18 |
+
"transformer": [
|
| 19 |
+
"diffusers",
|
| 20 |
+
"Flux2Transformer2DModel"
|
| 21 |
+
],
|
| 22 |
+
"vae": [
|
| 23 |
+
"diffusers",
|
| 24 |
+
"AutoencoderKLFlux2"
|
| 25 |
+
]
|
| 26 |
+
}
|
scheduler/scheduler_config.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "FlowMatchEulerDiscreteScheduler",
|
| 3 |
+
"_diffusers_version": "0.39.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 |
+
}
|
transformer/config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "Flux2Transformer2DModel",
|
| 3 |
+
"_diffusers_version": "0.39.0.dev0",
|
| 4 |
+
"_name_or_path": "black-forest-labs/FLUX.2-klein-4B",
|
| 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": 7680,
|
| 16 |
+
"mlp_ratio": 3.0,
|
| 17 |
+
"num_attention_heads": 24,
|
| 18 |
+
"num_layers": 5,
|
| 19 |
+
"num_single_layers": 20,
|
| 20 |
+
"out_channels": null,
|
| 21 |
+
"patch_size": 1,
|
| 22 |
+
"rope_theta": 2000,
|
| 23 |
+
"timestep_guidance_channels": 256
|
| 24 |
+
}
|
transformer/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9f29f9edcfdae452a653ffb51a534ca4decd389952c225724ff3b94042612a6e
|
| 3 |
+
size 7751109744
|
vae/config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "AutoencoderKLFlux2",
|
| 3 |
+
"_diffusers_version": "0.39.0.dev0",
|
| 4 |
+
"_name_or_path": "/home/pourmirzaei/.cache/huggingface/hub/models--black-forest-labs--FLUX.2-klein-4B/snapshots/e7b7dc27f91deacad38e78976d1f2b499d76a294/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 |
+
"decoder_block_out_channels": null,
|
| 15 |
+
"down_block_types": [
|
| 16 |
+
"DownEncoderBlock2D",
|
| 17 |
+
"DownEncoderBlock2D",
|
| 18 |
+
"DownEncoderBlock2D",
|
| 19 |
+
"DownEncoderBlock2D"
|
| 20 |
+
],
|
| 21 |
+
"force_upcast": true,
|
| 22 |
+
"in_channels": 3,
|
| 23 |
+
"latent_channels": 32,
|
| 24 |
+
"layers_per_block": 2,
|
| 25 |
+
"mid_block_add_attention": true,
|
| 26 |
+
"norm_num_groups": 32,
|
| 27 |
+
"out_channels": 3,
|
| 28 |
+
"patch_size": [
|
| 29 |
+
2,
|
| 30 |
+
2
|
| 31 |
+
],
|
| 32 |
+
"sample_size": 1024,
|
| 33 |
+
"up_block_types": [
|
| 34 |
+
"UpDecoderBlock2D",
|
| 35 |
+
"UpDecoderBlock2D",
|
| 36 |
+
"UpDecoderBlock2D",
|
| 37 |
+
"UpDecoderBlock2D"
|
| 38 |
+
],
|
| 39 |
+
"use_post_quant_conv": true,
|
| 40 |
+
"use_quant_conv": true
|
| 41 |
+
}
|
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
|