lab

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


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 closest open work:

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:

  1. Cacheable (a small object, not the image).
  2. Mixable and interpolable.
  3. A strength dial.
  4. Random codes.
  5. Prompt-free use.
  6. Content preservation in edit mode, and no subject copying in t2i.
  7. A frozen base model.

2. Setup

Models

Data

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)

The probe: a cheap, honest metric

Image judges are slow and noisy, so most decisions used a held-out denoising probe:

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:

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)

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":

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)

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:

Silverpoint reference and four prompts rendered plain, with describer soft tokens, and with the describer text
Text-to-image, zero-shot on Qwen-Image 2.1 Turbo with a describer trained on FLUX.2-klein. The describer's own words are under the grid.
Pointillist reference: soft tokens and text give a warm vintage look but no dots
A miss: the describer names the dots, but the soft tokens only carry the warm, pale palette.

Edit results: "Change the style of this image to: <soft tokens>" on a content image.

Four photos restyled as line drawings from a silverpoint reference, composition unchanged
Prompt-free edit mode: the content image's composition and subject are kept exactly.
A lighthouse photo restyled at strengths 0.5 to 2.0 for three references
Strength dial: a velocity blend of the neutral edit and the style-code edit (1.0 = style code alone, 2.0 = extrapolated).

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:

  1. Native wins on style by a mile. That was expected: Qwen-Image was trained to use reference images.
  2. 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.
  3. 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.
Native reference vs describer soft tokens on four references: native copies the bride and the impressionist sitter into new prompts
Same four prompts per row. Native reference (middle) has the stronger style, including real pointillist dots, but pastes the bride and the impressionist sitter into other prompts. Soft tokens (right) never copy a subject and carry less of the style.
  1. 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.

Four photos restyled with a cinematic blue and orange look from a held-out MegaStyle reference
Edit mode, held-out MegaStyle style: cinematic blue/orange grading carried to every photo, composition untouched.
Four photos restyled as loose watercolour from a held-out MegaStyle reference
Edit mode: a watercolour look carried by both soft tokens and text, with every subject intact.
A gallery-wall reference: soft tokens give herringbone backgrounds, the text version pastes framed collages
Where text leaks and soft tokens don't: the describer's text says “gallery wall” and the model hangs framed art everywhere; the soft tokens keep only the herringbone pattern.
Text-to-image with a cinematic reference: soft tokens and text give blue/red lighting, the true style prompt pastes betta fish
Text-to-image. The bottom row is MegaStyle's own style prompt for this reference: the strongest style, and betta fish in every image.
Text-to-image with a documentary reference: the text version leaks crowds and a grid of foxes, the true style prompt leaks heart logos
Content leakage through words: “crowded heads” in the description becomes a crowd and a grid of foxes; the true style prompt adds a wall of heart logos.
Text-to-image with a red and black graphic reference: soft tokens, text and true style all give a red-black-white look
A red/black graphic style, carried by all three routes with no copying.

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.

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

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

Mixing. Interpolating z between two cartridges crossfades monotonically, measured by CSD to each reference.

Two rows of lighthouses interpolating between two style cartridges: silverpoint sketch to red and white colour, and a beige pointillist palette to a red striped photo look
Interpolating z between two cartridges (same prompt, same seed). Medium and palette blend smoothly; texture such as pointillist dots never appears.

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.

A lighthouse photo edited at strengths 0, .5, 1, 1.5 and 2 for a silverpoint, a photographic and an impressionist cartridge
Edit strength 0 → 2 (768 px). Silverpoint is a clean dial up to 1; impressionism only warms the palette; the photographic style hardly changes the photo.

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.

Six images from random style codes: a glowing lighthouse, an art-deco portrait, a low-poly lighthouse, an orange ink illustration, a warm painted lighthouse, a sepia cafe scene
Six random codes, two prompts. No reference image involved.

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:

Engineering finds on the way (each cost hours):

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 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):


7. Where native references copy from

