Krea-2-Engineer V1 — experimental encoder-only finetune of the Krea-2 Qwen3-VL text encoder
Browse files- .gitattributes +3 -0
- Krea2-Engineer-V1-bf16.safetensors +3 -0
- LICENSE.pdf +3 -0
- NOTICE +5 -0
- README.md +195 -0
- evidence/Krea2-Engineer-V1_AB_50.png +3 -0
- evidence/krea2_ab_sheet_v1.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
evidence/Krea2-Engineer-V1_AB_50.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
evidence/krea2_ab_sheet_v1.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
LICENSE.pdf filter=lfs diff=lfs merge=lfs -text
|
Krea2-Engineer-V1-bf16.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06bef753117e22c1afa721d387bb9154fcbad2a4eb6a7eac192221d1396c46ab
|
| 3 |
+
size 8875713440
|
LICENSE.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b82a2805162bde714a4eb27b9063c4fc3345d08a30be055134a6160e5430ba74
|
| 3 |
+
size 137711
|
NOTICE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Krea 2 is licensed under the Krea 2 Community License Agreement. For more information, visit https://krea.ai/krea-2-licensing.
|
| 2 |
+
|
| 3 |
+
This model (Krea-2-Engineer-V1) is a Derivative of krea/Krea-2-Turbo: the text encoder has been modified (fine-tuned with SMART DoRA on the Z-Image-Engineer V7 corpus) by BennyDaBall. Weights have been modified from the original. This is not an official Krea product and is not endorsed by Krea.
|
| 4 |
+
|
| 5 |
+
Use of this model and its derivatives remains subject to the Krea 2 Community License Agreement (see LICENSE.pdf), including its commercial-use revenue threshold and content-filtering requirements.
|
README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: krea-2-community-license
|
| 4 |
+
license_link: https://huggingface.co/BennyDaBall/Krea-2-Engineer-V1/blob/main/LICENSE.pdf
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- krea/Krea-2-Turbo
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
+
tags:
|
| 11 |
+
- krea
|
| 12 |
+
- krea-2
|
| 13 |
+
- text-encoder
|
| 14 |
+
- qwen3-vl
|
| 15 |
+
- image-generation
|
| 16 |
+
- prompt-engineering
|
| 17 |
+
- dora
|
| 18 |
+
- smart-dora
|
| 19 |
+
- comfyui
|
| 20 |
+
- lm-studio
|
| 21 |
+
- experimental
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
# Krea-2-Engineer V1 (4B)
|
| 25 |
+
|
| 26 |
+
**Follow me on X [@BennyDaBall_OG](https://x.com/BennyDaBall_OG) !**
|
| 27 |
+
|
| 28 |
+
> **Experimental — read this first.** This is **V1**: a first, purely experimental swing at the Krea-2 line. It fine-tunes **only the text encoder** of Krea-2 — no DiT, no VAE, no diffusion backbone touched. The goal isn't better *text rendering*; it's a **better image** out the other end — richer composition, lighting, and material detail from the exact same prompt and seed. It is not a finished product. It's me changing the smallest possible part of the model and measuring whether the pictures got better.
|
| 29 |
+
|
| 30 |
+
## Model Metadata
|
| 31 |
+
|
| 32 |
+
| Field | Value |
|
| 33 |
+
|---|---|
|
| 34 |
+
| License | `other` — Krea 2 Community License Agreement (see `LICENSE.pdf`) |
|
| 35 |
+
| Base Model | [`krea/Krea-2-Turbo`](https://huggingface.co/krea/Krea-2-Turbo) (text encoder) |
|
| 36 |
+
| Architecture | Qwen3-VL ~4B text tower (`Qwen3VLModel`), language tower only |
|
| 37 |
+
| Method | SMART DoRA (r64 / a64), differentiable drift hinge |
|
| 38 |
+
| Use | ComfyUI text encoder (`CLIPLoader`, type `krea2`) · chat GGUF companion |
|
| 39 |
+
| Format | Merged bf16 safetensors |
|
| 40 |
+
| Status | **V1 — experimental, text-encoder-only** |
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
A text encoder is the part of a diffusion model that turns your words into the numbers the image model actually listens to. **Krea-2-Engineer** retrains *just that part* of Krea-2 — leaving the renderer, the VAE, and every other weight exactly as Krea shipped them — so the same prompt lands as a more composed, better-lit, more material-aware image. Same model, same sampler, same seed; the only thing that changed is how the prompt gets *heard*.
|
| 45 |
+
|
| 46 |
+
It's the model whispering to itself, which is legally distinct from sorcery.
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
|
| 50 |
+
*10 prompts, same seed per row. Left column: the stock Krea-2 encoder. Right column: Krea-2-Engineer V1. Nothing else in the pipeline changed.*
|
| 51 |
+
|
| 52 |
+
## What is Krea-2-Engineer?
|
| 53 |
+
|
| 54 |
+
It is a DoRA fine-tune of the **Qwen3-VL text encoder** that ships inside [`krea/Krea-2-Turbo`](https://huggingface.co/krea/Krea-2-Turbo), trained on the **Z-Image-Engineer V7** corpus. The diffusion transformer, the VAE, and the rest of Krea-2 are untouched — this is a drop-in replacement for *one component*.
|
| 55 |
+
|
| 56 |
+
Because that encoder is a real Qwen3-VL model under the hood, it has a second life: you can also **talk to it / run it as a prompt writer** in LM Studio (a GGUF build is on the way — see below).
|
| 57 |
+
|
| 58 |
+
### Key Use Cases
|
| 59 |
+
|
| 60 |
+
- **Drop-in image enhancement** — swap it in for the stock Krea-2 text encoder in ComfyUI and render as normal. Same prompt, more composed image.
|
| 61 |
+
- **Prompt writer** — it was trained on the Engineer prompt-rewrite corpus, so it can also expand `a rock` into a composed, material-aware prompt instead of the usual `very detailed rock, best quality, please clap` sludge.
|
| 62 |
+
- **A base to iterate on** — V1 is a clean encoder-only baseline. DPO and image-grounded GRPO stages are the obvious next moves.
|
| 63 |
+
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
## Under the Hood: SMART DoRA
|
| 67 |
+
|
| 68 |
+
The encoder was tuned with the same training system that built the Z-Image-Engineer line, ported to Krea's Qwen3-VL encoder. Two forces do the work, plus four light-touch regularizers.
|
| 69 |
+
|
| 70 |
+
**The writer loss** teaches the model to produce richer conditioning. **The drift hinge** is the anti-forgetting leash — a per-token cosine constraint that lets the encoder change freely *as long as* each token's representation stays inside a cone around the original Krea weights. It can learn, but it can't wander off and lobotomize the base model. Across this entire run the mean cosine to base held at **0.984** (margin `0.92`) — a precise tune, not a blowout.
|
| 71 |
+
|
| 72 |
+
| Regularizer | What it Does | Why it Matters |
|
| 73 |
+
|---|---|---|
|
| 74 |
+
| **Entropic** | Watches the output-token entropy vs a knowledge-mass estimate | Keeps the conditioning confident, not mushy |
|
| 75 |
+
| **Holographic** | Shapes how information spreads across the encoder's depth | Keeps the representation well-conditioned layer-to-layer |
|
| 76 |
+
| **Topological** | Constrains the token-to-token manifold geometry | Stops the token relationships from collapsing |
|
| 77 |
+
| **Manifold** | Light variance penalty directly on the adapter matrices | Keeps the DoRA weights healthy |
|
| 78 |
+
|
| 79 |
+
All four run as **frozen, fixed-shape penalties** (their internal heads do not train) — they nudge the encoder without becoming a second thing to babysit.
|
| 80 |
+
|
| 81 |
+
### The Refinement Pipeline
|
| 82 |
+
|
| 83 |
+
1. Load the stock Krea-2 Qwen3-VL text encoder (language tower only; the vision tower is loaded but frozen and unused for T2I).
|
| 84 |
+
2. Attach SMART DoRA to the text-tower projections (`q/k/v/o/gate/up/down`). Nothing else is trainable.
|
| 85 |
+
3. Train one epoch on the V7 corpus: `writer CE + 0.5·drift_hinge + SMART`.
|
| 86 |
+
4. Merge the adapter and export bf16 for `transformers`, plus a key-remapped `krea2` encoder for ComfyUI.
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## Quick Start
|
| 91 |
+
|
| 92 |
+
### ComfyUI (image enhancement — the main event)
|
| 93 |
+
|
| 94 |
+
Drop `Krea2-Engineer-V1-bf16.safetensors` into `ComfyUI/models/text_encoders/`, then in your Krea-2 Turbo workflow point the **`CLIPLoader`** at it with **`type: krea2`**. Everything else stays stock.
|
| 95 |
+
|
| 96 |
+
### Verified Image Settings
|
| 97 |
+
|
| 98 |
+
```text
|
| 99 |
+
Diffusion Model : krea2_turbo_fp8_scaled.safetensors (UNETLoader, weight_dtype default)
|
| 100 |
+
Text Encoder : Krea2-Engineer-V1-bf16.safetensors (CLIPLoader, type: krea2)
|
| 101 |
+
VAE : qwen_image_vae.safetensors
|
| 102 |
+
Resolution : 1024 x 1024
|
| 103 |
+
Steps : 8
|
| 104 |
+
CFG : 1.0
|
| 105 |
+
Sampler : euler
|
| 106 |
+
Scheduler : simple
|
| 107 |
+
Negative : (none — Turbo runs at CFG 1.0)
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
### LM Studio (talk to it / prompt writer)
|
| 111 |
+
|
| 112 |
+
Because the encoder is a real Qwen3-VL model, it also runs as a **chat / prompt-writer LLM**. Grab the `Q8_0` GGUF from the companion repo [`BennyDaBall/Krea-2-Engineer-V1-GGUF`](https://huggingface.co/BennyDaBall/Krea-2-Engineer-V1-GGUF), load it in LM Studio, and paste the prompt-writer **system prompt** (in the companion card). Feed it a lazy seed like `a rock` and it returns one composed, cinematic image prompt — no tag soup.
|
| 113 |
+
|
| 114 |
+
---
|
| 115 |
+
|
| 116 |
+
## Training Facts
|
| 117 |
+
|
| 118 |
+
I believe in open science, which is just a fancy way of saying "show the receipts."
|
| 119 |
+
|
| 120 |
+
**Hardware**
|
| 121 |
+
|
| 122 |
+
- Trained locally on a single **RTX 5090 (32GB)**.
|
| 123 |
+
- PyTorch `2.10.0+cu130`, CUDA `13.0`, `transformers` 5.7, `peft` 0.19.1.
|
| 124 |
+
|
| 125 |
+
**Dataset**
|
| 126 |
+
|
| 127 |
+
- Z-Image-Engineer **V7** corpus.
|
| 128 |
+
- Train rows: `74,540` · Eval rows: `1,400`.
|
| 129 |
+
|
| 130 |
+
**Configuration**
|
| 131 |
+
|
| 132 |
+
| Parameter | Specification |
|
| 133 |
+
|---|---|
|
| 134 |
+
| Base text encoder | `krea/Krea-2-Turbo/text_encoder` (Qwen3-VL ~4B) |
|
| 135 |
+
| Tokenizer | `krea/Krea-2-Turbo/tokenizer` (Qwen2Tokenizer, ChatML) |
|
| 136 |
+
| Adapter | SMART DoRA, rank `64` / alpha `64` / dropout `0.03`, stable-dora |
|
| 137 |
+
| Target modules | `q_proj k_proj v_proj o_proj gate_proj up_proj down_proj` (text tower only) |
|
| 138 |
+
| Conditioning tap | penultimate hidden layer (`hidden_states[-2]`) |
|
| 139 |
+
| Drift hinge | cosine margin `0.92`, weight `0.5`, every 2 micro-steps |
|
| 140 |
+
| Schedule | 1 epoch · `4,659` steps · batch `2` × grad-accum `8` · lr `1e-4` cosine |
|
| 141 |
+
| Wall-clock | ~15.5 h |
|
| 142 |
+
| Final eval loss | `1.150` (from `1.317` at the first eval) |
|
| 143 |
+
| Final drift mean-cosine | `0.984` (held inside the cone the entire run) |
|
| 144 |
+
|
| 145 |
+
The vision tower of the Qwen3-VL encoder is never trained or used — this is a pure text-conditioning fine-tune.
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
## GGUF — Chat / Prompt Writer
|
| 150 |
+
|
| 151 |
+
The Qwen3-VL text tower is repacked as a standard **Qwen3** model and quantized, so it loads in **stock LM Studio** with no special build.
|
| 152 |
+
|
| 153 |
+
- **Companion repo:** [`BennyDaBall/Krea-2-Engineer-V1-GGUF`](https://huggingface.co/BennyDaBall/Krea-2-Engineer-V1-GGUF)
|
| 154 |
+
- **Quant:** `Q8_0` (~4 GB, near-lossless). More quants on request.
|
| 155 |
+
- Use it as a **prompt enhancer** — feed a lazy seed, get a composed cinematic prompt back, then paste that into your image workflow.
|
| 156 |
+
|
| 157 |
+
---
|
| 158 |
+
|
| 159 |
+
## Verification & Proof
|
| 160 |
+
|
| 161 |
+
The A/B contact sheet above (`evidence/krea2_ab_sheet_v1.png`) is the honest evidence: **10 prompts, fixed seed per row, only the text encoder swapped** between columns (stock Krea-2 encoder vs V1). No cherry-picking the sampler, no different seeds, no rewrite step — just the encoder. A precision-matched bf16 build of the *un*-trained base was used as the control so the difference is the training, not a quantization artifact.
|
| 162 |
+
|
| 163 |
+
A broader **50-prompt** A/B sheet (portraits, landscapes, food, animals, products, architecture) is included at [`evidence/Krea2-Engineer-V1_AB_50.png`](evidence/Krea2-Engineer-V1_AB_50.png) — same controls, 100 renders, for the full picture.
|
| 164 |
+
|
| 165 |
+
This is V1. The differences are real but *measured* — a targeted lift, not a transformation. That's by design: the drift hinge deliberately keeps the encoder close to Krea's, so you do not get a full-epoch run nuking the base model's quality.
|
| 166 |
+
|
| 167 |
+
---
|
| 168 |
+
|
| 169 |
+
## Disclaimer & Acknowledgements
|
| 170 |
+
|
| 171 |
+
This is an **experimental, first-attempt, text-encoder-only** fine-tune. It changes how prompts are encoded; it does **not** retrain Krea-2 itself, and it does not guarantee a perfect seed every single time. Diffusion is still diffusion. Use creative judgment locally.
|
| 172 |
+
|
| 173 |
+
**This model is a Derivative of `krea/Krea-2-Turbo` — the text encoder has been modified (fine-tuned) by BennyDaBall.** It is not an official Krea product and is not endorsed by Krea.
|
| 174 |
+
|
| 175 |
+
Thanks to:
|
| 176 |
+
|
| 177 |
+
- **Krea** for releasing Krea-2 and its weights ([`krea/Krea-2-Turbo`](https://huggingface.co/krea/Krea-2-Turbo)).
|
| 178 |
+
- **Tongyi-MAI** and **Qwen** for the Qwen3-VL text-encoder backbone this all rides on.
|
| 179 |
+
- The open-source maintainers behind **ComfyUI**, **PEFT**, **Transformers**, **llama.cpp**, and **LM Studio**.
|
| 180 |
+
- My local power utility, which now classifies me as a small industrial facility.
|
| 181 |
+
|
| 182 |
+
## License
|
| 183 |
+
|
| 184 |
+
Released under the **Krea 2 Community License Agreement** (full text in `LICENSE.pdf`; canonical: <https://www.krea.ai/krea-2-licensing>). As a Derivative of Krea-2, this model carries that license forward. In plain terms:
|
| 185 |
+
|
| 186 |
+
- **Commercial use is allowed only if your total company-wide annual revenue is under $1,000,000 USD** (trailing twelve months). At or above that, you need an Enterprise License from Krea.
|
| 187 |
+
- If you deploy it, you must implement **reasonable content filtering**, keep the **"Krea"** name prefix, ship the agreement + the notice below, **state that the model was modified**, and **not** relicense the Krea-derived weights under a more permissive license.
|
| 188 |
+
|
| 189 |
+
> **NOTICE:** Krea 2 is licensed under the Krea 2 Community License Agreement. For more information, visit https://krea.ai/krea-2-licensing.
|
| 190 |
+
|
| 191 |
+
---
|
| 192 |
+
|
| 193 |
+
**Built & trained locally with care by BennyDaBall.**
|
| 194 |
+
|
| 195 |
+
**Follow me on X [@BennyDaBall_OG](https://x.com/BennyDaBall_OG) !**
|
evidence/Krea2-Engineer-V1_AB_50.png
ADDED
|
Git LFS Details
|
evidence/krea2_ab_sheet_v1.png
ADDED
|
Git LFS Details
|