Built with ML Intern

MOSS-Image-SFT-4-steps

⚑ Demo: MOSS-Image 4-Step Turbo Space

πŸ†• v2.0 (2026-10-18) β€” major update, usage changed. The model is now Euler-native: a single lora.safetensors that runs on the stock flow-matching Euler sampler (any LoRA loader, 4 steps, CFG 1) β€” the custom data-space sampler and the time_embedding.safetensors / dataspace.safetensors files are no longer needed and were removed from the repo root. If you used v1.x adapters, grab the old data-space variant from checkpoint-update-400/ (it keeps its own sampler), or switch to the new one-line loader below. New users: just follow the Quickstart.

The fastest high-fidelity MOSS-Image-SFT: 4 steps, no CFG, one LoRA file, stock sampler. No custom loop, no auxiliary safetensors, no pipeline patches β€” it drops into any standard LoRA loader.

4-step generations: bilingual cafe menu and neon Shanghai street, text intact

Both images above were generated by this model in 4 steps, no CFG β€” "TODAY'S SPECIAL / Flat White $4.50" and ζ·±ε€œι£Ÿε ‚ render correctly.

License: Apache-2.0 β€” commercial use OK.

Why this one

Claim Evidence
Only 4-step MOSS-Image that runs in stock LoRA loaders β€” ComfyUI LoraLoaderModelOnly, diffusers load_lora_weights, release flow-Euler scheduler, CFG 1 v3 is trained natively on the release schedule (anchors t = 1000/910/717/24), not adapted to it
Best text/numeric fidelity of any few-step MOSS-Image 4-way head-to-head, same prompts + seeds: this model is the only one that renders "62% / 38%" correctly β€” darask0's rapid-moss and lodestones' lora_latest both garble secondary numbers (see strips below)
Bilingual text rendering (δΈ­ζ–‡ + English) Signage-lexicon trained v1.1+: "OPEN 24H", menus, infographics, Chinese storefronts
No tiling at 2048Β² Verified 1024Β² / 1536Γ—1024 / 2048Β² (tiling_probe/)
Fully packaged All-in-one repo (pipeline + text encoder + VAE), inference.py CLI, live ZeroGPU demo, training code included

~11 s per 1024Γ—1024 image on one A100 (4 forwards, bf16 base + fp32 LoRA), no CFG, no negative prompt. Distilled via data-space DMD (arXiv 2610.12102), warm-started from lodestones/MOSS-Image-SFT-8-steps-dmd.

Quickstart

diffusers (base bf16 transformer + this LoRA, release sampler, 4 steps, CFG 1):

import torch
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(
    "akhaliq/MOSS-Image-SFT-4-steps",          # all-in-one: also loads from base repo
    custom_pipeline="pipeline_moss_image", trust_remote_code=True,
    torch_dtype={"default": torch.bfloat16, "vae": torch.float32},
)
pipe.load_lora_weights("akhaliq/MOSS-Image-SFT-4-steps", weight_name="lora.safetensors")
pipe.to("cuda")
image = pipe("A neon sign reading 'ζ·±ε€œι£Ÿε ‚' over a rainy door",
             num_inference_steps=4, guidance_scale=1.0,
             generator=torch.Generator("cpu").manual_seed(1234)).images[0]

Precision: keep the LoRA unmerged in fp32 β€” the distillation delta is smaller than bf16's rounding step. load_lora_weights with fp32 adapter weights on the bf16 base is the evaluated configuration; merging into bf16 degrades fine text first. For maximum quality use the merged fp32 transformer/ instead.

ComfyUI: LoraLoaderModelOnly β†’ lora.safetensors (strength 1.0) on the stock MOSS-Image-SFT diffusion model; sampler euler, scheduler simple (flow-matching, shift 5), 4 steps, CFG 1.0. Done β€” nothing else to load.

Single-file CLI: python inference.py --prompt "..." --steps 4 --out out.png

Files

  • lora.safetensors β€” the model. fp32 LoRA, rank 128 / alpha 128 on every block's proj.{q,k,v,o,ffn_up_gate,ffn_down} (kohya keys). Euler-native.
  • transformer/ β€” merged fp32 transformer (LoRA baked in), for max quality with the release pipeline.
  • euler-update-{100..600}/ β€” v3 (Euler) training checkpoints, u600 = published.
  • checkpoint-update-{250,500,750,1000}/ β€” v1.x data-space checkpoints (archived; those need the data-space sampler and their bundled time_embedding/dataspace files β€” see checkpoint-update-400/).
  • inference.py, train_dmd.py β€” inference CLI and the full training script.
  • Text encoder, tokenizer, VAE, scheduler, pipeline_moss_image.py β€” bundled from the base repo so this repo loads standalone.

Head-to-head

The 4-step race β€” animated, same prompt + seed, live timers (lodestones lora_latest 8-step | this model 4-step | rapid-moss 4-step):

The 4-step race: fastest and the only clean numbers

This model finishes first (5.6 s vs 11.2 s) and is the only panel with all numbers correct β€” rapid-moss slips to "48%", lora_latest invents "AUUTERT". Full frames and the Shanghai-street race: launch/.

🎬 Launch video with voiceover (25 s): showcase/launch_video.mp4

Static strips, 4-way, same prompts + seeds (left β†’ right: this model (Euler, 4 steps) | v1.1 data-space 4-step | darask0 rapid-moss 4-step | lodestones lora_latest Euler 8-step):

Infographic: only this model and its v1.1 sibling get all numbers right

Shanghai neon street: all four correct on headline text; richness varies

JSON layout poster: all four render the layout

Scorecard: this model ties the best on headline text and menus, wins numeric fidelity outright (the infographic β€” both competitors garble secondary numbers), and is the only one that needs no custom sampler. darask0's rapid-moss still produces the liveliest street-scene compositions. All 8 strips: v3_final/.

Training

Method data-space DMD (arXiv 2610.12102) v1.x; Euler-native DMD v3
Teacher frozen MOSS-Image-SFT (bf16), CFG 3.0, negative branch skip-layer 22
Fake score base transformer (bf16) + fresh rank-128 LoRA, 1:1 update ratio
v1.0 1,000 updates from lodestones update-2600 warm start (data-space)
v1.1 +400 updates, signage-lexicon + 3,000 real user prompts (fixed small-English-text class)
v3 600 updates, Euler-native, warm-started from lora_latest; anchors t = 1000/910/717/24
Optimizer Adam β₁=0, grad clip 1.0, EMA 0.999
Cost ~$14 + ~$6 + ~$9 on 1Γ— A100-80GB

Citation

@misc{mossimagesft4steps2026,
  title = {MOSS-Image-SFT-4-steps: 4-step DMD distillation of MOSS-Image-SFT},
  author = {akhaliq},
  year = {2026},
  howpublished = {\url{https://huggingface.co/akhaliq/MOSS-Image-SFT-4-steps}}
}

Builds on MOSS-Image (Apache 2.0), lodestones' 8-step DMD, and Few-Step Generation via Data-Space Iteration.

Downloads last month
669
Safetensors
Model size
5B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for akhaliq/MOSS-Image-SFT-4-steps

Adapter
(13)
this model

Space using akhaliq/MOSS-Image-SFT-4-steps 1

Paper for akhaliq/MOSS-Image-SFT-4-steps