There is a detail of Qwen-Image's architecture we only noticed late. A reference image enters twice:

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):

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
Grid: four references, each rendered as native, latents only, VL only and VL with the SAE style filter; latents copy the bride and the impressionist sitter
Text-to-image, “a woman reading a book in a cafe”. Latents only behaves like the full native reference: pencil for silverpoint, the bride and the sitter pasted in, dots for pointillism. VL only keeps the prompt and only the mood.
Grid: edit mode; native and latents-only return the silverpoint horse instead of editing the photo; VL-only arms leave the photo almost unchanged
Edit mode. With the latents present the model often returns the reference itself (the horse); without them it barely restyles.

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.

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
Four references, each rendered as describer text, text plus full latents, and text plus latents visible only in blocks 12 to 19; full latents paste the bride and the smokers, the window keeps scales, mosaic tiles and dots
“A woman reading a book in a cafe”. Full latents paste the bride, the smokers under the arch and the yellow jacket; latents visible only in blocks 12–19 keep the scaly fabric, the mosaic and the dots, and the prompt's 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
A crayon-drawing style reference applied to kingfisher, heron, owl and hummingbird photos: full latents return the reference drawing for two of them, the block-12-19 window keeps every bird
Edit mode, bird and nature photos, one Midjourney code. Full latents return the reference drawing instead of the kingfisher and the owl; with the latents visible only in blocks 12–19, every photo keeps its bird and gains a little of the crayon texture.

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 bitter-lesson reading.

Where a trained cartridge could still win (written before §8.1, which tries a small version of the first idea):

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.

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:

Both pilots, data preparation included, cost about 13 CU.

One gouache-poster reference and two prompts rendered with the cartridge, cartridge plus window, LoRA plus cartridge and LoRA only
One Midjourney code, two prompts. The cartridge and cartridge + window keep a soft painted look; the LoRA arms take the reference's saturated blue and yellow poster palette.

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.

Two Midjourney references and two prompts each, rendered with the old head's text, the new head's text, a hand-written description and LoRA plus cartridge
Two Midjourney codes (gouache poster, mineral-pigment mural), two prompts each. The hand-written description gets the mural's clouds, flames and crowded composition; the old head gives a plain photographic look, the new head (§8.3) gets the sepia mood but not the motifs.

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:

Eight style references, each rendered by the old head as a heron and a lighthouse and as edits of the Vermeer, an eagle and a chameleon
Old head (r6c), cartridge only. The text is MegaStyle-style keywords, and the results lean towards a generic painted look.
The same eight styles and five outputs with the new head's cartridge
New head (r7), cartridge only. The medium now lands far more often: brush ink on white paper for the ink sketch, a coloured-pencil texture for the crayon drawing, the navy duotone, the anime scenery.
The same grid with the new head's cartridge plus the reference's latents in blocks 12 to 19
New head (r7), cartridge + latent window (blocks 12–19). The window adds the reference's surface: stitched denim grain for the embroidery, rougher strokes for the crayon and ink. No subjects are copied.

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.

