Instructions to use Beinsezii/Krea-2-Turbo-Projector-Scale-LoRA-Diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Beinsezii/Krea-2-Turbo-Projector-Scale-LoRA-Diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("krea/Krea-2-Turbo", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Beinsezii/Krea-2-Turbo-Projector-Scale-LoRA-Diffusers") 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
| # /// script | |
| # requires-python = ">=3.14" | |
| # dependencies = [ | |
| # "huggingface-hub>=1", | |
| # "numpy>2", | |
| # "safetensors>=0.8", | |
| # "torch>2", | |
| # ] | |
| # | |
| # [[tool.uv.index]] | |
| # url = "https://download.pytorch.org/whl/cpu" | |
| # /// | |
| import huggingface_hub | |
| import safetensors | |
| import safetensors.torch | |
| import torch | |
| with safetensors.safe_open( | |
| filename=huggingface_hub.hf_hub_download( | |
| repo_id="krea/Krea-2-Turbo", | |
| filename="transformer/diffusion_pytorch_model-00001-of-00003.safetensors", | |
| ), | |
| framework="pt", | |
| ) as sft: | |
| lora: dict[str, torch.Tensor] = {} | |
| proj: torch.Tensor = sft.get_tensor("text_fusion.projector.weight") | |
| lora["transformer.text_fusion.projector.lora_A.weight"] = proj | |
| lora["transformer.text_fusion.projector.lora_B.weight"] = proj.new_tensor([[100.0]]) | |
| safetensors.torch.save_file(lora, "pytorch_lora_weights.safetensors") | |