VisualInference commited on
Commit
adf9175
Β·
verified Β·
1 Parent(s): 4dd94ee

Model card: hero comparison, quickstart, results table, how it works, limitations

Browse files
.gitattributes CHANGED
@@ -34,3 +34,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  assets/turbo_vs_full.jpg filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  assets/turbo_vs_full.jpg filter=lfs diff=lfs merge=lfs -text
37
+ assets/hero_pebbles.jpg filter=lfs diff=lfs merge=lfs -text
38
+ assets/same_seed.jpg filter=lfs diff=lfs merge=lfs -text
39
+ assets/lichen.jpg filter=lfs diff=lfs merge=lfs -text
40
+ assets/schedule.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -19,61 +19,77 @@ tags:
19
 
20
  # MOSS-Image-SFT Turbo for Apple Silicon (MLX)
21
 
22
- A few-step sampler for [OpenMOSS-Team/MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT) on Macs: **15 network passes instead of 100**, about **2 minutes** per ~1 MP image on an M4 Pro instead of about 12Β½. It stays close to what the full model draws for the same seed, including its textures and lettering. Runs with [moss-image-mlx](https://github.com/felix-ab/moss-image-mlx) `--turbo`.
23
 
24
- This repository holds the trained student: a rank-64 LoRA on the SFT transformer (252 projections, fp32, 595 MB).
25
 
26
- ![The original model at 50 steps (top) and --turbo (bottom), same prompts and seeds](assets/turbo_vs_full.jpg)
27
 
28
- *Held-out prompts never used in training, seed 101. Most compositions stay close to the full model's; some drift (middle).*
 
 
29
 
30
  ## Quickstart
31
 
32
  ```bash
33
- pip install moss-image-mlx
34
  moss-mlx "A highway LED sign at sunset that reads \"HELLO MLX\"" --turbo -o sign.png
35
  ```
36
 
37
- The first run downloads an 8-bit MOSS-Image tier, this student and the destripe adapter, and caches them.
 
 
 
 
38
 
39
- ## How it works
 
 
40
 
41
- 1. **Student, 6 steps, no CFG.** It covers the first half of the original model's own 50-step trajectory (Οƒ 1 β†’ .671). It was trained by regression onto that trajectory, with no distribution matching:
42
- - teacher data from about 2,000 prompts at ~1 MP in 9 aspect ratios (English and Chinese text, JSON layouts, people, products, places, materials);
43
- - targets relabelled from the teacher's own continuation of the student's states.
44
- 2. **One guided original-model step** replaces the student's second step (Οƒ .957 β†’ .919). That is where lettering is decided.
45
- 3. **The original model finishes** with 4 DPM-Solver++(2M) evaluations (Οƒ .671 β†’ 0).
46
- 4. **Destripe throughout:** [nynxz's destripe LoRA](https://huggingface.co/nynxz/MOSS-Image) at 1.5. The teacher data was destriped too.
 
 
 
 
47
 
48
- Passes: 5 student + 2 guided + 8 finish = 15.
49
 
50
- ## Evaluation
 
 
 
 
51
 
52
- The comparison is against the destriped 50-step model (CFG 3, layer-22 skip) on 32 held-out prompts, seed 101:
53
 
54
- | | This turbo | Earlier distilled turbo (DMD adapter) |
55
- |---|---|---|
56
- | Repeated "stamped" texture (DINOv2 recurrence, excess over the full model) | **βˆ’0.006** (none) | +0.063 |
57
- | Fine detail (high-frequency energy vs the full model) | βˆ’0.004 | βˆ’0.022 |
58
- | Mean pixel difference from the full model | **0.090** | 0.124 |
59
- | Brightness difference | +0.011 | βˆ’0.049 (darker) |
60
- | English text (OCR character recall; full model 0.934) | 0.947 | 0.951 |
61
 
62
- Speed and memory, M4 Pro, 8bit tier, ~1 MP: 117 s sampling + 2 s decode; peak memory 9.4 GB (a short prompt; the full model peaks at 9.3 GB).
63
 
64
- Design rationale, per-decision evidence and open questions: [technical write-up](https://github.com/felix-ab/moss-image-turbo-research/blob/main/docs/technical-writeup.md). How each number is computed: [the metrics write-up](https://github.com/felix-ab/moss-image-turbo-research/blob/main/docs/how-the-numbers-work.md). The full study is at [felix-ab/moss-image-turbo-research](https://github.com/felix-ab/moss-image-turbo-research): where earlier turbos' stamped textures came from, the training design, and every decision.
65
 
66
  ## Limitations
67
 
68
- - **Small, dense text** slips more often than with the full model.
69
  - **Regular geometry** can come out more organic than it should: a chain-link fence shadow, rows of machines.
70
  - **Compositions** usually follow the full model for the same seed, but not always.
71
- - **Resolution:** trained for ~1 MP in 9 aspect ratios; other sizes are untested.
72
- - **Checkpoint:** SFT only.
73
 
74
  ## License and credits
75
 
76
  Apache-2.0.
77
  - **Base model:** MOSS-Image SFT, Β© OpenMOSS, Apache-2.0.
78
  - **Destripe adapter:** by nynxz, Apache-2.0.
 
79
  - **This work** is independent and not affiliated with OpenMOSS.
 
19
 
20
  # MOSS-Image-SFT Turbo for Apple Silicon (MLX)
21
 
22
+ A few-step sampler for [OpenMOSS-Team/MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT) on Macs: **15 network passes instead of 100**. That is about **2 minutes** per ~1 MP image on an M4 Pro, instead of about 12Β½ (**6.2Γ—**). It stays close to what the full 50-step model draws for the same seed, including its textures and lettering, and it does not "stamp" repeated texture the way DMD turbo adapters do.
23
 
24
+ **Code:** [moss-image-mlx](https://github.com/felix-ab/moss-image-mlx) (`--turbo`) Β· **Write-up:** [how it was designed and measured](https://github.com/felix-ab/moss-image-turbo-research/blob/main/docs/technical-writeup.md) Β· **Base tiers:** [8bit](https://huggingface.co/VisualInference/MOSS-Image-SFT-MLX-8bit), [compact](https://huggingface.co/VisualInference/MOSS-Image-SFT-MLX-compact)
25
 
26
+ ![Wet river pebbles, same seed: full model at 50 steps, the new turbo, and a DMD-adapter turbo, with 100% crops](assets/hero_pebbles.jpg)
27
 
28
+ *A held-out prompt never used in training, seed 101, 8bit tier, 100% crops below. The turbo keeps the full model's pebbles. A DMD-adapter turbo (a community adapter plus 2 original-model steps) turns them into uniform glossy beads.*
29
+
30
+ This repository holds only the trained student: a rank-64 LoRA on the SFT transformer (252 projections, fp32, 595 MB). The package downloads it automatically.
31
 
32
  ## Quickstart
33
 
34
  ```bash
35
+ pip install -U moss-image-mlx # 0.2.0 or newer
36
  moss-mlx "A highway LED sign at sunset that reads \"HELLO MLX\"" --turbo -o sign.png
37
  ```
38
 
39
+ - **First run:** it downloads the 8-bit MOSS-Image tier, this student (pinned to a fixed revision) and the destripe adapter, then caches them.
40
+ - **Sizes:** trained at ~1 MP in 9 aspect ratios, from 768Γ—1360 through 1024Γ—1024 to 1360Γ—768. Set them with `--width` and `--height`.
41
+ - **More images:** `--seeds 1,2,3` renders several seeds with one load; `--batch jobs.jsonl` renders many prompts.
42
+ - **Ignored in turbo mode:** `--steps` and `--shift`. `--turbo-weights FILE` uses a local copy of the student.
43
+ - **Requirements:** an Apple Silicon Mac. It was measured on the 8bit tier, the default on Macs with β‰₯ 24 GB.
44
 
45
+ ## Results
46
+
47
+ The comparison is against the destriped official sampler (50 steps, CFG 3, block-22 skip) on **32 held-out prompts**, each at its own aspect ratio, seed 101:
48
 
49
+ | | **This turbo** | DMD-adapter turbo | Full model, 50 steps |
50
+ |---|---|---|---|
51
+ | Network passes | **15** | 10 | 100 |
52
+ | Time per ~1 MP image (M4 Pro, 8bit) | **~119 s** | ~80 s | ~743 s |
53
+ | Peak memory | 9.4 GB | 9.3 GB | 9.3 GB |
54
+ | Stamped texture (DINOv2 repetition, excess over the full model; materials + nature, n = 8) | **βˆ’0.006** | +0.063 | 0 |
55
+ | Fine detail (high-frequency energy vs the full model) | **βˆ’0.004** | βˆ’0.022 | 0 |
56
+ | Mean \|luma difference\| from the full model's image | **0.090** | 0.124 | 0 |
57
+ | Brightness difference | +0.011 | βˆ’0.049 | 0 |
58
+ | English text, OCR character recall (n = 4) | 0.947 | 0.951 | 0.934 |
59
 
60
+ The package's sampler reproduces the research images bit for bit. The metrics are defined in [how-the-numbers-work.md](https://github.com/felix-ab/moss-image-turbo-research/blob/main/docs/how-the-numbers-work.md).
61
 
62
+ ![Four held-out prompts, full model at 50 steps beside the turbo with the same seed: a croissant, a novel cover, a fox in snow and a Chinese tea wrapper](assets/same_seed.jpg)
63
+
64
+ ![Lichen on a stone wall, same seed: full model, turbo and a DMD-adapter turbo with 100% crops; the DMD turbo stamps identical rosettes](assets/lichen.jpg)
65
+
66
+ ## How it works
67
 
68
+ ![The official sampler's 100 passes vs the turbo's 15: 5 student passes, a 2-pass guided step at slot 2, and an 8-pass original-model finish](assets/schedule.png)
69
 
70
+ 1. **Student, 6 steps, no CFG.** It covers the composition part of the original model's own 50-step trajectory (Οƒ 1 β†’ .671).
71
+ - **Training:** regression onto that trajectory, with no distribution matching. Teacher data comes from about 2,000 prompts at ~1 MP in 9 aspect ratios (English and Chinese text, JSON layouts, people, products, places, materials).
72
+ - **Targets:** on the student's own drifted states, the teacher is re-run from where the student actually is. In a controlled ablation, targets that snap back to the stored path ghosted a face and garbled Chinese characters; these targets did neither.
73
+ 2. **One guided original-model step** replaces the student's third step (slot 2, Οƒ .957 β†’ .919). The step was tried in each of the 6 slots. Only there did it repair both a ghosted shop-sign headline and an infographic title (7 prompts, one seed; confirmed on the held-out set).
74
+ 3. **The original model finishes** with 4 DPM-Solver++(2M) evaluations (Οƒ .671 β†’ 0). From an exact mid-trajectory state, this finish is 4.6Γ— closer to the 50-step image than a distilled finish.
75
+ 4. **Destripe throughout:** [nynxz's destripe LoRA](https://huggingface.co/nynxz/MOSS-Image) runs at 1.5. The teacher data was destriped too.
 
76
 
77
+ Passes: 5 student + 2 guided + 8 finish = 15. The student was trained on rented A100s for about $37.
78
 
79
+ **Why not distill the whole trajectory?** Exact cached 50-step states, finished by a DMD adapter, still stamp. The more distilled steps run in the middle of the trajectory, the more stamping appears. So the distilled network stays out of the band where texture is organized. The [technical write-up](https://github.com/felix-ab/moss-image-turbo-research/blob/main/docs/technical-writeup.md) has the evidence for each decision and what failed. The [research repo](https://github.com/felix-ab/moss-image-turbo-research) has the full lab notebook.
80
 
81
  ## Limitations
82
 
83
+ - **Small, dense text** slips more often than with the full model (OCR 0.957 vs 0.970 on 8 prompts).
84
  - **Regular geometry** can come out more organic than it should: a chain-link fence shadow, rows of machines.
85
  - **Compositions** usually follow the full model for the same seed, but not always.
86
+ - **Untested:** sizes outside ~1 MP and the 9 trained aspect ratios; the compact and bf16 tiers with `--turbo`; the Base checkpoint (the CLI refuses `--transformer` in turbo mode).
87
+ - **Evidence size:** 1–2 seeds and 7–32 prompts per comparison, with visual checks by the author and the project owner. There is no FID or KID at scale.
88
 
89
  ## License and credits
90
 
91
  Apache-2.0.
92
  - **Base model:** MOSS-Image SFT, Β© OpenMOSS, Apache-2.0.
93
  - **Destripe adapter:** by nynxz, Apache-2.0.
94
+ - **DMD adapter in the comparisons:** by lodestones; used only as a baseline, not shipped here.
95
  - **This work** is independent and not affiliated with OpenMOSS.
assets/hero_pebbles.jpg ADDED

Git LFS Details

  • SHA256: 0e4f9880f6392825b207216660b9fd0a91b68262fc762707d3459d19cfafe1af
  • Pointer size: 131 Bytes
  • Size of remote file: 815 kB
assets/lichen.jpg ADDED

Git LFS Details

  • SHA256: b6710ad18ce6e4b0c922c06835375065cb6a2b36ecaec7b0fade613656485e58
  • Pointer size: 131 Bytes
  • Size of remote file: 765 kB
assets/same_seed.jpg ADDED

Git LFS Details

  • SHA256: 1a52bf07436d46a865260318942ebc123a78eecf6d2a05ccae64d1c86ab8a6f2
  • Pointer size: 131 Bytes
  • Size of remote file: 941 kB
assets/schedule.png ADDED

Git LFS Details

  • SHA256: d14174623dcc86b42c44ed1c8822a97253300a97d3eac77a1f90f940e2cbf182
  • Pointer size: 131 Bytes
  • Size of remote file: 111 kB