A oil-pastel style reference and all 21 targets, each shown above its restyled version
Oil pastel: the neon pinks, teals and oranges carry to every target, and the Vermeer and the anime frames become flat poster colour. The chameleon keeps its photo look.
A embroidery style reference and all 21 targets, each shown above its restyled version
Embroidery: a stitched, grainy surface and warm yellows on most targets. The window is what adds the grain.
A ink-sketch style reference and all 21 targets, each shown above its restyled version
Ink sketch: the strongest medium change. The eagle, penguins and rocket become ink drawings on white paper; the chameleon does not.
A crayon-drawing style reference and all 21 targets, each shown above its restyled version
Crayon drawing: a coloured-pencil texture and warm paper, rather than a child's scribble.
A Sistine Chapel fresco style reference and all 21 targets, each shown above its restyled version
Michelangelo's Sistine Chapel ceiling: read as a pale blue and cream fresco wash rather than his warm flesh tones, but that wash restyles almost every target, the eagle included.
A Bernini marble sculpture style reference and all 21 targets, each shown above its restyled version
Bernini's Constantine: the cartridge carries the low-key, warm, chiaroscuro lighting and tonality, not the marble. Nothing turns to stone; every target becomes a dim sepia photograph.
A gouache-poster style reference and all 21 targets, each shown above its restyled version
Gouache poster (Midjourney code): golden yellows and painterly grading.
A navy-duotone style reference and all 21 targets, each shown above its restyled version
Navy duotone (Midjourney code): the clearest palette transfer. Every target, the chameleon included, turns navy and pale blue.
A anime-scenery style reference and all 21 targets, each shown above its restyled version
Anime scenery (Midjourney code): blue skies and clean cel-like rendering on the illustrations and the Vermeer; the photos mostly shift colour.
A mineral-pigment mural style reference and all 21 targets, each shown above its restyled version
Mineral-pigment mural (Midjourney code): sepia and muted ochre. The gold linework and motifs of the reference never appear (see §8.2).
A sepia ink portrait style reference and all 21 targets, each shown above its restyled version
Sepia ink portrait: the strongest style of all eighteen. Every target becomes a pencil or etching drawing in sepia on cream paper, the eagle, nebula and chameleon included. A drawing on a flat toned ground is a complete, simple description, and the edit can rebuild any image in it.
A design sketchbook style reference and all 21 targets, each shown above its restyled version
A page of design-sketchbook studies: black line art on white paper with red and blue spot colour, closer to graphic manga than to pencil studies. The handwritten annotations never appear; they're content, not style.
A jellyfish photo style reference and all 21 targets, each shown above its restyled version
A jellyfish photo as a style: deep navy and warm gold, applied as a grade to everything. A photo's style is its palette and lighting, so that's all there is to transfer.
A painted anime landscape style reference and all 21 targets, each shown above its restyled version
A painted anime landscape: a teal-and-amber film grade with darker shadows. The bright, painterly look of the reference doesn't carry; the colour does.
A neon fibre tractography style reference and all 21 targets, each shown above its restyled version
Diffusion-MRI tractography: neon violet, cyan and green over every target. The fibres themselves never appear.
A naive crayon painting style reference and all 21 targets, each shown above its restyled version
A naive crayon painting: flat primary yellow, blue and red, like a screen print, on every target. Even the eagle turns blue and red.
A pastel anime illustration style reference and all 21 targets, each shown above its restyled version
Pastel anime illustration: a washed-out watercolour in pastel rainbow tones on cream paper. The eagle and penguins convert; the chameleon keeps its colours.
A wire flower line drawing style reference and all 21 targets, each shown above its restyled version
A wire flower drawn with fine hatching: a faded cream and sage watercolour wash. The hatching, the reference's most distinctive mark, doesn't appear.

What the eighteen grids say together:

The cartridge controls, on a few picked styles (r7, cartridge only; a mixed code has no single reference image, so there is no window):

Two interpolations, ink sketch to oil pastel and navy duotone to anime scenery, each on a heron prompt and the Vermeer edit at 0, 25, 50, 75 and 100 percent
Interpolating z between two cartridges. Ink sketch → oil pastel moves from ink on paper through a soft painted look to flat neon poster colour; navy duotone → anime scenery brightens step by step from a dark misty duotone to clean cel blue.
Four 50/50 mixes of two styles, each on a heron prompt and the Vermeer edit, next to each parent alone
50/50 mixes next to each parent. Embroidery + crayon gives a coloured-pencil Vermeer that neither parent produces; oil pastel + navy duotone keeps the flat poster shapes in a dark teal palette; fresco + ink sketch is a light ink wash. The fresco was added after the cartridge-only showcase, so it has no "alone" image.
The eagle and chameleon photos edited with ink-sketch and oil-pastel cartridges at strengths 0.5, 1, 1.5 and 2
The edit strength dial on the two most stubborn photos. At 0.5 the photo barely changes; 1.5–2 pushes the oil pastel's neon palette much further and turns the ink-sketch eagle fully to ink. The chameleon only gains ink outlines at 2.0, and 2.0 starts to show artefacts (green streaks on the eagle).

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.

