Reproducible Diffusers LoRA inference pipelines for adapters trained with ostris/ai-toolkit.
← Docs Home · Model Catalog · HTTP API · Troubleshooting
API model id: krea2_o_edit_turbo
URL slug: krea2-o-edit-turbo
AI Toolkit training arch: krea2:o_edit_turbo
This page documents the reference inference pipeline for krea2_o_edit_turbo — Krea 2 Turbo with in-context reference-image editing. It is designed for running LoRAs trained with ostris/ai-toolkit while minimizing training preview vs inference mismatch.
If you are trying to reproduce AI Toolkit sample previews, treat the code linked below as the source of truth.
Run in the cloud (optional): If you want to reproduce the examples on this page in a pinned runtime without local CUDA/driver setup (and reduce preview-vs-inference drift), run it via RunComfy’s Cloud AI Toolkit (Train + Inference). 👉 You can open it here: Cloud AI Toolkit (Train + Inference)
| Field | Value |
|---|---|
| Pipeline | src/pipelines/krea2.py |
| Base checkpoint | krea/Krea-2-Turbo (single file turbo.safetensors at the repo root) |
| Text encoder | Qwen/Qwen3-VL-4B-Instruct (a stack of 12 hidden-state layers) |
| VAE | Qwen/Qwen-Image (vae/ subfolder, f8, 16 latent channels) |
| Defaults | sample_steps=8, guidance_scale=1.0, seed=42 |
| Resolution snapping | Floors width/height to a multiple of 16 (VAE f8 x patch 2) |
| Control image | Yes — 1–3 reference images via ctrl_img / ctrl_img_1..3. Required. |
| LoRA scale behavior | Merged into the transformer at load. Changing loras[].network_multiplier triggers a full model reload. |
| Needs AI Toolkit | Yes — the transformer, packing and sampler come from extensions_built_in/diffusion_models/krea2/. |
| Gated weights | Yes — krea/Krea-2-Turbo is HF-gated. HF_TOKEN must belong to an account that accepted the Krea 2 license. |
src/pipelines/krea2.pysrc/pipelines/base.pysrc/schemas/request.pysrc/schemas/models.pysrc/pipelines/__init__.pyextensions_built_in/diffusion_models/krea2/ in ostris/ai-toolkit{
"model": "krea2_o_edit_turbo",
"trigger_word": "sks",
"prompts": [
{
"prompt": "[trigger] a photo of a person",
"width": 1024,
"height": 1024,
"seed": 42,
"sample_steps": 8,
"guidance_scale": 1.0,
"neg": "",
"ctrl_img": "https://example.com/reference.png"
}
],
"loras": [
{
"path": "my_lora_job/my_lora.safetensors",
"network_multiplier": 1.0
}
]
}
guidance_scale is 0-normalized inside the model. AI Toolkit computes
guidance = max(0, guidance_scale - 1) before sampling, and this pipeline does exactly the
same, so a guidance_scale here means the same thing as sample.guidance_scale in a training
config. Do not subtract the 1 yourself.mu based on the image-token count (endpoints 256 → 0.5 and
6400 → 1.15). mu is deliberately not pinned to 1.15 for the distilled checkpoints, because
no AI Toolkit krea2 preset pins it either — preview parity wins over the vendor default.network_multiplier is fixed after
load. A different scale forces a full reload (~26 GB checkpoint).LoRA keys are read in AI Toolkit’s on-disk format (diffusion_model.*, peft-style
lora_A/lora_B, no .alpha tensors — a missing alpha defaults to rank).
krea2:o_edit_turbo.guidance_scale <= 1.0 the internal guidance is 0, so the unconditional pass is
skipped entirely and the negative prompt has no effect. Raise guidance_scale above
1.0 to re-enable real CFG (at 2x the cost per step).The ostris/krea2_turbo_training_adapter is a training-only adapter. AI Toolkit
merges it and then cancels it out at -1.0 while sampling, so previews come from plain
Turbo weights. This pipeline never loads it, which is the correct behavior.
t=0 (area matched to the
target resolution, snapped to a multiple of 16, bilinear without antialias).kv_cache is enabled, matching the krea2:o_edit_turbo training preset. It is not just a
speed-up: it changes the attention mask so reference tokens attend only to each other.
A LoRA trained with kv_cache on must be inferenced with it on, and vice versa.krea2:o_edit_turbo.sample_steps, and remember guidance_scale is 0-normalized.loras[].network_multiplier.krea2:o_edit_turbo (safetensors metadata ss_base_model_version is krea2).