Instructions to use anshell/FLUX.2-dev-bnb-4bit-nf4-double with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use anshell/FLUX.2-dev-bnb-4bit-nf4-double with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("anshell/FLUX.2-dev-bnb-4bit-nf4-double", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- text_encoder/config.json +74 -0
- text_encoder/generation_config.json +8 -0
- text_encoder/model.safetensors +3 -0
- transformer/config.json +39 -0
- transformer/diffusion_pytorch_model-00001-of-00002.safetensors +3 -0
- transformer/diffusion_pytorch_model-00002-of-00002.safetensors +3 -0
- transformer/diffusion_pytorch_model.safetensors.index.json +0 -0
text_encoder/config.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Mistral3ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "bfloat16",
|
| 6 |
+
"image_token_index": 10,
|
| 7 |
+
"model_type": "mistral3",
|
| 8 |
+
"multimodal_projector_bias": false,
|
| 9 |
+
"projector_hidden_act": "gelu",
|
| 10 |
+
"quantization_config": {
|
| 11 |
+
"_load_in_4bit": true,
|
| 12 |
+
"_load_in_8bit": false,
|
| 13 |
+
"bnb_4bit_compute_dtype": "bfloat16",
|
| 14 |
+
"bnb_4bit_quant_storage": "uint8",
|
| 15 |
+
"bnb_4bit_quant_type": "nf4",
|
| 16 |
+
"bnb_4bit_use_double_quant": true,
|
| 17 |
+
"llm_int8_enable_fp32_cpu_offload": false,
|
| 18 |
+
"llm_int8_has_fp16_weight": false,
|
| 19 |
+
"llm_int8_skip_modules": null,
|
| 20 |
+
"llm_int8_threshold": 6.0,
|
| 21 |
+
"load_in_4bit": true,
|
| 22 |
+
"load_in_8bit": false,
|
| 23 |
+
"quant_method": "bitsandbytes"
|
| 24 |
+
},
|
| 25 |
+
"spatial_merge_size": 2,
|
| 26 |
+
"text_config": {
|
| 27 |
+
"attention_dropout": 0.0,
|
| 28 |
+
"bos_token_id": 1,
|
| 29 |
+
"dtype": "bfloat16",
|
| 30 |
+
"eos_token_id": 2,
|
| 31 |
+
"head_dim": 128,
|
| 32 |
+
"hidden_act": "silu",
|
| 33 |
+
"hidden_size": 5120,
|
| 34 |
+
"initializer_range": 0.02,
|
| 35 |
+
"intermediate_size": 32768,
|
| 36 |
+
"max_position_embeddings": 131072,
|
| 37 |
+
"model_type": "mistral",
|
| 38 |
+
"num_attention_heads": 32,
|
| 39 |
+
"num_hidden_layers": 40,
|
| 40 |
+
"num_key_value_heads": 8,
|
| 41 |
+
"pad_token_id": null,
|
| 42 |
+
"rms_norm_eps": 1e-05,
|
| 43 |
+
"rope_parameters": {
|
| 44 |
+
"rope_theta": 1000000000.0,
|
| 45 |
+
"rope_type": "default"
|
| 46 |
+
},
|
| 47 |
+
"sliding_window": null,
|
| 48 |
+
"tie_word_embeddings": false,
|
| 49 |
+
"use_cache": true,
|
| 50 |
+
"vocab_size": 131072
|
| 51 |
+
},
|
| 52 |
+
"tie_word_embeddings": true,
|
| 53 |
+
"transformers_version": "5.14.1",
|
| 54 |
+
"vision_config": {
|
| 55 |
+
"attention_dropout": 0.0,
|
| 56 |
+
"dtype": "bfloat16",
|
| 57 |
+
"head_dim": 64,
|
| 58 |
+
"hidden_act": "silu",
|
| 59 |
+
"hidden_size": 1024,
|
| 60 |
+
"image_size": 1540,
|
| 61 |
+
"initializer_range": 0.02,
|
| 62 |
+
"intermediate_size": 4096,
|
| 63 |
+
"model_type": "pixtral",
|
| 64 |
+
"num_attention_heads": 16,
|
| 65 |
+
"num_channels": 3,
|
| 66 |
+
"num_hidden_layers": 24,
|
| 67 |
+
"patch_size": 14,
|
| 68 |
+
"rope_parameters": {
|
| 69 |
+
"rope_theta": 10000.0,
|
| 70 |
+
"rope_type": "default"
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
"vision_feature_layer": -1
|
| 74 |
+
}
|
text_encoder/generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"do_sample": true,
|
| 5 |
+
"eos_token_id": 2,
|
| 6 |
+
"temperature": 0.15,
|
| 7 |
+
"transformers_version": "5.14.1"
|
| 8 |
+
}
|
text_encoder/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4991ea141d50d516015905377e31c77bdae9748e2a7071833febf350a0c977e4
|
| 3 |
+
size 14381232542
|
transformer/config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "Flux2Transformer2DModel",
|
| 3 |
+
"_diffusers_version": "0.39.0",
|
| 4 |
+
"_name_or_path": "black-forest-labs/FLUX.2-dev",
|
| 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": true,
|
| 14 |
+
"in_channels": 128,
|
| 15 |
+
"joint_attention_dim": 15360,
|
| 16 |
+
"mlp_ratio": 3.0,
|
| 17 |
+
"num_attention_heads": 48,
|
| 18 |
+
"num_layers": 8,
|
| 19 |
+
"num_single_layers": 48,
|
| 20 |
+
"out_channels": null,
|
| 21 |
+
"patch_size": 1,
|
| 22 |
+
"quantization_config": {
|
| 23 |
+
"_load_in_4bit": true,
|
| 24 |
+
"_load_in_8bit": false,
|
| 25 |
+
"bnb_4bit_compute_dtype": "bfloat16",
|
| 26 |
+
"bnb_4bit_quant_storage": "uint8",
|
| 27 |
+
"bnb_4bit_quant_type": "nf4",
|
| 28 |
+
"bnb_4bit_use_double_quant": true,
|
| 29 |
+
"llm_int8_enable_fp32_cpu_offload": false,
|
| 30 |
+
"llm_int8_has_fp16_weight": false,
|
| 31 |
+
"llm_int8_skip_modules": null,
|
| 32 |
+
"llm_int8_threshold": 6.0,
|
| 33 |
+
"load_in_4bit": true,
|
| 34 |
+
"load_in_8bit": false,
|
| 35 |
+
"quant_method": "bitsandbytes"
|
| 36 |
+
},
|
| 37 |
+
"rope_theta": 2000,
|
| 38 |
+
"timestep_guidance_channels": 256
|
| 39 |
+
}
|
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:88186c50864cb2fa9c59005405d168a6b0dd37a5162d491487df6c201ccf9fbc
|
| 3 |
+
size 9999555396
|
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:8336b82594036d32db97feb5eb1a38150897bf0cddd2565b29c72272a7e771f3
|
| 3 |
+
size 6623893023
|
transformer/diffusion_pytorch_model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|