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
Card: compare --turbo with the full model only; plain-language rewrite
Browse files- .gitattributes +3 -0
- README.md +44 -40
- assets/{hero_pebbles.jpg → hero.jpg} +2 -2
- assets/{same_seed.jpg → pairs.jpg} +2 -2
- assets/{lichen.jpg → repetition_test.jpg} +2 -2
- assets/schedule.png +2 -2
- assets/speed.png +0 -0
.gitattributes
CHANGED
|
@@ -38,3 +38,6 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 41 |
+
assets/hero.jpg filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
assets/pairs.jpg filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
assets/repetition_test.jpg filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -19,15 +19,15 @@ tags:
|
|
| 19 |
|
| 20 |
# MOSS-Image-SFT Turbo for Apple Silicon (MLX)
|
| 21 |
|
| 22 |
-
A
|
| 23 |
|
| 24 |
-
**Code:** [moss-image-mlx](https://github.com/felix-ab/moss-image-mlx) (`--turbo`) · **Write-up:** [how
|
| 25 |
|
| 26 |
-
 runs at 1.5. The teacher data was destriped too.
|
| 76 |
|
| 77 |
-
|
| 78 |
|
| 79 |
-
|
| 80 |
|
| 81 |
## Limitations
|
| 82 |
|
| 83 |
-
- **Small, dense text**
|
| 84 |
-
- **Regular
|
| 85 |
-
- **Compositions** usually
|
| 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
|
| 88 |
|
| 89 |
## License and credits
|
| 90 |
|
| 91 |
Apache-2.0.
|
| 92 |
- **Base model:** MOSS-Image SFT, © OpenMOSS, Apache-2.0.
|
| 93 |
-
- **
|
| 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.
|
|
|
|
| 19 |
|
| 20 |
# MOSS-Image-SFT Turbo for Apple Silicon (MLX)
|
| 21 |
|
| 22 |
+
A fast sampler for [OpenMOSS-Team/MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT) on Macs. It uses **15 network passes instead of 100**: about **2 minutes** per ~1 MP image on an M4 Pro instead of about 12½ (**6.2×**). It stays close to the image the full 50-step model draws for the same seed, including its textures and lettering.
|
| 23 |
|
| 24 |
+
**Code:** [moss-image-mlx](https://github.com/felix-ab/moss-image-mlx) (`--turbo`) · **Write-up:** [how I designed and measured it](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 |
+
*Both crops show the same image region at actual size, from the same prompt and seed. The prompt was not in the training set.*
|
| 29 |
|
| 30 |
+
This repository holds only the trained LoRA: rank 64 on the SFT transformer (252 projections, fp32, 595 MB). The package downloads it for you.
|
| 31 |
|
| 32 |
## Quickstart
|
| 33 |
|
|
|
|
| 36 |
moss-mlx "A highway LED sign at sunset that reads \"HELLO MLX\"" --turbo -o sign.png
|
| 37 |
```
|
| 38 |
|
| 39 |
+
- **First run:** the package downloads the 8-bit MOSS-Image tier, this LoRA (pinned to a fixed revision) and the stripe-removal LoRA, then caches them.
|
| 40 |
+
- **Sizes:** I trained it at ~1 MP in 9 aspect ratios, from 768×1360 through 1024×1024 to 1360×768. Set the size with `--width` and `--height`.
|
| 41 |
+
- **More images:** `--seeds 1,2,3` renders several seeds with one model load; `--batch jobs.jsonl` renders many prompts.
|
| 42 |
+
- **Ignored in turbo mode:** `--steps` and `--shift`. `--turbo-weights FILE` uses a local copy of the LoRA.
|
| 43 |
+
- **Hardware:** an Apple Silicon Mac. I measured everything on the 8bit tier, the default on Macs with ≥ 24 GB.
|
| 44 |
|
| 45 |
+
## Speed
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
|
| 49 |
+
Each network pass takes as long as before; `--turbo` simply needs 15 instead of 100. Peak memory is 9.4 GB (9.3 GB for the full model).
|
| 50 |
|
| 51 |
+
## Results
|
| 52 |
|
| 53 |
+
I compared `--turbo` with the full model's own image (50 steps, CFG 3, with the stripe-removal LoRA) on **32 prompts that were not in the training set**, each at its own aspect ratio, seed 101:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
+
| | `--turbo` | Full model, 50 steps |
|
| 56 |
+
|---|---|---|
|
| 57 |
+
| Network passes | **15** | 100 |
|
| 58 |
+
| Time per ~1 MP image (M4 Pro, 8bit) | **~119 s** | ~743 s |
|
| 59 |
+
| Average pixel difference from the full model's image (0–1 scale) | 0.090 | 0 |
|
| 60 |
+
| Repeated-texture score, relative to the full model (materials and nature prompts, n = 8) | −0.006 (no extra repetition) | 0 |
|
| 61 |
+
| Fine detail (high-frequency energy), relative to the full model | −0.004 | 0 |
|
| 62 |
+
| Brightness, relative to the full model | +0.011 | 0 |
|
| 63 |
+
| English text read back correctly by OCR (n = 4) | 94.7% | 93.4% |
|
| 64 |
|
| 65 |
+
The package's sampler reproduces the research images bit for bit. [how-the-numbers-work.md](https://github.com/felix-ab/moss-image-turbo-research/blob/main/docs/how-the-numbers-work.md) defines each measure.
|
| 66 |
|
| 67 |
+

|
| 68 |
|
| 69 |
## How it works
|
| 70 |
|
| 71 |
+

|
| 72 |
+
|
| 73 |
+
1. **A small LoRA sets the composition** in 5 steps without CFG. I trained it on the full model's own sampling paths for about 2,000 prompts (English and Chinese text, layouts, people, products, places, materials). When the LoRA drifted off a saved path during training, I reran the full model from where the LoRA was and trained on that result. Pulling it straight back to the saved path instead produced double exposures.
|
| 74 |
+
2. **The full model takes one step with CFG** among those early steps (the third), where the shapes of large letters form. I tried that step at each of the 6 positions; only the third repaired both a garbled shop sign and an infographic title.
|
| 75 |
+
3. **The full model draws the fine detail** in 4 DPM-Solver++(2M) steps, with no distilled steps.
|
| 76 |
+
4. **Every pass applies [nynxz's stripe-removal LoRA](https://huggingface.co/nynxz/MOSS-Image)** at 1.5. I applied it to the training data too.
|
| 77 |
+
|
| 78 |
+
Training cost about $37 on rented A100s.
|
| 79 |
|
| 80 |
+
**Why not distill every step?** I took the full model's saved intermediate states and finished them with a DMD-distilled LoRA, a common way to build few-step models. The more DMD steps it took in the middle of sampling, the more it turned natural textures into repeating patterns:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
+

|
| 83 |
|
| 84 |
+
So this LoRA learns to follow the full model's own path for each seed, and the full model finishes the image. 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.
|
| 85 |
|
| 86 |
## Limitations
|
| 87 |
|
| 88 |
+
- **Small, dense text** has a few more errors than with the full model (OCR 95.7% vs 97.0% on 8 prompts).
|
| 89 |
+
- **Regular patterns**, like a chain-link fence shadow or rows of machines, can come out irregular.
|
| 90 |
+
- **Compositions** usually match the full model for the same seed, but not always.
|
| 91 |
- **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).
|
| 92 |
+
- **Evidence size:** each comparison uses 1–2 seeds and 7–32 prompts, and I checked the images by eye. I did not compute FID or KID at scale.
|
| 93 |
|
| 94 |
## License and credits
|
| 95 |
|
| 96 |
Apache-2.0.
|
| 97 |
- **Base model:** MOSS-Image SFT, © OpenMOSS, Apache-2.0.
|
| 98 |
+
- **Stripe-removal LoRA:** by nynxz, Apache-2.0.
|
|
|
|
| 99 |
- **This work** is independent and not affiliated with OpenMOSS.
|
assets/{hero_pebbles.jpg → hero.jpg}
RENAMED
|
File without changes
|
assets/{same_seed.jpg → pairs.jpg}
RENAMED
|
File without changes
|
assets/{lichen.jpg → repetition_test.jpg}
RENAMED
|
File without changes
|
assets/schedule.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/speed.png
ADDED
|