Twelve random style codes, each applied to a lighthouse prompt, a fox prompt and the Vermeer edit, with the describer's text beside each row
Twelve seeds from r7's prior, each on two prompts and an edit, with the text the describer writes for that code. All twelve are coherent and consistent across the three images. They lean to polished digital looks (cinematic photo, digital painting, 3D render, flat vector), never a hand-made medium such as crayon or embroidery: the centre of the training distribution is digital illustration.

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:

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.

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:

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.

Naive crayon painting style on an eagle, a beetle and a chameleon photo: the input, the current edit, and the photo visible only in blocks 0-11, 0-13, 0-15, 0-17 and 0-19
The photo window on three nature photos (naive crayon painting, same text and seed). Up to block 15 or later looks the same as the plain edit. At 0–11 the photos are fully redrawn but lose their composition: the fish and leaf disappear and the chameleon becomes a generic lizard. At 0–13 the pose, subject and props stay and the surface becomes crayon.

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.

Sepia ink portrait style on Vermeer, an anime frame, a person at a desk, a GPU board and a sea arch: plain edit, depth 13, depth 14, then the same three with texture boost
Restyle depth beyond nature (sepia ink portrait). Depth 13 draws more boldly everywhere, but the anime frame's expression drifts. Depth 14 sits in between but still softens the expressions and garbles the lettering. The texture boost combines with either.

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.

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).

Pastel anime illustration style: r7 and LoRA-writer rows on the heron and lighthouse prompts and the Vermeer, eagle and chameleon edits
Pastel anime: the LoRA writer wins. Flat, clean-lined illustration in pale blue and dusty pink, close to the reference; r7 gives a soft watercolour on cream.
Gouache poster style: r7 and LoRA-writer rows on the same five inputs
Gouache poster (Midjourney code): the LoRA writer wins. It brings in the reference's sky blue next to the yellow; r7 stays gold and dark.
Renaissance fresco style: r7 and LoRA-writer rows on the same five inputs
Sistine fresco: r7 wins on palette. The LoRA writer's "classical oil painting" is a closer medium but comes out dark brown; r7's pale blue and cream wash is nearer the chalky ceiling. Neither gets the warm flesh tones.
Naive crayon painting style: r7 and LoRA-writer rows on the same five inputs
Naive crayon painting: both miss the cream paper and scribbled marks. r7's teal and lemon are closer; the LoRA writer's red-and-yellow screen print is further off.
Ink sketch style: r7 and LoRA-writer rows on the same five inputs
Ink sketch: a split. The LoRA writer's crisp black line art is closer to the reference's dense, precise inking, but its yellow and magenta accents are too loud; r7 is sketchier, with orange and green splashes.
Sepia ink portrait style: r7 and LoRA-writer rows on the same five inputs
Sepia ink portrait: a tie. The LoRA writer's paper is a warmer sepia. (The 2,000-step pilot had lost "sepia" here; the longer run got it back.)

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):

headCSDCSD t2iCSD editCLIP-Tvs 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.

Naive crayon painting style: r7 and grid-head rows on the heron and lighthouse prompts and the Vermeer, eagle and chameleon edits
Naive crayon painting: the clearest win of any head we tried. The grid head draws in coloured pencil and crayon on cream paper, like the reference. With restyle depth, even the eagle and the chameleon are drawn rather than photographed. r7 gives flat, saturated gouache.
Gouache poster style: r7 and grid-head rows on the same five inputs
Gouache poster (Midjourney code): the grid head brings in the reference's sky blue and teal; r7 stays gold and dark.
Pastel anime illustration style: r7 and grid-head rows on the same five inputs
Pastel anime: a slight win, with paler blue and pink closer to the reference. Both heads still paint watercolour rather than the reference's flat line art.
Renaissance fresco style: r7 and grid-head rows on the same five inputs
Sistine fresco: a tie. Both give an ink-and-wash look, and the grid head adds orange accents that aren't in the reference.

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).

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:

