Files
alzeo/tests
Hasan BasbunarandClaude Opus 5 0f7eb3fa63 Add the Qwen-Image 2.1 lane: install, serve, and drive it from the cockpit
Text to image, image editing with up to ten references, and the native RGBA this
model is built for, served by SGLang Diffusion on the same box as the LLM lane.
Opt-in with ./install.sh --with-image, which the one-liner passes through.

One engine at a time, said in systemd rather than in a wrapper someone can
bypass: the checkpoint is 31 GB of weights and a request peaks at 34.8 GB, so
the unit carries Conflicts= against all three LLM lanes. It is not enabled at
boot, because a box that reboots should come back the way its owner left it.

A venv and not docker, because the cookbook says so for this model ("no
published Docker image is verified") and Qwen-Image 2.1 is in no SGLang release.
The released wheel goes in first all the same: it carries sglang-kernel built
for aarch64, which a source tree does not build, and source-first leaves a
runtime with no native kernels that dies on the first request. The pinned
source then overlays it with --no-deps, because re-resolving pulls a
transformers that breaks the encoder this model needs.

Everything the tab claims was measured against this lane rather than copied:
1024x1024 at 40 steps in 38.2 s, 512x512 in 9.0 s, an edit with one reference
in 44.6 s, ten references in 69.6 s, a transparent generation that comes back
with 68% of its pixels genuinely transparent, and the same seed twice giving
byte-identical output.

Four refusals the cockpit makes so a client does not have to read them out of a
500 with an empty body:

  - width and height must be multiples of 32; 1328x1328 answers HTTP 500 and
    says why only in the engine's own log;
  - an output format must always be sent. Left out, the API falls back to JPEG
    when the background is not transparent, this model returns RGBA for
    everything it makes, and PIL refuses to write RGBA as JPEG, so the plainest
    possible request fails for that alone;
  - CFG needs a scale above 1 AND a negative prompt (schedule_batch.py:399).
    Either alone is ignored byte for byte: three requests differing only in
    true_cfg_scale produced the same SHA-256;
  - an edit sends its size as `size`, not width/height, which /edits does not
    have. Sent the other way a request for 512x512 came back 1024x1024.

The lane has no API key, and that is why it is loopback. The diffusion runtime
is a different argument parser from the LLM one and has neither --api-key nor
--sleep-on-idle; passing either kills the unit at startup. `sglang serve --help`
lists both, because with no resolvable diffusion model it prints the LLM parser,
so the help text is not the evidence. The installer's own smoke test found this
on the first install. The cockpit is the authenticated door in front of it.

Editing redraws the whole picture rather than patching it. The edit asked for
does happen, and the rest comes back with about twice the fine detail of the
source: 2.16x Laplacian energy across 22 cases, every reference encoding, every
prompt, 20 to 80 steps, every guidance setting and every flow_shift, including
an edit that asks for nothing to change. Generation never does it. The tab says
so next to the button.

49 tests. The installer gates hold the wheel-before-source order, the full
commit pin, the disk check and a smoke test that reads a PNG header rather than
trusting a status code; the unit gates hold Conflicts=, the loopback bind and
the absence of the two flags that kill it; the tab gates hold the model's own
defaults, the seven aspect ratios Qwen publishes, every size being a multiple of
32, and that Reset restores every field it offers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 16:09:23 +02:00
..