Instructions to use freestuff2875/GLM-Image-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use freestuff2875/GLM-Image-bnb-4bit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("freestuff2875/GLM-Image-bnb-4bit", 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
- Local Apps Settings
- Draw Things
- DiffusionBee
| { | |
| "_class_name": "GlmImageTransformer2DModel", | |
| "_diffusers_version": "0.37.1", | |
| "_name_or_path": "zai-org/GLM-Image", | |
| "attention_head_dim": 128, | |
| "condition_dim": 256, | |
| "in_channels": 16, | |
| "num_attention_heads": 32, | |
| "num_layers": 30, | |
| "out_channels": 16, | |
| "patch_size": 2, | |
| "prior_vq_quantizer_codebook_size": 16384, | |
| "quantization_config": { | |
| "_load_in_4bit": true, | |
| "_load_in_8bit": false, | |
| "bnb_4bit_compute_dtype": "bfloat16", | |
| "bnb_4bit_quant_storage": "uint8", | |
| "bnb_4bit_quant_type": "nf4", | |
| "bnb_4bit_use_double_quant": true, | |
| "llm_int8_enable_fp32_cpu_offload": false, | |
| "llm_int8_has_fp16_weight": false, | |
| "llm_int8_skip_modules": [ | |
| "time_condition_embed", | |
| "image_projector", | |
| "proj_out", | |
| "prior_projector", | |
| "glyph_projector", | |
| "norm_out", | |
| "transformer_blocks.0.norm1.linear", | |
| "transformer_blocks.23.norm1.linear", | |
| "transformer_blocks.24.norm1.linear", | |
| "transformer_blocks.25.norm1.linear", | |
| "transformer_blocks.0.attn1.to_k", | |
| "transformer_blocks.0.attn1.to_v", | |
| "transformer_blocks.0.ff.net.0.proj", | |
| "transformer_blocks.1.attn1.to_k", | |
| "transformer_blocks.1.attn1.to_q", | |
| "transformer_blocks.1.attn1.to_v", | |
| "transformer_blocks.1.ff.net.0.proj", | |
| "transformer_blocks.10.attn1.to_v", | |
| "transformer_blocks.2.attn1.to_k", | |
| "transformer_blocks.2.attn1.to_q", | |
| "transformer_blocks.2.attn1.to_v", | |
| "transformer_blocks.3.attn1.to_k", | |
| "transformer_blocks.3.attn1.to_q", | |
| "transformer_blocks.3.attn1.to_v", | |
| "transformer_blocks.3.ff.net.0.proj", | |
| "transformer_blocks.4.attn1.to_k", | |
| "transformer_blocks.4.attn1.to_q", | |
| "transformer_blocks.4.attn1.to_v", | |
| "transformer_blocks.5.attn1.to_v", | |
| "transformer_blocks.6.attn1.to_v", | |
| "transformer_blocks.7.attn1.to_v", | |
| "transformer_blocks.8.attn1.to_v", | |
| "transformer_blocks.9.attn1.to_v", | |
| "transformer_blocks.21.norm1.linear", | |
| "transformer_blocks.22.norm1.linear", | |
| "transformer_blocks.25.ff.net.2", | |
| "transformer_blocks.26.attn1.to_v", | |
| "transformer_blocks.26.ff.net.2", | |
| "transformer_blocks.26.norm1.linear", | |
| "transformer_blocks.27.attn1.to_v", | |
| "transformer_blocks.27.norm1.linear", | |
| "transformer_blocks.28.attn1.to_v", | |
| "transformer_blocks.29.attn1.to_v" | |
| ], | |
| "llm_int8_threshold": 6.0, | |
| "load_in_4bit": true, | |
| "load_in_8bit": false, | |
| "quant_method": "bitsandbytes" | |
| }, | |
| "text_embed_dim": 1472, | |
| "time_embed_dim": 512 | |
| } | |