Instructions to use ovedrive/Krea-2-Turbo-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ovedrive/Krea-2-Turbo-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("ovedrive/Krea-2-Turbo-4bit", dtype=torch.bfloat16, device_map="cuda") prompt = "A small, dark-colored cat is captured mid-stride, walking down the center of a narrow, abandoned street. The street is paved and appears cracked and worn. On either side of the street are tall, dilapidated buildings with visible brickwork and windows. A street lamp stands on the right side. The entire image is rendered in a monochromatic blue, with a distinct halftone dot pattern overlaying the scene, giving it a retro or printed appearance. The focus is soft, and the lighting is diffused, creating a hazy, atmospheric effect. The perspective is from ground level, looking down the length of the street, which narrows into the distance., halftone texture" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
| { | |
| "_class_name": "Krea2Transformer2DModel", | |
| "_diffusers_version": "0.39.0.dev0", | |
| "_name_or_path": "./tmp_model/transformer", | |
| "attention_head_dim": 128, | |
| "axes_dims_rope": [ | |
| 32, | |
| 48, | |
| 48 | |
| ], | |
| "in_channels": 64, | |
| "intermediate_size": 16384, | |
| "norm_eps": 1e-05, | |
| "num_attention_heads": 48, | |
| "num_key_value_heads": 12, | |
| "num_layers": 28, | |
| "num_layerwise_text_blocks": 2, | |
| "num_refiner_text_blocks": 2, | |
| "num_text_layers": 12, | |
| "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": [ | |
| "img_in", | |
| "time_embed.linear_1", | |
| "time_embed.linear_2", | |
| "time_mod_proj", | |
| "text_fusion.projector", | |
| "txt_in.linear_1", | |
| "txt_in.linear_2", | |
| "final_layer.linear", | |
| "text_fusion.layerwise_blocks.0.attn.to_q", | |
| "text_fusion.layerwise_blocks.0.attn.to_k", | |
| "text_fusion.layerwise_blocks.0.attn.to_v", | |
| "text_fusion.layerwise_blocks.0.attn.to_gate", | |
| "text_fusion.layerwise_blocks.0.attn.to_out.0", | |
| "text_fusion.layerwise_blocks.0.ff.gate", | |
| "text_fusion.layerwise_blocks.0.ff.up", | |
| "text_fusion.layerwise_blocks.0.ff.down", | |
| "text_fusion.layerwise_blocks.1.attn.to_q", | |
| "text_fusion.layerwise_blocks.1.attn.to_k", | |
| "text_fusion.layerwise_blocks.1.attn.to_v", | |
| "text_fusion.layerwise_blocks.1.attn.to_gate", | |
| "text_fusion.layerwise_blocks.1.attn.to_out.0", | |
| "text_fusion.layerwise_blocks.1.ff.gate", | |
| "text_fusion.layerwise_blocks.1.ff.up", | |
| "text_fusion.layerwise_blocks.1.ff.down", | |
| "text_fusion.refiner_blocks.0.attn.to_q", | |
| "text_fusion.refiner_blocks.0.attn.to_k", | |
| "text_fusion.refiner_blocks.0.attn.to_v", | |
| "text_fusion.refiner_blocks.0.attn.to_gate", | |
| "text_fusion.refiner_blocks.0.attn.to_out.0", | |
| "text_fusion.refiner_blocks.0.ff.gate", | |
| "text_fusion.refiner_blocks.0.ff.up", | |
| "text_fusion.refiner_blocks.0.ff.down", | |
| "text_fusion.refiner_blocks.1.attn.to_q", | |
| "text_fusion.refiner_blocks.1.attn.to_k", | |
| "text_fusion.refiner_blocks.1.attn.to_v", | |
| "text_fusion.refiner_blocks.1.attn.to_gate", | |
| "text_fusion.refiner_blocks.1.attn.to_out.0", | |
| "text_fusion.refiner_blocks.1.ff.gate", | |
| "text_fusion.refiner_blocks.1.ff.up", | |
| "text_fusion.refiner_blocks.1.ff.down", | |
| "transformer_blocks.0.attn.to_q", | |
| "transformer_blocks.0.attn.to_k", | |
| "transformer_blocks.0.attn.to_v", | |
| "transformer_blocks.0.attn.to_gate", | |
| "transformer_blocks.0.attn.to_out.0", | |
| "transformer_blocks.0.ff.gate", | |
| "transformer_blocks.0.ff.up", | |
| "transformer_blocks.0.ff.down", | |
| "transformer_blocks.27.attn.to_q", | |
| "transformer_blocks.27.attn.to_k", | |
| "transformer_blocks.27.attn.to_v", | |
| "transformer_blocks.27.attn.to_gate", | |
| "transformer_blocks.27.attn.to_out.0", | |
| "transformer_blocks.27.ff.gate", | |
| "transformer_blocks.27.ff.up", | |
| "transformer_blocks.27.ff.down", | |
| "norm", | |
| "norm1", | |
| "norm2", | |
| "norm_q", | |
| "norm_k" | |
| ], | |
| "llm_int8_threshold": 6.0, | |
| "load_in_4bit": true, | |
| "load_in_8bit": false, | |
| "quant_method": "bitsandbytes" | |
| }, | |
| "rope_theta": 1000.0, | |
| "text_hidden_dim": 2560, | |
| "text_intermediate_size": 6912, | |
| "text_num_attention_heads": 20, | |
| "text_num_key_value_heads": 20, | |
| "timestep_embed_dim": 256 | |
| } | |