--- license: apache-2.0 base_model: Qwen/Qwen3.5-4B base_model_relation: adapter pipeline_tag: text-to-image language: - en tags: - jeveration - mlx - apple-silicon - one-pass - text-to-image - derivative --- ![DiffusionBear — Jeveration MLX · one pass · EXPERIMENTAL](assets/showcase/hero-jeveration-mlx.jpg) # Jeveration-MLX — MLX port of Jeveration for Apple Silicon > **Derivative work.** This repository is an unofficial **MLX derivative** of > [linlinlinlinsdada/Jeveration](https://huggingface.co/linlinlinlinsdada/Jeveration) (Apache-2.0): the same > rank-256 LoRA, decision heads and TA-TiTok decoder, re-implemented for MLX (`jev_mlx.py`, MIT) on the frozen > [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) backbone (Apache-2.0). Under Apache-2.0 the derivative > keeps the same licence; see "Licenses" below. This repo hosts the **MLX port** of [Jeveration](https://github.com/Carol-lyh/Jeveration) (arXiv [2611.24738](https://arxiv.org/abs/2611.24738), Apache-2.0): a frozen **Qwen3.5-4B** vision-language backbone with a rank-256 LoRA, 128 joint decision tokens, an adaLN image head, and the **TA-TiTok BL128** 512-px decoder + **CLIP ViT-L/14-336** text tower. One forward pass of the backbone produces the whole 512×512 image — no denoising loop. It runs with `mlx` + `mlx-vlm` only (no PyTorch), via the included `jev_mlx.py`, and is wired into [DiffusionBear](https://github.com/OuincheWinch/DiffusionBear) as the `jeveration` model (engine `jev`, one-shot subprocess, backbone q4 by default on 16 GB). ## Files | File | Size | What | |---|---|---| | `jev_mlx.py` | — | self-contained MLX port (backbone via mlx_vlm, LoRA merged, heads, decoder, CLIP) | | `weights/lora.safetensors` | 1.95 GB | the 200 rank-256 LoRA adapters (fp32, merged in fp32 at load) | | `weights/heads.safetensors` | 0.99 GB | decision-token inputs, adaLN image head, code heads (bf16) | | `weights/decoder512.safetensors` | 0.61 GB | TA-TiTok 512-px plain decoder, minus the source-decoder `cond_*` (bf16) | | `weights/codebook.safetensors` | 2 MB | TA-TiTok `quantize.embedding.weight` [8192, 64] | | `weights/clip_text.safetensors` | 0.25 GB | CLIP ViT-L/14-336 **text tower only** (bf16) | | `weights/lat_stats.json` | — | latent mean/std of the codebook | | `clip/` | 1.4 MB | CLIP BPE tokenizer files | The backbone is **not** duplicated here: it is `Qwen/Qwen3.5-4B` at the pinned revision `851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a` (Apache-2.0), downloaded on first use (`resolve_backbone()` in `jev_mlx.py`). On a 16 GB Mac the backbone is quantized to q4 in-process after the LoRA merge (`quantize=4`, ~7–10 s per image measured on M1). ## Usage ```bash pip install mlx mlx-vlm transformers safetensors pillow numpy hf download Ouinche/Jeveration-MLX --local-dir jeveration-mlx DIFFUSIONBEAR_JEVERATION_DIR=jeveration-mlx python jeveration-mlx/jev_mlx.py 4 \ "A lone pine tree on a small island in a calm lake at dawn." out.png ``` Args: `[quantize bits (4|8|none)] [prompt] [out.png]`. ## Examples (Apple M1, 16 GB unified memory, this repo) Rendered with the full **FP16 world** (Qwen3.5-4B backbone + LoRA merged + heads + decoder + CLIP all in `float16`; per-shard cast at load): | Prompt | Image (512×512, one pass) | |---|---| | "A lone pine tree on a small grassy island in a calm lake at dawn…" | ![pine island](examples/fp16_pine_island.png) | | "A small stone castle on a green hill under a bright blue sky…" | ![castle](examples/fp16_castle.png) | Timings on M1 16 GB (see `examples/timings_fp16.json`): **load 76 s**, then **60–81 s per 512×512 image** in the FP16 world. For comparison, the shipped in-app default quantizes the backbone to **q4**: ~7–10 s per image. ## Examples from DiffusionBear v0.5.3 (Apple M4 Pro VM, 16 GB) Real outputs from DiffusionBear v0.5.3 (`backend/jev_engine.py`, commit `c47a419`), not cherry-picked across seeds: one run per prompt, seed 42. Settings: native 512×512, 1 forward pass (no denoising steps, no CFG, no negative prompt), Qwen3.5-4B backbone q4 (DiffusionBear default), weights `Ouinche/Jeveration-MLX@dc00cbaa` + `Qwen/Qwen3.5-4B@851bf6e8`. Machine: Apple M4 Pro (Virtual), 16 GB unified memory, macOS VM. Times are single runs, not benchmark medians. The time is the generation only; DiffusionBear reloads the model for every image (shown as "+ load"). Peak = the engine process's max memory footprint, reached while loading.
| # | Prompt | Seed | Time (M4 Pro VM, 16 GB) | Peak | |---|---|---|---|---| | 01 | Studio product photo of matte black wireless headphones on a pastel pink pedestal, soft shadows, clean minimal background, commercial photography | 42 | 14.5 s (+42.5 s load) | 15.9 GB | | 02 | A turquoise alpine lake surrounded by snowy mountains at sunrise, golden light, wide landscape photograph | 42 | 7.8 s (+34.0 s load) | 15.9 GB | | 03 | Portrait of a smiling young woman with curly hair in warm window light, shallow depth of field, 85mm photo | 42 | 7.0 s (+26.9 s load) | 15.9 GB | | 04 | Overhead food photo of a colorful poke bowl with salmon, avocado, edamame and sesame seeds on a wooden table | 42 | 7.3 s (+27.3 s load) | 15.9 GB | | 05 | Retro travel poster illustration of a lighthouse on a cliff at sunset, bold flat colors, vintage style | 42 | 8.9 s (+40.0 s load) | 15.9 GB | | 06 | A red fox sitting in a snowy forest, soft morning light, wildlife photography | 42 | 10.1 s (+28.6 s load) | 15.9 GB | | 07 | Cozy Scandinavian living room with a beige sofa, green plants and large windows, bright natural light, interior design photo | 42 | 9.1 s (+36.4 s load) | 15.9 GB | | 08 | A cute cartoon brown bear mascot waving, round friendly face, simple vector illustration on a white background | 42 | 14.0 s (+30.9 s load) | 15.9 GB | Generation took 7.0–14.5 s (median 9.0 s), plus 27–42 s to load the model. Memory peaked at about 15.9 GB, and system swap reached up to 4.3 GB on this 16 GB VM. Experimental engine. _DiffusionBear v0.5.3 examples._ ## Verification (2026-11-30, M1 16 GB) - Backbone+head parity vs the PyTorch reference (same random state): cos(hidden)=0.996, cos(logits)=0.9994. - Decoder parity vs PyTorch with identical codes: cosine 0.9991, MAE 0.011 on [0,1]. - End-to-end bf16: identical scene to the reference; q4: same quality, 10.7 s/image. ## Licenses - **Jeveration** (this adapter/head/decoder set): Apache-2.0 — © the Jeveration authors. - **Qwen3.5-4B** backbone: Apache-2.0 — Qwen team. - **TA-TiTok** (codebook + decoder architecture): see the upstream repo `turkeyju/tokenizer_tatitok_bl128_vq` (Apache-2.0). - **CLIP ViT-L/14-336** (OpenAI weights): MIT. Port: Mistral Vibe, for DiffusionBear. Original authors: Carol-lyh et al.