Repository navigation
HexAnima 1.7.1
What is new
Mage-Flow edits with up to three pictures. Put several photos into one edit: "the fox from picture 1 sits in the car from picture 2". The "Pictures to edit" block now works for Mage-Flow, and the DiT runs in windows, so big edits fit (up to 24576 image tokens in all, e.g. 2048x2048 in about 3.5 minutes, or 1024x768 with three pictures in 2.3 minutes).
Anima 2B and 2.9B pictures of any size. The limit of 6912 patches is gone: the attention streams its keys through VTCM, and big pictures run in windows. Up to 4096x4096 (65536 patches) in the app; for example 1536x1536 in 99 s and 2560x2048 in 5.5 minutes on the 2B model. Models are trained at about 1 Mpx, so very large pictures get soft and hazy, but they work, and the time estimate on the button now grows with the square of the size.
Smaller things. The picture area on the main screen takes exactly the shape of the picture. Mage kernels moved into the shared flux3 kernel tree (contributors: build from there). New strings are translated into the 11 other languages.
Details
Two pictures of the same kind: Mage-Flow edits with several photos and Anima pictures of any size (up to 4096×4096) on the phone NPU.
- Mage-Flow edits with up to three pictures ("the fox from picture 1 sits in the car from picture 2"; the design was proposed in issue #6 by GrimmDev-Glitch): the "Pictures to edit" block of Qwen-Image works for Mage-Flow too. Every picture gets its own ViT features and DeepStack rows in the text encoder (
Image k: <|vision_start|>..., interleaved mrope positions that continue after each picture), its own reference latent after the target tokens, and RoPE frame index k + 1.mage/mk_edit_in.pywrites the same inputs formagerun editon the command line. - Mage-Flow has no token limit any more (the DiT runs in windows like LTX-2.5 and MiniMax-H3 Ref2VA, the attention streams the keys through VTCM): up to 24576 image tokens in all (the target and every picture, each picture has the size of the result), e.g. 2048x2048 (about 3.5 minutes) or 1024x768 with three pictures (2.3 minutes). The old limits (3200 patches for edits, 6144 for pictures) are gone; the time estimate on the button follows the measured step times.
- Kernels: the Mage modes (DiT 53, vision layer 55, VAE GEMM 61) moved into the shared kernel tree
flux3/hexagon/mega(which also fixes a profiling array that was too small there);mage/hexagon/megais now a README. The runner retries a call when the HMX self-test fails (rc -77) instead of stopping the picture. - Anima (2B and 2.9B) has no token limit any more (it was 6912 patches, the attention kept all keys in the 8 MB VTCM): the attention streams the keys through VTCM in chunks (two passes: row max, then exp and P*V into fp32 accumulators, the port of the Klein/Mage kernel), and above 16384 tokens a block runs in windows of 4096 tokens (X, K and V hold all tokens, the other buffers one window: 16 KB per token instead of 48 KB; per block every window first makes its K and V, then runs the whole block). The app takes up to 65536 patches (4096×4096; the runner itself 98304); the time grows with the square of the token count: one block takes 2.35 s at 16384 tokens, 7.1 s at 32768 and 24 s at 65536. Measured end to end on the phone with the 2B model and a turbo LoRA (4 steps): 1536×1536 in 99 s (22 s per full step), 2560×2048 in 5.5 minutes (80 s per step); 2.9B at 1536×1536 in 2.2 minutes (31 s per step). Results are the same as before for the sizes that fitted (windows give bit-identical numbers, chunks differ by 4e-4 from the plain attention) and the time estimate on the button follows the square. Models are trained at about 1 Mpx, so very large pictures get soft and hazy (a property of the model, the same with and without windows). A runner that is done with a big picture frees its buffer so that only one of the chain's processes holds it.
hexagon/mega/blk.c(attn_chunked, window meta M_W0/M_WN/M_PASS),megarun.cpp. - Picture area: the box under the picture on the main screen takes exactly the shape of the picture (or of the chosen size before the run), also narrower than the screen for tall pictures, so there are no empty strips at the sides.
- Translations: the new strings in the 11 other languages (the size limit message now says 65536 patches).