A crayon drawing style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Crayon drawing: black marker outlines and flat crayon fills on white paper, like the reference: a child's drawing at last. r7 gave a soft coloured-pencil texture.
A naive crayon painting style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Naive crayon painting: coloured pencil and crayon on cream paper across every target. The eagle, beetle and lionfish are drawn, not photographed.
A sepia ink portrait style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Sepia ink portrait: still the strongest style. Every target becomes a sepia drawing on toned paper, the chameleon included.
A wire flower line drawing style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Wire flower: fine line drawings on white, close to the reference's hatched line work. r7 gave a cream-and-sage watercolour wash; the grid sees the lines the pooled vector missed.
A ink sketch style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Ink sketch: hard black-and-white inking with red and cyan accents. The line work is right; the reference's white ground and pastel colour fills often turn into black grounds.
A design sketchbook style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Design sketchbook: black line art on white with red and blue spot colour. The handwritten notes still never appear.
A pastel anime illustration style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Pastel anime: pale washes of sky blue and pink on white. Washed-out watercolour rather than the reference's clean line art.
A Renaissance fresco style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Sistine fresco: a grey ink-and-wash drawing with faint blue. The warm flesh tones and the fresco surface still don't come through.
A oil pastel style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Oil pastel: neon magenta, blue and cyan on everything, closer to synthwave than to oil pastel; the reference's hatched strokes are missing.
A embroidery style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Embroidery: a grainy, stitched surface in golds, greens and blues, on most targets.
A Baroque marble sculpture style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Bernini: as before, low-key warm chiaroscuro and a sepia grade; nothing turns to marble.
A neon fibre tractography style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Tractography: neon violet, cyan and magenta glow. The fibres never appear.
A jellyfish photo style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Jellyfish photo: a deep navy and gold grade.
A painted anime landscape style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Painted anime landscape: a teal-and-amber film grade, as with r7.
A gouache poster (MJ) style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Gouache poster: cobalt blue and golden yellow in thick painterly strokes. Closer to the reference's blue than r7's gold.
A navy duotone (MJ) style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Navy duotone: every target turns navy and slate, now with small warm accents (a red hairband, red spots).
A anime scenery (MJ) style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Anime scenery: teal, deep blue and green with flat cel-like shapes; the illustrations convert fully.
A mural (MJ) style reference and all 21 targets, restyled by the grid head with the texture boost, each input above its restyled version
Mineral-pigment mural: muted olive and ochre. The reference's gold linework and motifs still never appear.

The dials, cartridge only, as in §8.5 (mixes and interpolations average the feature grids too):

Two interpolations with the grid head, ink sketch to oil pastel and navy duotone to anime scenery, on a heron prompt and the Vermeer edit at 0, 25, 50, 75 and 100 percent
Interpolation. Ink sketch → oil pastel passes through a pop-art sunburst at 50 % that neither end has. Navy duotone → anime scenery brightens step by step into teal and green.
Four 50/50 mixes with the grid head, each on a heron prompt and the Vermeer edit, next to each parent alone
50/50 mixes. Embroidery + crayon still gives coloured pencil, now on salmon paper; gouache + mural is a dark painterly blend; fresco + ink sketch keeps the ink.
The eagle and chameleon photos edited with ink-sketch and oil-pastel cartridges at strengths 0.5, 1, 1.5 and 2, grid head
Edit strength, without restyle depth. The ink-sketch chameleon now converts at 1.0, where r7's needed 2.0. The oil-pastel chameleon takes the neon palette but keeps its photographic scales.

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:

Eight SAE feature cards with six top images each: polaroids, ink mandalas, halftone print, splatter paint, pixel art, chibi stickers, 3D cartoon, purple 3D renders
Eight of the 165 strongly style-specific features at layer 36, with their automatic labels.

10. Lessons we'd tell someone starting this

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Vocabulary-simplex soft tokens transfer across models that share a tokenizer. Learned embeddings don't.
  6. 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).
  7. Check the base model's positional encoding before appending tokens. Qwen-Image's RoPE isn't shift-invariant.
  8. 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.
  9. Judges as metrics, never as losses (except in a tightly controlled form, and even then they didn't help here).
  10. 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.
  11. 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