krea2-turbo-bbox
jimmycarter/krea2-turbo-bbox
- 作者
- jimmycarter
- 任务
- 图像生成
- 下载量
- 3,548
- 点赞数
- 90
- 趋势分
- 22
- 许可证
- -
- 收录时间
- 2026/11/4
library_name: diffusers base_model: krea/Krea-2-Raw tags:
- text-to-image
- krea2
- distilled
jimmycarter/krea2-turbo-bbox
A Krea 2 finetune for layout control: multi-panel comics, speech bubbles that land inside their panel, character identity held across panels, and text placed where it was asked for.
This is the final release: epoch-20-step-104548, after 20 epochs. It comes in two flavours, each as the fine-tune itself plus two EMA shadows of its weights (exponential moving averages with decay 0.9995 and 0.99975;
the higher decay averages over a longer window):
- Turbo is the fine-tune merged with the base→turbo distillation delta,
turbo = finetune + (krea/Krea-2-Turbo - krea/Krea-2-Raw). It samples in 8 steps with CFG off. - Raw is the fine-tune as trained, on top of
krea/Krea-2-Raw. It samples in 50 steps with CFG.
| Variant | Subfolder | Sampling |
|---|---|---|
| Turbo fine-tune | turbo/transformer | 8 steps, CFG off |
| Turbo EMA 0.9995 | turbo/ema_0.9995/transformer | 8 steps, CFG off |
| Turbo EMA 0.99975 | turbo/ema_0.99975/transformer | 8 steps, CFG off |
| Raw fine-tune | raw/transformer | 50 steps, CFG 5.5 |
| Raw EMA 0.9995 | raw/ema_0.9995/transformer | 50 steps, CFG 5.5 |
| Raw EMA 0.99975 | raw/ema_0.99975/transformer | 50 steps, CFG 5.5 |
⚠️ Prompting: read this first
Roughly 90% of this model's training used a compact grounding DSL, not ordinary prose. It is a
plain-text layout language that places panels, characters and verbatim text in explicit
[x0,y0,x1,y1] boxes on a 0–1000 grid.
→ Full spec with copy-pasteable examples: PROMPTING.md
Plain prose prompts still work. That was the other 10% of training.
A four-panel comic in which an anime handywoman and an anthropomorphic tabby cat assemble a flat-pack shelf and fail completely.
@clean line art, flat colors, light cel shading; Digital illustration
~A bare apartment living room with cardboard packaging and loose screws on a pale wood floor.
p[0,0,500,500] Top-left panel: the handywoman holding up the instruction sheet, confident.
p[500,0,1000,500] Top-right panel: the cat batting a single screw off the floor.
p[0,500,500,1000] Bottom-left panel: a lopsided half-built shelf wobbling.
p[500,500,1000,1000] Bottom-right panel: the shelf collapsed, the cat sitting smugly on the wreckage.
ac:1[60,80,340,470] A young woman with short dark hair in blue overalls, holding an instruction sheet, confident grin.
fc:2[560,90,880,470] An anthropomorphic tabby cat in a tool belt, one paw raised mid-swat, innocent expression.
t[80,40,420,120]"SOME ASSEMBLY REQUIRED." black text in a rounded speech bubble
t[540,530,960,610]"IT HAS FIVE LEGS NOW." black text in a rounded speech bubble
p panel, o object, t text, pe/ac/fc person / anime / furry character. Coordinates are
x first: [x0,y0,x1,y1], not [y0,x0,y1,x1]. Getting that backwards is the most common
failure, and it fails silently.
Samples
Each image is one prompt with the same seed and sampler settings through four transformers: the stock model, this fine-tune, and its two EMA shadows. Grounded prompts get a second row showing the same frames with the requested boxes drawn on. Every grounded prompt is a working example of the DSL in PROMPTING.md.
Turbo · 8 steps, CFG off
Columns: Krea-2-Turbo · Fine-tune · EMA 0.9995 · EMA 0.99975.
Cat on a windowsill
Cafe chalkboard, cursive text
Macro watch movement
Watercolour lighthouse
1950s diner, neon sign
Circuit board, etched text
Meadow at golden hour
Album cover with tracklist
Grounded: coffee shop storefront
Grounded: breakfast flat-lay
Grounded: anime key visual
Grounded: noir furry detectives
Grounded: 4-panel kitchen comic
Grounded: 3-panel summoning comic
Grounded: 4-panel flat-pack comic
Grounded: 3-panel strip, one character
Grounded: 2-panel wide, SFX text
Grounded: splash page + 3 panels
Grounded: anime key visual + logo
Grounded: three-piece furry band
Grounded: screen-printed poster
Grounded: ramen shop at night
Grounded: coffee bag product shot
Retro travel poster
Coastal highway at dawn
Ink and watercolour tram
Raw · 50 steps, CFG 5.5
Columns: Krea-2-Raw · Fine-tune · EMA 0.9995 · EMA 0.99975.
Cat on a windowsill
Cafe chalkboard, cursive text
Macro watch movement
Watercolour lighthouse
1950s diner, neon sign
Circuit board, etched text
Meadow at golden hour
Album cover with tracklist
Grounded: coffee shop storefront
Grounded: breakfast flat-lay
Grounded: anime key visual
Grounded: noir furry detectives
Grounded: 4-panel kitchen comic
Grounded: 3-panel summoning comic
Grounded: 4-panel flat-pack comic
Grounded: 3-panel strip, one character
Grounded: 2-panel wide, SFX text
Grounded: splash page + 3 panels
Grounded: anime key visual + logo
Grounded: three-piece furry band
Grounded: screen-printed poster
Grounded: ramen shop at night
Grounded: coffee bag product shot
Retro travel poster
Coastal highway at dawn
Ink and watercolour tram
Usage
This repo holds only transformers. Everything else (VAE, text encoder, tokenizer, scheduler) is
identical to stock Krea 2, so load a transformer from its subfolder into a stock pipeline. Any row
of the table above works the same way, e.g. subfolder="turbo/ema_0.9995/transformer".
diffusers
import torch
from diffusers import Krea2Pipeline, Krea2Transformer2DModel
# Turbo: 8 steps, CFG off. is_distilled=True selects the fixed timestep shift (mu=1.15) that
# distilled weights expect.
tf = Krea2Transformer2DModel.from_pretrained(
"jimmycarter/krea2-turbo-bbox", subfolder="turbo/transformer", torch_dtype=torch.bfloat16)
pipe = Krea2Pipeline.from_pretrained(
"krea/Krea-2-Raw", transformer=tf, is_distilled=True, torch_dtype=torch.bfloat16)
pipe.to("cuda")
image = pipe("a photo of a cat", num_inference_steps=8, guidance_scale=0.0).images[0]
import torch
from diffusers import Krea2Pipeline, Krea2Transformer2DModel
# Raw: 50 steps with CFG. diffusers' guidance_scale is the CFG scale minus one: 4.5 is CFG 5.5.
tf = Krea2Transformer2DModel.from_pretrained(
"jimmycarter/krea2-turbo-bbox", subfolder="raw/transformer", torch_dtype=torch.bfloat16)
pipe = Krea2Pipeline.from_pretrained("krea/Krea-2-Raw", transformer=tf, torch_dtype=torch.bfloat16)
pipe.to("cuda")
image = pipe("a photo of a cat", num_inference_steps=50, guidance_scale=4.5).images[0]
ComfyUI
Every variant as a single file in Krea's native layout, which is what ComfyUI loads:
| Variant | File | Sampling |
|---|---|---|
| Turbo fine-tune | krea2-bbox-turbo-comfy-latest.safetensors | 8 steps, CFG 1.0 |
| Turbo EMA 0.9995 | krea2-bbox-turbo-ema_0.9995-comfy.safetensors | 8 steps, CFG 1.0 |
| Turbo EMA 0.99975 | krea2-bbox-turbo-ema_0.99975-comfy.safetensors | 8 steps, CFG 1.0 |
| Raw fine-tune | krea2-bbox-raw-comfy.safetensors | 50 steps, CFG 5.5 |
| Raw EMA 0.9995 | krea2-bbox-raw-ema_0.9995-comfy.safetensors | 50 steps, CFG 5.5 |
| Raw EMA 0.99975 | krea2-bbox-raw-ema_0.99975-comfy.safetensors | 50 steps, CFG 5.5 |
Put them in ComfyUI/models/diffusion_models/. The text encoder and VAE are unchanged from stock Krea 2, so take them from Comfy-Org/Krea-2: text_encoders/qwen3vl_4b_fp8_scaled.safetensors and vae/qwen_image_vae.safetensors. The built-in Krea 2 text-to-image templates work as-is with the matching file swapped in for the stock diffusion model.
LoRAs
Lighter, approximate versions of the fine-tune and its EMAs, as LoRAs against
krea/Krea-2-Raw: per Linear layer, the truncated SVD of (fine-tune − Raw). They are partial.
This was a full-rank fine-tune whose change is spread over almost every direction of every weight
matrix, so even rank 256 holds only a small part of it, and a LoRA can't carry the norms, biases
or modulation tables at all. Measured on held-out training samples, the fine-tune's LoRA reproduces about 12% / 18% / 28% of the full fine-tune's effect on the model's predictions at rank 64 / 128 / 256, and 16% / 24% / 38% on the high-noise steps that set the layout. For the behaviour shown above, use the full weights; the
LoRAs are for setups that can only take a LoRA.
| Variant | Rank 64 | Rank 128 | Rank 256 |
|---|---|---|---|
| Fine-tune | krea2-bbox-lora-r64.safetensors | krea2-bbox-lora-r128.safetensors | krea2-bbox-lora-r256.safetensors |
| EMA 0.9995 | krea2-bbox-ema_0.9995-lora-r64.safetensors | krea2-bbox-ema_0.9995-lora-r128.safetensors | krea2-bbox-ema_0.9995-lora-r256.safetensors |
| EMA 0.99975 | krea2-bbox-ema_0.99975-lora-r64.safetensors | krea2-bbox-ema_0.99975-lora-r128.safetensors | krea2-bbox-ema_0.99975-lora-r256.safetensors |
They can also be applied to krea/Krea-2-Turbo. The turbo weights above are
finetune + (Turbo − Raw), which is Turbo + (finetune − Raw), the change these LoRAs approximate;
their effect on Turbo wasn't measured separately. Sample on Turbo at 8 steps with CFG off, on Raw at
50 steps with CFG 5.5.
import torch
from diffusers import Krea2Pipeline
pipe = Krea2Pipeline.from_pretrained(
"krea/Krea-2-Turbo", is_distilled=True, torch_dtype=torch.bfloat16)
pipe.load_lora_weights("jimmycarter/krea2-turbo-bbox", weight_name="lora/krea2-bbox-lora-r256.safetensors")
pipe.to("cuda")
image = pipe("a photo of a cat", num_inference_steps=8, guidance_scale=0.0).images[0]
In ComfyUI, put a file in ComfyUI/models/loras/ and apply it at strength 1.0 with
LoraLoaderModelOnly to the stock Krea 2 diffusion model, Raw or Turbo.
Training checkpoints
training/ holds the per-epoch turbo merges published while training ran (epochs 1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 16, 17, 18, 19). They
are kept for reference and superseded by the final weights above. Load one with
subfolder="training/<epoch>/transformer", sampled like the turbo weights.
Training data
The initial pool of 30m images from the pre-AI internet was k-means clustered using DINOv3 and SigLIP2 and aesthetics ranking. Any images containing drawn art along with comics were further sampled with both wd-tagger and JTP, and re-ranked for diversity. Final dataset of images was 20,000 general images (photos etc), 10,000 comics, and 10,000 art images.
The 40,000 images were bboxed with a custom labelling pipeline using google/gemma-4-31B-it and nvidia/LocateAnything-3B. After the JSON output was completed the prompts were compressed to 512 tokens maximum according to PROMPTING.md and used for training.
内容来源:Hugging Face 模型卡
在 Hugging Face 查看