Instructions to use codeShare/unstableRevolution_SDNQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use codeShare/unstableRevolution_SDNQ 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("codeShare/unstableRevolution_SDNQ", 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
File size: 7,396 Bytes
84b7af9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | {
"_class_name": "Flux2Transformer2DModel",
"_diffusers_version": "0.38.0.dev0",
"_name_or_path": "codeShare/FLUX.2-klein-AIO-SDNQ-4bit-dynamic",
"attention_head_dim": 128,
"axes_dims_rope": [
32,
32,
32,
32
],
"eps": 1e-06,
"guidance_embeds": false,
"in_channels": 128,
"joint_attention_dim": 7680,
"mlp_ratio": 3.0,
"num_attention_heads": 24,
"num_layers": 5,
"num_single_layers": 20,
"out_channels": null,
"patch_size": 1,
"quantization_config": {
"add_skip_keys": false,
"dequantize_fp32": true,
"dynamic_loss_threshold": 0.01,
"group_size": 0,
"is_integer": true,
"is_training": false,
"modules_dtype_dict": {
"int5": [
"single_transformer_blocks.19.attn.to_qkv_mlp_proj.weight",
"transformer_blocks.0.attn.to_k.weight"
],
"uint4": [
"single_transformer_blocks.0.attn.to_out.weight",
"single_transformer_blocks.0.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.1.attn.to_out.weight",
"single_transformer_blocks.1.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.10.attn.to_out.weight",
"single_transformer_blocks.10.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.11.attn.to_out.weight",
"single_transformer_blocks.11.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.12.attn.to_out.weight",
"single_transformer_blocks.12.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.13.attn.to_out.weight",
"single_transformer_blocks.13.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.14.attn.to_out.weight",
"single_transformer_blocks.14.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.15.attn.to_out.weight",
"single_transformer_blocks.15.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.16.attn.to_out.weight",
"single_transformer_blocks.16.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.17.attn.to_out.weight",
"single_transformer_blocks.17.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.18.attn.to_out.weight",
"single_transformer_blocks.18.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.19.attn.to_out.weight",
"single_transformer_blocks.2.attn.to_out.weight",
"single_transformer_blocks.2.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.3.attn.to_out.weight",
"single_transformer_blocks.3.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.4.attn.to_out.weight",
"single_transformer_blocks.4.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.5.attn.to_out.weight",
"single_transformer_blocks.5.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.6.attn.to_out.weight",
"single_transformer_blocks.6.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.7.attn.to_out.weight",
"single_transformer_blocks.7.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.8.attn.to_out.weight",
"single_transformer_blocks.8.attn.to_qkv_mlp_proj.weight",
"single_transformer_blocks.9.attn.to_out.weight",
"single_transformer_blocks.9.attn.to_qkv_mlp_proj.weight",
"transformer_blocks.0.attn.add_k_proj.weight",
"transformer_blocks.0.attn.add_q_proj.weight",
"transformer_blocks.0.attn.add_v_proj.weight",
"transformer_blocks.0.attn.to_add_out.weight",
"transformer_blocks.0.attn.to_out.0.weight",
"transformer_blocks.0.attn.to_q.weight",
"transformer_blocks.0.attn.to_v.weight",
"transformer_blocks.0.ff.linear_in.weight",
"transformer_blocks.0.ff.linear_out.weight",
"transformer_blocks.0.ff_context.linear_in.weight",
"transformer_blocks.0.ff_context.linear_out.weight",
"transformer_blocks.1.attn.add_k_proj.weight",
"transformer_blocks.1.attn.add_q_proj.weight",
"transformer_blocks.1.attn.add_v_proj.weight",
"transformer_blocks.1.attn.to_add_out.weight",
"transformer_blocks.1.attn.to_k.weight",
"transformer_blocks.1.attn.to_out.0.weight",
"transformer_blocks.1.attn.to_q.weight",
"transformer_blocks.1.attn.to_v.weight",
"transformer_blocks.1.ff.linear_in.weight",
"transformer_blocks.1.ff.linear_out.weight",
"transformer_blocks.1.ff_context.linear_in.weight",
"transformer_blocks.1.ff_context.linear_out.weight",
"transformer_blocks.2.attn.add_k_proj.weight",
"transformer_blocks.2.attn.add_q_proj.weight",
"transformer_blocks.2.attn.add_v_proj.weight",
"transformer_blocks.2.attn.to_add_out.weight",
"transformer_blocks.2.attn.to_k.weight",
"transformer_blocks.2.attn.to_out.0.weight",
"transformer_blocks.2.attn.to_q.weight",
"transformer_blocks.2.attn.to_v.weight",
"transformer_blocks.2.ff.linear_in.weight",
"transformer_blocks.2.ff.linear_out.weight",
"transformer_blocks.2.ff_context.linear_in.weight",
"transformer_blocks.2.ff_context.linear_out.weight",
"transformer_blocks.3.attn.add_k_proj.weight",
"transformer_blocks.3.attn.add_q_proj.weight",
"transformer_blocks.3.attn.add_v_proj.weight",
"transformer_blocks.3.attn.to_add_out.weight",
"transformer_blocks.3.attn.to_k.weight",
"transformer_blocks.3.attn.to_out.0.weight",
"transformer_blocks.3.attn.to_q.weight",
"transformer_blocks.3.attn.to_v.weight",
"transformer_blocks.3.ff.linear_in.weight",
"transformer_blocks.3.ff.linear_out.weight",
"transformer_blocks.3.ff_context.linear_in.weight",
"transformer_blocks.3.ff_context.linear_out.weight",
"transformer_blocks.4.attn.add_k_proj.weight",
"transformer_blocks.4.attn.add_q_proj.weight",
"transformer_blocks.4.attn.add_v_proj.weight",
"transformer_blocks.4.attn.to_add_out.weight",
"transformer_blocks.4.attn.to_k.weight",
"transformer_blocks.4.attn.to_out.0.weight",
"transformer_blocks.4.attn.to_q.weight",
"transformer_blocks.4.attn.to_v.weight",
"transformer_blocks.4.ff.linear_in.weight",
"transformer_blocks.4.ff.linear_out.weight",
"transformer_blocks.4.ff_context.linear_in.weight",
"transformer_blocks.4.ff_context.linear_out.weight"
]
},
"modules_quant_config": {},
"modules_to_not_convert": [
"time_guidance_embed",
"norm_out",
"context_embedder",
"double_stream_modulation_txt",
"x_embedder",
"double_stream_modulation_img",
".proj_out",
"single_stream_modulation"
],
"non_blocking": false,
"quant_conv": false,
"quant_embedding": false,
"quant_method": "sdnq",
"quantization_device": null,
"quantized_matmul_dtype": null,
"return_device": null,
"sdnq_version": "0.1.7",
"svd_rank": 32,
"svd_steps": 8,
"use_dynamic_quantization": true,
"use_grad_ckpt": true,
"use_quantized_matmul": false,
"use_quantized_matmul_conv": false,
"use_static_quantization": true,
"use_stochastic_rounding": false,
"use_svd": false,
"weights_dtype": "uint4"
},
"rope_theta": 2000,
"timestep_guidance_channels": 256
}
|