Instructions to use VisualInference/MOSS-Image-SFT-Turbo-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use VisualInference/MOSS-Image-SFT-Turbo-MLX with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download VisualInference/MOSS-Image-SFT-Turbo-MLX --local-dir MOSS-Image-SFT-Turbo-MLX
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Model card: hero comparison, quickstart, results table, how it works, limitations
Browse files- .gitattributes +4 -0
- README.md +44 -28
- assets/hero_pebbles.jpg +3 -0
- assets/lichen.jpg +3 -0
- assets/same_seed.jpg +3 -0
- assets/schedule.png +3 -0
.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**
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
 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 |
+

|
| 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 |
+

|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
|
| 66 |
+
## How it works
|
| 67 |
|
| 68 |
+

|
| 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
|
assets/lichen.jpg
ADDED
|
Git LFS Details
|
assets/same_seed.jpg
ADDED
|
Git LFS Details
|
assets/schedule.png
ADDED
|
Git LFS Details
|