Instructions to use margin2model/Krea-2-lora-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use margin2model/Krea-2-lora-test 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,krea/Krea-2-Raw", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("margin2model/Krea-2-lora-test") 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
Krea 2 LoRA
This Diffusers LoRA was trained on krea/Krea-2-Raw using the
facebook/winoground dataset. Krea recommends training adapters on RAW and
loading them on the fast distilled krea/Krea-2-Turbo pipeline for
eight-step inference.
import torch
from diffusers import Krea2Pipeline
from huggingface_hub import hf_hub_download
lora_path = hf_hub_download(
repo_id="margin2model/Krea-2-lora-test",
filename="pytorch_lora_weights.safetensors",
)
pipe = Krea2Pipeline.from_pretrained(
"krea/Krea-2-Turbo",
torch_dtype=torch.bfloat16,
)
pipe.enable_model_cpu_offload()
pipe.load_lora_weights(lora_path)
image = pipe(
prompt='A cinematic portrait, detailed, soft studio lighting',
num_inference_steps=8,
guidance_scale=0.0,
height=1024,
width=1024,
generator=torch.Generator(device="cuda").manual_seed(0),
).images[0]
image.save("image.png")
The adapter is stored as pytorch_lora_weights.safetensors in Diffusers-native Krea 2 format.
License
This adapter is a derivative of Krea 2 and is subject to the Krea 2 Community License and the Krea Acceptable Use Policy. The community license permits commercial use only below its stated annual revenue threshold; other commercial use requires an enterprise license from Krea. Deployers must also implement the safeguards required by that license.
- Downloads last month
- 16
Model tree for margin2model/Krea-2-lora-test
Base model
krea/Krea-2-Raw