Chasing
--sref on open models: style cartridges for Qwen-Image, and
where native references copy from
Project chameleon, two days of Colab GPU time. Every number below is from our own runs. The report errs on the side of detail: the failures are as instructive as the one thing that worked.
0. TL;DR
- Goal. Build an open analogue of Midjourney's
--sref: a style cartridge that is computed once from one or more reference images, cached as a small object, mixed and interpolated, scaled with a strength dial, sampled at random (--sref random), and applied to any prompt, or to no prompt, without copying the reference's content. - Models. Prototype on FLUX.2-klein-base-4B. Target Qwen-Image 2.1 (Turbo, 8 steps), a 7B single-stream DiT conditioned on Qwen3-VL hidden states.
- What worked (partly). A style describer: a
small autoregressive model that reads a frozen style encoder's embedding
of the reference. It emits a distribution over the text encoder's
vocabulary, and the distribution is fed as soft tokens through the
frozen text encoder.
- It gives every cartridge property we wanted: a 256-float code, mixing, interpolation, random codes, and a clean strength dial. It also keeps the prompt intact and almost never copies content.
- It transfers zero-shot from klein to Qwen-Image, because the two models share one tokenizer.
- It carries only part of the style: palette, tonality, line art and watercolour transfer; dots, mosaics, fauvism and anime often don't.
- What failed. Every adapter trained through the
frozen DiT's flow-matching loss:
- appended state tokens (klein), free-token inversion (klein), and a perceiver over raw patch tokens with a style-similarity loss (Qwen-Image, "option B");
- all of them learned zero reference-specific information.
- With the right probe this is measurable: a wrong reference does exactly as well as the right one.
- What wins on raw style fidelity. Qwen-Image's
own multi-image input (the reference as
<image1>), with no training at all.- In t2i: CSD .43 vs .28 for our soft tokens and .31 for the describer's plain text, with the prompt kept.
- It copies content: the reference's subjects show up in new images.
- In edit mode it is erratic: it returns the reference or leaves the photo untouched.
- Mosaicking the reference into small crops lowers style but not copying.
- Where the copying comes from. Qwen-Image takes a
reference through two channels: its VAE latents, and the Qwen3-VL
encoding, which reaches the DiT only through the prompt tokens after the
image. An ablation (§7) splits them:
- the latents alone give the full native style and all of its copying;
- the VL encoding alone never copies, but carries little style (CSD .12, against .41 native and .27 for soft tokens).
- So the describer's soft tokens remain the best copy-free cartridge we have.
- A training-free hybrid (§7.1). Keep the describer text and let the image see the reference's latents only in DiT blocks 12–19. Judged against held-out images of 20 Midjourney codes, this adds +.053 CSD over the text cartridge (95% CI +.029 to +.080) with no measurable copying (DINO +.003). That's texture, such as dots, mosaics and scales, that words don't carry. It holds on bird and nature prompts (+.039), and is weaker in edit mode (+.02).
- Is prompting plus the native reference "better
everywhere"?
- For t2i style fidelity, yes, by a wide margin.
- It is not better for control: content-preserving edits, prompt-free generation, random styles, smooth mixing, a predictable strength dial, cheap caching, and not pasting subjects.
- There a text-channel cartridge (describer soft tokens or just its text) is the more usable tool.
- Notably, the describer's plain text turned out as good as its soft tokens on Qwen-Image (§5).
- A small trained adapter does work (§8.1). A rank-32 LoRA, trained for 40 minutes on MegaStyle same-style pairs, reads the reference's latents for style: +.15 CSD over the text cartridge (+.09 on bird prompts) while cutting most of the latents' copying. A reference-free, code-conditioned LoRA learned nothing (info ≈ 0).
- The ceiling was the labels, not the language
(§8.2–8.3).
- Hand-written style descriptions, as text only, beat the describer by +.17 CSD on Midjourney codes, and beat the LoRA.
- Relabelling all 41k training styles with a small vision LLM cost $4.08. The retrained head, r7, writes text that scores +.10 CSD over r6c (+.09 on bird prompts) with no extra copying.
- Hand-written descriptions are still well ahead on the hardest styles.
- Final showcase (§8.5). Eighteen styles, including a Sistine Chapel fresco, a Bernini sculpture and a sepia ink portrait, restyle 21 targets with r7's cartridge + window, along with interpolation, mixing and strength dials. Palette and lighting transfer everywhere; medium transfers on paintings and illustrations, and on photos only for drastic changes such as ink on paper or sepia pencil. The sepia portrait is the one style that converts every target.
- The cartridge, benchmarked (§5.2).
- Mixing, a strength dial and random codes all work. One image of a Midjourney sref code retrieves its code 45% of the time (chance 5%).
- 3× more training styles changed nothing on Qwen-Image.
- On held-out MegaStyle styles, even the true style prompts only reach CSD .28, against .24 for the describer. Words don't cap Midjourney styles that low: hand-written descriptions reach .50 (§8.2). The labels were the limit.
- Bitter-lesson reading.
- Small adapters cannot learn image→style conditioning from a frozen DiT's denoising loss at our compute; the signal is ~1–3 % of the loss and buried in noise.
- What works reuses a channel the big model was already trained on at scale: text, or its own image input.
- The practical lesson: don't build a new channel; write into an existing one.
- Interpretability side project, now its own article.
- A top-k SAE on Qwen3-VL over 48k MegaStyle images finds 165 strongly style-specific features: polaroid frames, ink mandalas, halftone print, pixel art.
- They are cleanly separated from content features (the Eiffel tower in any medium).
1. The target:
what --sref is (and isn't, publicly)
Midjourney's public docs describe the following:
| Feature | Behaviour |
|---|---|
--sref <url> |
conditions on a reference image's style |
--sref <number> |
recalls a style from an "internal style library" |
--sref random |
samples a new code |
--sw 0–1000 |
style weight (default 100) |
| Mixing | codes and images can be mixed with weights |
| V7 Style Creator | builds a new code from images you pick and don't pick; stacks codes rather than merging them |
Two things are notable:
- The docs state: "You cannot create a style code based on an uploaded image." Codes index a learned library; images condition directly.
- The mechanism is not public.
The closest open work:
- StyleTokenizer (arXiv 2409.02543): style → one text-space embedding.
- StyleCodes (2411.12811): a 20-symbol discrete code via an adapter, explicitly mimicking srefs.
- Image→pseudo-word methods: ELITE, E4T, InST.
- Adapter families: IP-Adapter, InstantStyle, Flux Redux.
- Trained style models on triplets: USO, OmniStyle, MegaStyle-FLUX.
- Training-free attention sharing: StyleAligned, RB-Modulation, Visual Style Prompting.
- A whole sub-literature on content leakage: CleanStyle, TRACE, SCAdapter, SafeStyle and others. It is the central failure mode of image-conditioned style.
We found no prior work for our specific describer route: image → describer → vocabulary-distribution soft tokens inside a DiT's text encoder, transferred zero-shot across models through a shared tokenizer. This came from a quick literature pass with a subagent, not a systematic review. Trabucco et al. (2406.07506) report that learned embeddings usually don't transfer across models; ours do because they live on the vocabulary simplex, not in a model's private embedding space.
Design targets we held ourselves to:
- Cacheable (a small object, not the image).
- Mixable and interpolable.
- A strength dial.
- Random codes.
- Prompt-free use.
- Content preservation in edit mode, and no subject copying in t2i.
- A frozen base model.
2. Setup
Models
- FLUX.2-klein-base-4B (prototype). Text conditioning is Qwen3-4B hidden states from layers 9/18/27 stacked into 7680-d, padded to a fixed length, with no attention mask in the DiT. SD3.5 was the first choice but is gated, and we did not accept the licence on the user's behalf.
- Qwen-Image 2.1 Turbo (target), through our own port
("qport"):
- a 7B single-stream DiT, width 4096, 32 blocks, 8 Turbo sigmas;
- the text states are the last Qwen3-VL layer before the final norm, with the system tokens dropped;
- an RGBA VAE with 64 latent channels and 16× downsampling;
- reference images enter as extra latent slots plus Qwen3-VL image
tokens in the prompt (
<image1>,<image2>).
Data
- MegaStyle-1.4M / MegaStyle++ (tencent): images
generated by Qwen-Image from about 170k style prompts × 400k
content prompts, 8 images per fine-grained style.
- Each row has a style-free content caption and a structured style
prompt; the id
s<style>_c<content>gives the style groups. - Released under a research licence.
- This dataset is nearly ideal for the task: same style with different content, plus the ground-truth style text.
- It is also a trap. It is Qwen-Image's own output distribution, which matters later.
- Each row has a style-free content caption and a structured style
prompt; the id
- Held-out evaluation:
- 128 styles from a shard never used in training ("ev99");
- Midjourney sref examples
(
peteromallet/high-quality-midjouney-srefs, eval only); - a small art set: silverpoint, pointillism, fauvism, impressionism, ink print.
Backbone
The MegaStyle encoder: SigLIP-so400m fine-tuned for style contrast. We use its pooled 1152-d embedding and, for option B, its 729 raw patch tokens.
Judges (evaluation only; never trained on)
- CSD and OneIG-StyleEncoder: style similarity to the reference.
- DINOv2: similarity to the reference, a copying / leakage proxy.
- CLIP-T: prompt adherence.
- Puppet, an earlier project, showed that CSD/DINO used as losses get reward-hacked through a frozen DiT, so we kept them out of training (with one exception, the option B style loss, see §6).
The probe: a cheap, honest metric
Image judges are slow and noisy, so most decisions used a held-out denoising probe:
- Take the DiT's flow-matching loss on held-out targets, at fixed
noise and fixed σ per sample, under different conditions:
null: content caption only;same: the cartridge from a different image of the target's style;other: the cartridge from a different style;self: the cartridge from the target itself;oracle: content caption plus the ground-truth style text, jointly encoded.
- Derived quantities:
- gain = null − same (does the cartridge help?);
- info = other − same (does it help because of this reference?);
- oracle gain = null − oracle (the ceiling text can reach).
Scale of the numbers: the oracle gain is only .007–.010, 1.5–2.7 % of a loss around .45. That smallness turns out to be the whole story of the failures.
info is the important one. A conditioning module can
lower the loss without reading the reference at all, by learning a
generic correction toward the data distribution. Only info
separates the two.
3. Phase 1 on klein: why direct adapters failed
3.1 Appended style tokens (r0–r2)
The setup:
- Pipeline: MegaStyle pooled embedding → small VAE-style encoder → code z (256-d) → transformer head → K=16 tokens in the 7680-d text-state space, appended after the padded prompt.
- The DiT is frozen; training uses the denoising loss on (ref, target) pairs that share style but not content.
| Run | What changed | Held-out result | Diagnosis |
|---|---|---|---|
| r0 | flow matching only | tokens .0019 worse than null; info 0 | — |
| r1 | + velocity distillation from the text oracle (match the student's velocity to the frozen model's under caption + true style text) | same failure | posterior collapse: σ starts at 1 and the KL weight is negligible, so z is mostly noise and the decoder ignores it |
| r2 | deterministic code | KD loss flat even on training styles | not collapse: the head cannot fit at all |
3.2 Can the channel carry style at all? (inversion + channel test)
- Free-token inversion. Optimising 16 tokens directly per style, with no encoder, at learning rates 1e-4 to 1e-2, never beat null.
- Channel position test.
- The ground-truth style text, encoded separately and appended as states, recovers 28–46 % of the oracle gain.
- The rest of the oracle comes from joint encoding: inside the LLM, caption tokens attend to style words.
- So the slot can carry style, but gradient search in the raw LLM state space can't find the points that do. That space is extremely anisotropic, with massive-activation channels and an RMS around 73.
3.3 Move the soft tokens to the encoder input
The prompt becomes
"{caption}. Style: <s1>…<sK>". The soft tokens
are input embeddings, encoded jointly with the caption by the frozen
Qwen3, like textual inversion.
A fixed-batch overfit test separated "broken gradients" from "signal buried in noise":
- The gradients were correct.
- The zero init was off-manifold and started behind null.
- Per-step progress was tiny relative to the FM target noise.
Two fixes followed: initialise from a generic style phrase, and make the loss KD-dominant. Even so, 150 steps of DiT gradient descent added only ~.0001–.0002. The DiT's gradient on conditioning is a very slow teacher.
3.4 Stop asking the DiT; supervise directly (stage a)
- r3a: regress the head's tokens onto the text encoder's
states of the style text (no DiT in the loop).
- First run with real held-out info (+.0018), but net gain was slightly negative (−.0004): the regression error puts tokens off-manifold.
- r3b: fine-tune through the DiT from that start. It
erased the style mapping within 250 steps.
- Adam's per-parameter step is ~lr regardless of gradient size, so with a weak, noisy gradient it random-walks the head.
- r3c: train only the shared offset. This gave the
first positive held-out gain (+.0013, 13 % of the
oracle).
- The offset then drifted toward a generic "average style" and info shrank.
- Verdict. Four stage-b parameterisations all plateaued at ≤ +.0013. The DiT's gradient is not the lever; stage a is.
3.5 The describer: predict the style text, feed the distribution
The insight: the best channel we have is real text in the encoder's input slot, and the target is supervised and free, since MegaStyle ships the style text. So we train a model that maps the style embedding to a distribution over the vocabulary along the style text's tokens. Soft tokens = softmax(logits / τ) @ E, encoded jointly with the caption. At τ → 0 this is plain text (the "describe" baseline). A perfect describer equals the oracle.
| Run | Describer | Held-out result |
|---|---|---|
| r5a | non-autoregressive | CE 3.47; gain +.0012 (19 % of oracle) with no DiT in training at all; hedged, repetitive text |
| r6a | autoregressive, 10k styles | memorised training styles (near the oracle on seen styles); on unseen styles, confident wrong descriptions, worse than nothing (gain −.0026) |
| r6b | + dropout + best-checkpoint selection | info +.0026, gain ≈ 0 |
| τ sweep | τ = 1.5 | best (hedging helps a little); τ = 5 is noise |
| r6c | 4× more styles (40k) | CE 1.24; gain +.0018 (27 % of oracle), info +.0025; plain-text readout +.0013 |
| r6d | ~120k styles | CE 1.08 (r6c 1.24); not fully evaluated |
r6c is the best klein result. 4× more styles fixed generalisation: gain, info and the plain-text readout all improved together.
r6c image judges (held-out MegaStyle, n=64 per arm):
| Arm | OneIG | CSD | CLIP-T |
|---|---|---|---|
| r6c code | .359 | .219 | .265 |
| Oracle (style text) | .495 | .318 | .244 |
| Plain prompt | — | — | .272 |
The code keeps the prompt and carries part of the style. The style text carries more but leaks content: logo walls, betta fish everywhere, headshot collages.
Qualitatively, the code carries palette and tonality (B&W documentary → monochrome, purple headshots → lavender) and line media (silverpoint → clean line art, ink print). It does not carry patterns or specific media: map paper, fish scales, pointillist dots (it describes "small circular dots" correctly but klein doesn't render them).
3.6 Midjourney features, replicated
| MJ feature | Our analogue | Status |
|---|---|---|
| style code | posterior mean z (256 floats, ~1 kB) | ✅ |
--sref random |
sample z from a Gaussian fitted to training posteriors | ✅ diverse, coherent styles |
--sw |
style-guidance weight w_s (0–4) | ✅ monotone, clean |
| mixing | weighted posterior pooling / z interpolation | ✅ smooth blends |
| prompt-free | empty caption + cartridge | ✅ gives palette/texture abstractions, rarely objects |
| no content copying | — | ✅ (the strongest property of this route) |
| strength < 1 | first implementation raised τ → near-uniform soft tokens → dark junk | fixed: fade style guidance instead |
4. The port: klein's describer drives Qwen-Image zero-shot
Klein's Qwen3 tokenizer and Qwen-Image 2.1's Qwen3-VL tokenizer share all 151,643 ids. The describer emits distributions over ids, so the same distribution can be multiplied with Qwen3-VL's embedding matrix instead (p @ E_qwen3vl). No retraining was needed. Parity of our soft-token encoder with qport's own encode is exact (max abs diff 0), with or without a condition image.
t2i results:
- Qwen-Image renders the described style more faithfully than
klein did:
- silverpoint → clean line art on every prompt;
- dark-blue MJ ref → a consistent navy palette;
- red/black graphic → a strong red/black look.
- Misses: fauvism (→ vintage film), pointillism (no dots), anime (→ muted vintage illustration).
Edit results:
"Change the style of this image to: <soft tokens>" on
a content image.
- Prompt-free style transfer works zero-shot and keeps the content image's composition and subject exactly.
- Strength via
edit_mix, a velocity blend between a neutral edit and the styled edit, is a clean monotone dial. - Content leakage:
- the plain-text description leaks content words in edit mode ("crowded heads" → a crowd and a grid of foxes; "gallery wall" → framed collages);
- soft tokens leak less;
- the true MegaStyle style text leaks most.
5. Head-to-head on Qwen-Image (judged, 1024 px)
Pooled over MegaStyle held-out, MJ and art references (n=56 per arm; t2i soft/text n=48):
| Mode | Arm | CSD ↑ | OneIG ↑ | DINO (copy) ↓ | CLIP-T ↑ |
|---|---|---|---|---|---|
| t2i | none (prompt only) | .110 | .160 | .028 | .248 |
| t2i | describer soft tokens | .277 | .293 | .077 | .252 |
| t2i | describer text (argmax) | .306 | .377 | .076 | .249 |
| t2i | native reference | .429 | .504 | .142 | .261 |
| t2i | native, 2×2 mosaic of crops | .369 | .449 | .151 | .255 |
| edit | none (neutral restyle) | .111 | .210 | .029 | .248 |
| edit | describer soft tokens | .227 | .332 | .050 | .246 |
| edit | describer text | .265 | .377 | .053 | .239 |
| edit | native reference | .426 | .532 | .261 | .216 |
| edit | native mosaic | .385 | .465 | .202 | .210 |
| edit | native mosaic, strength .7 | .335 | .460 | .168 | .214 |
How to read the table:
- Native wins on style by a mile. That was expected: Qwen-Image was trained to use reference images.
- Native copies.
- In t2i, DINO to the reference rises 5× over prompt-only, and subjects leak (the bride, the flag, the bonnet).
- In edit, DINO .26 and CLIP-T falls. The model often returns the reference or leaves the photo unchanged. Mosaic references didn't fix this: the failure is mode confusion ("which image is the output?"), not object leakage.
- The describer's plain text ≥ its soft tokens on Qwen-Image, in CSD and OneIG at equal copying. On klein the probe said soft (τ 1.5) > text. On the stronger encoder and DiT, the readable description is at least as good, and it is human-editable.
- The cartridge routes keep content (DINO .05–.08 vs
.14–.26) and keep the prompt.
- The judged gap between "controllable" and "faithful" is large: ~.15 CSD.
- DINO-to-reference rises with any real style transfer, so part of native's DINO is style, not copying. The visual sheets confirm real subject leakage too.
5.1 Showcase
Zero-shot, describer trained on klein only: each grid shows the reference, the plain prompt or original photo, the soft tokens and the describer's text (and, for held-out MegaStyle references, the true style prompt). Under each grid is what the describer said.
5.2 Testing the cartridge
The cartridge pipeline (make / mix /
random / apply) has a benchmark that runs on a
single 24 GB L4. It loads the encoder and the DiT in turn, because both
don't fit at once. Everything below is zero-shot on Qwen-Image 2.1 Turbo
with the klein-trained describer.
More training data doesn't help.
- r6d saw 3× the styles of r6c (120k vs 40k), and its held-out text loss is lower (1.08 vs 1.24).
- On Qwen-Image the two judge the same within noise: t2i CSD .292 vs .291 (text) and .271 vs .269 (soft).
- The describer's plain text beats its soft tokens on OneIG (.38 vs .31) and 16-way retrieval (.44 vs .38–.41, against .06 chance). On CSD (.29 vs .27) the gap is within noise. The soft tokens use τ = 1.5 and the text is their τ → 0 limit, so this is partly a temperature comparison; τ was tuned on klein, not on Qwen-Image. No cartridge copies (DINO ≤ .07), and prompt following is unchanged (CLIP-T .25).
Is the describer the bottleneck? Not on MegaStyle styles. We judged MegaStyle's own style prompts for the six held-out MegaStyle references, the descriptions the describer is trained to imitate:
| arm (6 held-out styles × 4 prompts) | CSD | OneIG | DINO |
|---|---|---|---|
| describer, soft tokens | .240 | .301 | .047 |
| describer, text | .239 | .345 | .038 |
| true style prompt (oracle) | .276 | .410 | .034 |
- A perfect describer would gain about .04 CSD.
- Even the true style prompt stays far below native references (CSD .40+ on the full reference set, §7). That is the ceiling of describing a style in words.
- So, for MegaStyle styles, more training of the same describer has little to win.
- Two caveats. This is the subset where the describer's gain over the plain prompt is smallest (soft tokens +.07 CSD, against +.22 on Midjourney codes and +.15 on art), and Midjourney and art references have no true style text to test against. Six references resolve differences of only about .03 CSD.
Midjourney sref codes. 20 codes, each with a cartridge built from one or two of its images. The target is a third, held-out image of the same code; 2 prompts each.
| cartridge | CSD | OneIG | DINO | retrieval (chance .05) |
|---|---|---|---|---|
| none (plain prompt) | .065 | .067 | .043 | .05 |
| 1 image | .331 | .414 | .082 | .45 |
| 2 images (mean z) | .361 | .376 | .105 | .35 |
- One image already finds the right code 18 times in 40 (9 codes in 20).
- One image and two images are within noise of each other at this size (retrieval 18 vs 14 of 40, CSD +.03, OneIG −.04). The only consistent shift with two images is slightly more copying (DINO .08 → .11).
Mixing. Interpolating z between two cartridges crossfades monotonically, measured by CSD to each reference.
- Silverpoint → Fauvism: .47 / .11 at t = 0, .24 / .17 at t = .5, .10 / .28 at t = 1.
- What crosses over is medium and palette, not brushwork. The Fauvist end is red-and-white rather than Fauvist.
- The pointillism cartridge never produced dots, at any mix weight.
Strength. edit_mix blends the neutral
edit with the styled edit at the velocity level. The scale runs from 0
(no style) to 1 (the full cartridge), and past 1 it extrapolates.
- On silverpoint it is a clean dial up to 1. CSD to the reference goes −.02 → .30 → .50, and CSD to the original photo goes .97 → .47 → .31. Past 1 it falls slightly (.47, .45) as the drawing washes out to near-white.
- On impressionism (CSD ≤ .08, a colour grade) and a photographic MegaStyle reference (.14 → .18), CSD keeps rising slowly past 1. So the best strength is per cartridge, not a global 1.
- The neutral end is a different sentence (a plain restyle instruction), so the axis runs from "restyle" to "restyle as this cartridge", not from the untouched photo.
- The dial is only as strong as what the cartridge carries.
Random codes. Codes sampled from a Gaussian prior
over the training posteriors give coherent, varied styles: the
--sref random analogue. Their mean pairwise CSD is .29.
That is higher than the .18–.22 between real references' outputs, so
random codes are somewhat less varied than real styles.
Consistency. Outputs of one cartridge under different prompts are closer in CSD (.44) than outputs of different cartridges under different prompts (.18–.22). The gap is .22–.26 for every head and rendering.
6. Option B: give the DiT the raw features (and a style objective)
The motivation, correct in principle: a single pooled vector, let alone a 256-float code, loses too much. MMDiTs condition on full hidden-state sequences for exactly this reason. So:
- Inputs: MegaStyle's 729 raw patch tokens (1152-d).
- Resampler: a perceiver resampler (depth 4, width
1024, 16 queries) → 16 "free tokens" in the text-state units of Qwen3-VL
(
text_mean + text_std·o). - Injection: target rows attend to the free tokens in
a separate softmax per block, scaled by a per-block
gate initialised at zero, so it starts as an exact no-op.
- A plain magnitude gate on the tokens doesn't work: the DiT's RMS norms undo it.
- Objective: flow matching plus a style
loss on the one-step estimate x̂₀ = x_t − σv at σ ≤ .9:
- differentiable VAE decode;
- MegaStyle pooled cosine + patch Gram cosine + per-channel mean/std cosine to the reference.
- Training pairs: same style, different content.
Engineering finds on the way (each cost hours):
- Qwen-Image's RoPE is not shift-invariant. Text
tokens sit on an absolute counter while the image grid is zero-centred.
- Left-padding a row by 3 tokens changed outputs by ~3.3.
- A zero gate still changed the image, because appending free tokens shifts the image's positions relative to the text.
- Fix: per-row rotations, with free tokens placed on the last text rotation.
- Our CPU test had missed it because small random weights blur attention; the test now uses sharp q/k.
- The Qwen-Image 2.1 VAE is RGBA (decode returns 4 channels).
Results (128 held-out pairs; caption-only loss .519):
| Run | gain | info | CSD | OneIG |
|---|---|---|---|---|
| soft tokens alone (no adapter) | — | — | .289 | .407 |
| patch + style loss, 1000 steps | .0797 | .00004 | .288 | .277 |
| patch, no style loss | .0755 | .00008 | .262 | .195 |
| pooled vector instead of patches | .0962 | .00002 | .313 | .226 |
| patch tokens on caption only | ~.066 | ~0 | .171 | .256 |
| + generic tokens + contrastive hinge + 4 crops + style loss | .0752 | .00003 | .252 | .298 |
The gains look large (.075–.096, ten times the oracle gain), but info is zero in every variant:
- The wrong reference does exactly as well as the right one.
- Every adapter learned the same reference-independent correction, most likely "Turbo at 512 px on MegaStyle's distribution". Recall that MegaStyle is Qwen-Image output, so the model is being taught to match itself.
- At 1024 px that correction even hurts OneIG (.41 → .20–.28).
- Countermeasures had nothing to work on:
- separate "generic" tokens to absorb the shared part (they got +.009 alone);
- a contrastive hinge against the wrong reference (the gap it pushes on stayed exactly 0.000);
- random crops of the reference.
The compression question (patch vs pooled) was untestable under this objective: neither input was used. The problem was never the bottleneck; the training signal never asked for the reference.
Why (common to klein r0–r3 and option B):
- The reference-specific part of the denoising loss is ~1–3 % of the loss, and per-sample noise in the FM target dwarfs it.
- A generic correction, by contrast, is consistent across every batch, so SGD finds it first and stops there.
- The style loss didn't change this. At high σ the one-step x̂₀ is blurry, so CSD-like features of x̂₀ barely depend on the conditioning.
- Methods that do learn image-conditioned style on top of
frozen DiTs use one of three things:
- far more steps (IP-Adapter-style training runs 10⁵–10⁶ steps);
- triplet data with explicit content/style separation (USO, OmniStyle, DeStyle);
- an unfrozen base. We had none of these at ~20 CU.
7. Where native references copy from
There is a detail of Qwen-Image's architecture we only noticed late. A reference image enters twice:
- as VAE latents in an image slot of the DiT's sequence;
- through Qwen3-VL, which reads the image inside the encoder.
But the DiT never sees Qwen3-VL's image-token states: the prefill
overwrites those rows with the latents
(x[:, image] = img_in(latents)). The VL encoding reaches
the DiT only through the prompt tokens after the image,
which attended to it inside the encoder.
So we split the channels (11 references × 3 prompts / photos, same seeds):
- lat: the encoder sees a flat grey image in the reference slot, while the DiT gets the real latents.
- vl: the encoder sees the real reference, and its slot rows are dropped from the DiT's sequence. The reference then lives only in text states: a cacheable hidden-state cartridge, the same kind of object as our soft tokens.
- vl + SAE filters: the VL-only reference with its image tokens edited at encoder layer 18 by a sparse autoencoder (see the SAE article).
| Arm | t2i CSD ↑ | t2i DINO (copy) ↓ | t2i CLIP-T | edit CSD ↑ | edit DINO ↓ | edit CLIP-T |
|---|---|---|---|---|---|---|
| none | .084 | .031 | .239 | .084 | .033 | .238 |
| describer soft tokens | .274 | .094 | .247 | .201 | .055 | .238 |
| native (latents + VL) | .407 | .164 | .256 | .491 | .330 | .187 |
| latents only | .400 | .160 | .252 | .547 | .472 | .159 |
| VL only | .122 | .079 | .256 | .139 | .045 | .254 |
| VL, SAE reconstruction | .124 | .080 | .256 | .152 | .045 | .254 |
| VL, non-style features removed | .096 | .072 | .257 | .119 | .045 | .252 |
| VL, style features only | .092 | .073 | .258 | .128 | .043 | .256 |
- The latents carry nearly all of the style and all of the copying. Latents alone match the full native reference in t2i. In edit mode they copy more than native: without the encoder's view of the reference, the model more often returns the reference instead of the photo.
- The VL channel alone is copy-free but weak. CSD .12–.14 is barely above no reference. It moves mood and palette, not medium: no pencil lines, no dots.
- The SAE filter doesn't rescue it. The reconstruction matches the unfiltered VL arm, so the encoder tolerates the SAE. Removing non-style features lowered style instead of content.
- Soft tokens beat the native VL channel by 2× at similar copying. As a copy-free cartridge, the describer still wins. A cartridge with native-level style would need to tame the latent channel, for example a LoRA that teaches the DiT to read image 2 for style only. §7.1 gets part of the way without training.
7.1 Taming the latents without training: open them only where the medium is read
The latent channel holds the texture the text can't carry. Can we take the texture and leave the subject? Everything here is training-free: the cartridge's describer text goes in the prompt, the encoder sees a grey image in the reference slot, and the reference's VAE latents fill that slot under some restriction.
- Restrictions tested.
- Shuffle the latent tokens (16 px or 64 px tiles).
- Hold the reference back for the first 3 or 5 of the 8 steps, so the text sets the layout first.
- Let the generated image see the reference only in some blocks. Puppet's per-block tests put the reading of the medium in blocks 12–19 of 32.
- From a second review (DeepSeek), also tested: a downscaled reference, low-passed latents, the mean of the code's latents, and guidance away from what the full latents add over shuffled ones.
- Judging that copying can't game. 20 Midjourney sref codes: the first image is fed, and style is measured against a held-out image of the same code. Copying is DINO to the fed image. 2 prompts, paired per code against the text cartridge alone, with 95% bootstrap intervals.
| arm (20 codes × 2 prompts) | CSD to held-out | Δ vs text | DINO to fed | Δ vs text | CLIP-T |
|---|---|---|---|---|---|
| plain prompt | .065 | .033 | .233 | ||
| describer text (cartridge) | .332 | .097 | .245 | ||
| + full latents | .450 | +.117 [+.079, +.158] | .198 | +.101 [+.049, +.161] | .232 |
| + latents, blocks 12–19 only | .386 | +.053 [+.029, +.080] | .100 | +.003 [−.008, +.012] | .243 |
| + latents from step 3 on | .376 | +.044 [+.023, +.062] | .110 | +.013 [−.002, +.030] | .241 |
| + mean latents of the code | .402 | +.070 [+.036, +.108] | .136 | +.038 [+.010, +.071] | .232 |
| + low-passed latents | .349 | +.016 [−.006, +.039] | .091 | −.006 | .244 |
| + 4×4-tile shuffle | .422 | +.090 | .123 | +.026 | .202 |
| + copy-negative guidance | .404 | +.072 | .138 | +.041 | .188 |
| + reference downscaled to 64 px | .580 | .696 | .124 |
- The block window is a free win. Restricting the reference to blocks 12–19 adds a fifth of the cartridge's own style gain, with no measurable copying and no loss of prompt following. Holding the reference back for 3 steps does almost as well.
- What it adds is texture. In the images that means pointillist dots, a mosaic wall, and the bride's scaly iridescent dress turned into a jacket, while the full latents paste the bride herself.
- The rest fail in instructive ways.
- Shuffled tiles and copy-negative guidance are pasted as literal collages.
- A downscaled reference makes the model redraw the reference itself, sharp, ignoring the prompt.
- The mean of a code's latents adds style but also copies.
- Where it stops. The window keeps less than half of what the full latents add (+.05 vs +.12). The rest of the latents' style is read in the same blocks as the subject.
Other content, and edit mode. We repeated the main arms with new content: 8 bird and nature subjects (kingfisher, heron, owl, hummingbird, puffins, starlings, a waterfall, a mountain lake). Each was rendered as a photograph for the edit tests and used as a prompt for t2i. Same 20 codes, same protocol, Δ against the text cartridge alone:
| run | full latents: Δ CSD / Δ DINO to fed | blocks 12–19: Δ CSD [95% CI] | blocks 12–19: Δ DINO | step 3 on: Δ CSD |
|---|---|---|---|---|
| t2i, original prompts (above) | +.117 / +.101 | +.053 [+.029, +.080] | +.003 | +.044 |
| t2i, bird / nature prompts (×4) | +.067 / +.023 | +.039 [+.027, +.051] | +.004 | +.027 |
| edit, original photos (×3) | +.156 / +.423 | +.016 [+.000, +.031] | +.004 | +.007 |
| edit, bird / nature photos (×4) | +.087 / +.152 | +.022 [+.009, +.034] | +.002 | +.017 |
- The window holds up on new subjects. It adds style in all four runs with copying unchanged, and in edits it keeps the photo: DINO to the photo moves by −.013 or less.
- It is much weaker in edit mode (+.02 vs +.04–.05). The photo's own latents fill the same blocks, and the text cartridge already restyles well there.
- Full latents are worst in edit mode. With them the model often returns the style reference instead of the photo (DINO to the photo .86 → .46 on the original photos). That is the native "image 2" failure, reproduced.
- Combining the window with the late start is worse than either alone.
- The describer still sets the ceiling. When it misreads a style, for example an ink illustration it calls "vintage sepia", the window can't recover it.
8. So: is "just prompt it and feed the reference" better everywhere?
Short answer: for style fidelity, yes; for a controllable cartridge, no. And the best cartridge is itself made of text.
| Need | Best option we found | Why |
|---|---|---|
| Max style fidelity, t2i | prompt + native reference | the model was trained for it; CSD .43 |
| Style without subject copying | describer text / soft tokens | DINO .05–.08 vs .14; a text channel can't paste a bride |
| Texture without subject copying | describer text + reference latents in blocks 12–19 (§7.1) | +.05 CSD over text alone, DINO unchanged; needs the reference image at render time |
| Max style with little copying, trained | reference LoRA + describer text (§8.1) | +.15 CSD over text, DINO +.03; ~40 min of training; needs the reference at render time |
| Best copy-free cartridge | r7 describer text (§8.3) | +.10 CSD over r6c from better training labels; still readable text |
| Edit a photo, keep its content | describer text or soft tokens + edit_mix |
native edit returns image 2 or nothing; describer edits keep composition exactly |
| Strength dial | edit_mix (any route), or w_s on soft tokens |
velocity blending is clean everywhere |
| Cacheable code | describer z (256 floats) → soft tokens or text | fixed-size, reusable, mixable; cached Qwen3-VL states of the reference are copy-free but carry little style (§7) |
| Random styles / interpolation | describer z | native has no latent space to sample |
| Prompt-free | describer (either mode) | native t2i needs a prompt to anchor the output; native edit is erratic |
| Readable / editable | describer text | you can read it, fix a word, and re-run |
| Inference cost | describer | a reference adds ~1k latent rows plus VL tokens to every DiT step; text adds ~40 tokens |
Does a "native cartridge" exist? Only partly:
- The reference's Qwen3-VL encoding can be cached and reused, and
several references can be blended at velocity level
(
edit_mix). - But the encoder states the DiT reads carry little of the style (§7). The style that makes native references strong lives in the VAE latents, together with the content, and the model decides per prompt how much of each to take.
- Neither the mosaic (style −14 %, copying −0 %) nor explicit "take nothing else from it" instructions separated them.
The bitter-lesson reading.
- Every hand-designed conditioning pathway lost to channels trained at
scale:
- our appended states, our inversions, the patch-token perceiver;
- and, in raw fidelity, our describer too.
- The describer is the exception that proves the rule. It works because it writes into the most heavily trained channel the DiT has, text, through the frozen encoder. It inherits generalisation from scaling (4× more styles fixed it) rather than from architecture.
- A useful corollary for anyone trying this: if a probe can't
show
info > 0, don't trust the judged images or the gain. A generic correction looks like progress.
Where a trained cartridge could still win (written before §8.1, which tries a small version of the first idea):
- LoRA on the DiT with native references and a content-free reference objective, i.e. teaching the model "image 2 is style only". Training data would be triplets (content, style ref, stylised result) from DeStyle/OmniStyle (Apache-2.0) or MegaStyle pairs. This is what USO/OmniStyle do, and it attacks the actual failure, copying, at its source.
- Describer + a short LoRA that teaches the DiT to
read soft tokens more strongly. The describer already gives
info > 0, so the DiT gradient would have a real signal to amplify instead of nothing. - Distil native → cartridge. Use native-reference generations, filtered for low DINO, as targets for the describer path. This turns the leaky but faithful teacher into a clean student.
8.1 A trained cartridge after all: a small reference LoRA
The first item on that list, scaled down to what we could afford. A
rank-32 LoRA on the attention projections (q, k, v, out) of all 32 DiT
blocks, 33.6M parameters. It was trained with plain flow matching on
6,000 MegaStyle same-style pairs: reference A's VAE latents sit in the
<image1> slot next to the describer text, and the
target is B, a different subject in the same style, at 512 px and the 8
turbo noise levels. That's 400 steps at batch 8, about 40 minutes on an
A100.
- The probe moved. The stock DiT already reads the reference's latents (info .026 in the same probe). The LoRA raised info to .046 (1.7×). Most of its loss gain (+.150 of +.199) was a generic correction that also appears without any reference: the same shortcut as option B. This time it didn't hurt the judged 1024 px images.
- A reference-free variant failed. We also tried a code-conditioned LoRA, where the MegaStyle style vector becomes 8 tokens after the text cartridge and no reference image is needed. It reached info ≈ 0 by step 200: all of its gain was generic. We stopped it there. Flow matching alone gives a code no reason to be reference-specific.
Judged the same way as §7.1 (20 Midjourney codes; the first image is fed and style is measured against a held-out one; paired against the describer text; 95% CIs):
| Prompts | Arm | CSD vs text | DINO copy vs text | CLIP-T |
|---|---|---|---|---|
| default (2) | describer text | .332 | .097 | .245 |
| + full latents | +.117 [+.080, +.157] | +.101 [+.049, +.158] | .232 | |
| + latents in blocks 12–19 | +.053 [+.028, +.080] | +.003 | .243 | |
| LoRA + text | +.152 [+.097, +.204] | +.029 [+.009, +.049] | .246 | |
| bird / nature (4) | describer text | .297 | .037 | .264 |
| + full latents | +.067 [+.040, +.100] | +.023 [+.008, +.048] | .258 | |
| + latents in blocks 12–19 | +.039 [+.027, +.051] | +.004 | .262 | |
| LoRA + text | +.092 [+.053, +.131] | +.003 (n.s.) | .265 |
The LoRA beats the raw latents on style while cutting most of their copying, and it keeps the prompt. Where the full latents return the reference or paste its objects into a bird scene, the LoRA draws the prompt in the reference's palette and medium. Fine texture, such as a glitch mosaic, is still partly lost.
Splitting the arms on 10 codes shows the two channels are complementary and depend on the prompt:
- On generic prompts the image, through the LoRA, carries the style (LoRA alone +.108). The text adds nothing there but a little copying.
- On bird prompts the image alone barely moves Qwen-Image off photographic birds (LoRA alone −.023). The cartridge text carries the palette and mood (LoRA + text +.059).
- LoRA plus the block 12–19 window is worse than either alone in t2i (+.090): they compete. By eye, the LoRA's generic drift (flatter, more saturated, a MegaStyle look) shows on painterly references, where cartridge + window often reads better.
- In edit mode the t2i-trained LoRA returns the reference on some codes. LoRA + text + window keeps every photo (DINO to the photo −.015) and gives the best edits by eye, but only +.029 CSD. Edit mode needs its own training data (photo, style reference, target triplets).
Both pilots, data preparation included, cost about 13 CU.
8.2 Is the ceiling the language? Hand-written descriptions
§5.2 left a worrying number: on held-out MegaStyle styles, even MegaStyle's own style prompts only reach CSD .28. If words cap style that low, the whole text-cartridge route is capped too. We tested it directly. For 10 of the Midjourney codes, the coding assistant wrote one style-only description per code by looking at the fed image (medium, named palette, linework, lighting, finish; no subject). The description was added to the plain prompt, with no reference image at all.
| Prompts | Arm | CSD | vs describer text | DINO copy |
|---|---|---|---|---|
| default (10 codes × 2) | describer text (r6c) | .333 | .103 | |
| hand-written description, text only | .502 | +.168 [+.101, +.236] | .187 | |
| LoRA + text (§8.1) | .445 | +.112 | .132 | |
| + full latents | .418 | +.084 | .160 | |
| + latents in blocks 12–19 | .385 | +.052 | .107 | |
| bird / nature (10 × 2) | describer text (r6c) | .286 | .041 | |
| hand-written description | .457 | +.171 [+.095, +.250] | .070 | |
| LoRA + text / full latents | .345 / .345 | +.059 | .048 / .055 |
Text alone, when the description is good, beat the LoRA and the raw reference. Some of the default-prompt gain is subject matter leaking through the words (copying .187 vs .103), but on the bird prompts the copying barely moves and the gain is the same. So the cap was never the language channel. It was the quality of the training labels: MegaStyle's keyword prompts, and a head that learned to reproduce them. That also explains §5.2's other result, where 3× more styles with the same labels changed nothing.
8.3 Relabelling 41k styles for $4, and a new head (r7)
If labels are the cap, relabel. We sent the same 10 codes to three small vision models on OpenRouter with one 60–90 word brief: describe only the shared style, starting with "In the style of", covering medium, named colours, linework, shading, lighting, composition and finish, with no subjects. Reasoning was off where the endpoint allows it.
| Model | $ per style | Words | Notes |
|---|---|---|---|
| Claude Haiku 5.5 | .00022 | 95–121 (over the brief) | boilerplate composition lines; called a late-90s CG render a cel-shaded anime still |
| DeepSeek V4.1 Flash | .00009 | 75–86 | named the medium and era best (late-90s CG, 3D render); least subject leakage |
| GLM 5.3 Flash | .00007 | 64–76 | reasoning can't be turned off (low effort); most subject leakage (figures, hair, temple wall) |
DeepSeek labelled every style the describer is trained on. Each call got a 2×2 grid of up to 4 images of one style, so the text describes what the images share rather than one image's content. That covered 40,000 MegaStyle styles, the 128 held-out ones, and 1,054 Midjourney sref codes (the 32 evaluation codes left out). It cost $4.08, with 0 failures, in about 40 minutes on a CPU runtime. The labels average 81 words, about 112 tokens.
The new head, r7, uses r6c's recipe on the new labels. The Midjourney codes are sampled 3× more often, the describer may write up to 144 tokens instead of 48, and training ran 4,500 steps (about 28 minutes on an A100, 58.5M parameters). Its describer text, judged on the same 20 codes and seeds as r6c:
| Prompts | r6c text | r7 text | CSD gain | DINO copy | CLIP-T |
|---|---|---|---|---|---|
| default (20 × 2) | .332 | .433 | +.101 [+.046, +.158] | +.010 (n.s.) | +.004 |
| bird / nature (20 × 4) | .297 | .390 | +.093 [+.043, +.143] | .000 | −.009 |
That's the largest single improvement in the project, from better words and nothing else: no extra copying, the prompt kept, and the cartridge is still a readable paragraph. It is not the ceiling. On the 10 hardest codes from §8.2, r7 gains only +.05 (n.s.), and the hand-written descriptions stay far ahead (.50 against .38). The head writes fluent, plausible style text, but it still misreads unusual media (the mural above comes out sepia, without its gold linework). r6c's random-code prior doesn't apply to r7, which has its own code space, so random cartridges need a new prior fit (§8.6).
8.4 Showcase: new styles, old vs new head, and the window
Eight styles that were never used for training or tuning: four from our own collection (oil pastel, embroidery, ink sketch, crayon drawing) and four Midjourney codes. Each is applied to two prompts and to edits of three photos, Vermeer's Girl with a Pearl Earring, an eagle and a chameleon. Same seed throughout, one grid per setting:
The edits are still the weak spot. With text only, the eagle and the chameleon barely change for most styles; the Vermeer follows best. The window adds little in edit mode, which matches §7.1 (+.02). A cartridge strong enough to restyle an arbitrary photo probably needs the edit training §8.1 points to.
8.5 Final showcase: every target, eighteen styles, and the dials
The showcase we'd show someone: 21 target images (our own pick of paintings, anime frames, nature and product photos, a nebula) restyled by eighteen styles. Four Midjourney codes, plus fourteen of ours, including Michelangelo's Sistine Chapel ceiling, a Bernini sculpture, a design sketchbook and a photo of jellyfish. Every image uses r7's cartridge plus the latent window (blocks 12–19), one seed, and no prompt: the edit instruction is the cartridge's text. That's 378 edits, at about 3 minutes per style on one A100. Each grid shows a target's input above its restyled version. §8.12 repeats it with the grid head, which is now the default.
What the eighteen grids say together:
- Palette, tonality and lighting transfer everywhere. The navy duotone, the Bernini chiaroscuro and the fresco wash reach even the most stubborn photos.
- Medium transfers on illustrations and paintings, and on photos only when the change is drastic. Ink on white paper converts the eagle, and sepia pencil converts everything; oil pastel and crayon mostly regrade it.
- Material and content don't transfer. Nothing turns to marble, no fibres or jellyfish appear, and the sketchbook's notes stay out. The cartridge describes how an image is rendered (lighting, palette, surface), not what it is made of or what is in it.
- The chameleon resists almost everything. It's a saturated, high-detail macro photo whose own latents anchor every DiT block. Palette-level styles shift its colours a little, and only the sepia portrait, which throws colour away entirely, fully converts it.
The cartridge controls, on a few picked styles (r7, cartridge only; a mixed code has no single reference image, so there is no window):
8.6 Random styles for r7: a code prior
r7 has its own code space, so the r6c prior (§5.2) didn't carry
over. We fitted a new one: a Gaussian (mean plus a full 256 × 256
covariance) over r7's posterior means for 4,096 training images,
1,024 from each of four shards. The code space is low-rank in practice:
90 % of the variance sits in 23 of the 256 directions. A seed draws one
code from this Gaussian, so a seed works like a Midjourney
--sref number: the same seed always gives the same style,
for this head only. Codes near the mean are safe and generic; codes
far out are unusual.
The prior is on the Hub with the head (code_prior.pt)
and in the notebook as pipe.random(seed). Random codes
have no reference image, so they never get the texture boost.
8.7 A 24 GB GPU, and soft tokens vs text
L4. The serving pipeline used to need an A100. In swap mode on a 22 GB L4 every step ran out of memory, because the describer ran next to the 16 GB Qwen3-VL encoder. Two changes fixed it:
- a third phase, so the head, the style encoder and Qwen3's embedding table are on the GPU only while making or describing a cartridge;
- the strength dial's two-conditioning edit keeps only one KV cache on the GPU at a time.
Peak memory is now 19.9 GB (reference plus texture boost, or strength 1.5 plus texture), and a call takes 45–85 s. The notebook runs on an L4.
Soft tokens vs text. The describer can hand Qwen-Image either its greedy text or soft tokens (each a probability-weighted mix of vocabulary embeddings). On four references and two random codes they came out close. Soft tokens act like a softened average of the text: they drop specific accents (a cyan, an ink sketch's green) and keep more of the photo. Text is more literal. The texture boost only works with text, and it is the largest gain of all, so text stays the default.
8.8 A head that reads the feature grid
The head reads only the style encoder's pooled vector. We gave it the encoder's 4 × 4 feature grid as well: the references' mean grid becomes 16 extra memory tokens in front of z's four. A learned placeholder stands in when a code has no grid (random codes, or a mix with a grid-less code). The grid is dropped 20 % of the time in training so the head still works without it. The cartridge grows from 1 KB to about 38 KB.
- Held-out cross-entropy: 0.931 against r7's 0.942, and 0.945 for the same head with its grid removed.
- Images (six styles): the crayon dog is clearly better (coloured pencil on cream paper instead of flat gouache), and the gouache poster and pastel anime palettes are closer to the reference. The sepia portrait is a tie. The fresco is still "watercolour and ink", and the ink sketch changes without improving.
On text alone this looked like a small gain. With the texture boost and restyle depth it's a larger one, and the grid head became the default (§8.11).
8.9 Restyle depth: why nature photos resist
The eagle, a beetle and the chameleon kept their photographic look under almost every style (§8.5). Four obvious fixes did nothing at all:
- a softened, upscaled photo, to remove fine photo texture;
- edit strength 1.5;
- an instruction to "replace the photographic texture";
- the texture boost.
So the cause is neither fine detail nor wording. The cause is where the DiT reads the photo. We reused the latent-window mechanism from §7, this time on the photo: the image being generated can see the photo's latents only in DiT blocks 0 to k.
The photo's surface is locked in at blocks 14–15. The change is sharp, so the dial is fine-grained between 13 and 15. On other photos depth 13 goes too far for some: an anime girl's tearful expression becomes a generic smile, and lettering on a GPU board is garbled.
So restyle depth is an option for nature photos, not a new
default. Even depth 14 changes things that should stay: the Vermeer
girl's and the anime girl's expressions, and any lettering. It is
off by default; pipe.run(..., depth=13)
(a notebook dropdown) redraws fur, feathers and scales when a photo
won't let go of its photographic look.
8.10 A pretrained writer: Qwen3-0.6B with LoRA
r7's writer is a 4-layer transformer trained from scratch, and it shows: it repeats words ("organic, organic", "scratchy, scratchy"). We swapped it for a pretrained language model. r7's posterior gives z as before; a small MLP turns z into 8 prefix embeddings, and Qwen3-0.6B-Base writes the label after them. Same tokenizer, targets and held-out batches as r7, so the losses compare directly.
- LoRA or full fine-tuning? In a 2,000-step pilot, LoRA (rank 32 on every linear layer, 30.6M trainable) reached 0.879 held-out cross-entropy and was still falling. Full fine-tuning (606M trainable) bottomed out at 0.887 and then overfit. LoRA won, at 117 MB on top of the shared 0.6B base.
- Longer run. At r7's length (4,500 steps) LoRA peaked at 0.885 at step 3,000, then overfit (0.900 at 4,000). More steps bought nothing; r7 is at 0.942.
- Text. Fluent, no repeated words in 18 styles (r7: 6), the same length. It names a closer medium in places: "classical oil painting" for the Sistine fresco (r7: watercolour), "ink on textured paper" for the hatched wire flower (r7: watercolour).
Then the images: each head's text for six styles, with the shipped defaults (texture boost on), same seed. The eagle and chameleon edits use restyle depth 13, the setting it is for (§8.9).
Two wins each and two draws. A style-similarity score agrees that there's no clear winner. CSD to the style reference over all 18 styles (4 prompts and 2 photo edits each, text only, same seed):
| head | CSD | CSD t2i | CSD edit | CLIP-T | vs r7, mean (95% CI) | styles better |
|---|---|---|---|---|---|---|
| r7 | .290 | .293 | .285 | .255 | – | – |
| LoRA writer | .299 | .298 | .299 | .252 | +.009 (−.032, +.052) | 8/18 |
We treat CSD as a check, not the judge. On the pilot's sepia images it scored the LM heads' flat vector drawings far above r7's sepia sketches (.44 against .23), which is backwards to the eye.
So a pretrained writer gives lower loss and cleaner text, but not better images: it writes a different description, not a more faithful one, and it isn't released. The lower loss probably reflects fluency in the labels' language more than style fidelity: the labels have more than one good wording, and a language model is better at predicting the wording. The gap to hand-written descriptions (§8.2) remains.
8.11 The grid head becomes the default
§8.8 judged the grid head on text alone, without the texture boost. We re-ran it with the shipped settings next to r7's showcase images: texture boost on, and restyle depth 13 on the eagle and chameleon. Same seed; only the head differs.
Two clear wins, one slight win and a tie on four styles, plus the
lower held-out loss (0.931 against 0.942). That's better than the
pretrained writer did (§8.10), so the grid head is now the default
(head_grid.pt on the Hub; r7 stays there as
head_pre.pt).
- Cartridge size. About 38 KB instead of 1 KB, almost all of it the 16 × 1152 grid in half precision. Still small.
- Random styles. A new prior over the grid head's codes (4,096 training images, as in §8.6): 90 % of the variance in 21 of 256 directions. Random codes have no grid, so the head uses its learned stand-in, which matches r7's quality (0.945 against 0.942).
- Mixes. Mixing averages the grids along with the codes; mixing with a random code drops the grid.
- L4. The same peaks as r7: 19.9 GB with the texture boost, 19.2 GB for a random style, 16.6 GB for a mix.
8.12 Final showcase with the grid head
The §8.5 showcase again with the shipped setup: the grid head, the texture boost, and restyle depth 13 on the five animal photos (eagle, penguins, beetle, lionfish, chameleon). Same 18 styles, 21 targets and seed: 378 edits in under half an hour on two L40S GPUs (Modal), plus the dials on a third. An interactive version lets you compare each edit with its input.
Against §8.5, three things changed:
- Hand-made media arrive. Crayon, naive crayon and the wire-flower line drawing now come out as drawings on paper. r7 gave coloured-pencil texture or a watercolour wash. Local detail such as paper, outlines and stroke marks is what the feature grid adds.
- The stubborn photos give way. With depth 13 the chameleon, eagle, beetle and lionfish convert in the drawing styles (crayon, sepia, ink, line art, sketchbook), where §8.5 left the chameleon a photo under all but the sepia portrait.
- What didn't change. Palette-only styles (navy duotone, jellyfish, temple, Bernini) look much as before. Material and content still don't transfer: no marble, no fibres, no sketchbook notes, no mural motifs. The fresco is still a wash, and oil pastel is still neon rather than oil pastel.
The dials, cartridge only, as in §8.5 (mixes and interpolations average the feature grids too):
9. Interpretability: a style SAE on Qwen3-VL
This grew into its own article: A style SAE inside Qwen-Image's text encoder, with an interactive explorer. In short:
- Setup. Top-k SAEs (16k features, k = 32) on Qwen3-VL activations of 48k MegaStyle images from 6k styles.
- Style features. 165 features at the last layer are strongly style-specific (η² > .5, against a chance level of .125): polaroid frames, ink mandalas, halftone screen print, splatter paint, pixel art, chibi stickers, 3D cartoon renders, a purple palette.
- Content features. The Eiffel tower, fireplaces and tigers fire on their subject in any style.
- A correction to an earlier draft. The DiT does not read the image-token states these features live in (§7).
- The filter. Keeping only a reference's style features lowered style rather than removing content.
10. Lessons we'd tell someone starting this
- Probe with a wrong-reference control from day one.
info(wrong ref − right ref) caught every failed adapter; loss gains and judged images did not. - Know the size of your signal. The text oracle's gain was 1.5–2.7 % of the loss. If your best possible conditioning moves the loss that little, a frozen-DiT denoising objective will train your adapter on the generic part first.
- Adam on weak gradients is a random walk. Its step is ~lr per parameter whatever the gradient's size. With noisy conditioning gradients, a pretrained mapping gets erased in a few hundred steps.
- Supervise in the space you'll use. Predicting the style text, a free target thanks to MegaStyle, beat every DiT-gradient method, and needed no DiT during training at all.
- Vocabulary-simplex soft tokens transfer across models that share a tokenizer. Learned embeddings don't.
- Data scale beats architecture for generalisation. The AR describer went from "worse than nothing" to the best head with 4× more styles and nothing else. A further 3× did nothing on Qwen-Image (§5.2). The limit then was the labels, not the text channel: better labels on the same styles gave +.10 (§8.3).
- Check the base model's positional encoding before appending tokens. Qwen-Image's RoPE isn't shift-invariant.
- Native references copy, and instructions don't stop it. The copying rides on the reference's VAE latents, not on the encoder's view of it. Edit mode with two images is unreliable about which image is the output.
- Judges as metrics, never as losses (except in a tightly controlled form, and even then they didn't help here).
- Budget hygiene. An idle GPU guard saved more compute than any optimisation: one hung upload cost about 8 CU before we added it. Save the trained weights before any post-training evaluation: an out-of-memory error in a sample printout once cost a whole 37-minute run.
- Measure the ceiling by hand before scaling. Ten hand-written descriptions showed in about 2 CU that labels, not language, were the limit. The fix then cost $4 of API calls.
Appendix: open questions
- Can a LoRA teach the DiT to read a reference's latents for style
only? §7 shows that both the style and the copying live there. Partly
(§8.1): a small t2i LoRA keeps most of the style and drops most of the
copying. Edit mode needs triplet training; MegaStyle's
s<style>_c<content>ids may already hold such triplets if contents repeat across styles (unverified). - How much of the gap between r7 and hand-written descriptions closes with more labelled styles or richer labels? A bigger, pretrained writer alone did not close it (§8.10).
- Do the SAE's style features at layer 36 predict which styles the describer fails on? Pointillist dots, mosaics?
- Can SAE features of the reference be used as an interpretable cartridge? Use them as a describer input, or select only the "style-ish" features before re-synthesis.