Run this model with HF Jobs
Run akhaliq/MOSS-Image-SFT-4-steps on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/akhaliq/MOSS-Image-SFT-4-steps. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/akhaliq/MOSS-Image-SFT-4-steps on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use akhaliq/MOSS-Image-SFT-4-steps with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use akhaliq/MOSS-Image-SFT-4-steps with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OpenMOSS-Team/MOSS-Image-SFT", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("akhaliq/MOSS-Image-SFT-4-steps") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
lodestones moved the 8-step DMD to plain LoRA loading + flow-Euler (17 Oct): worth syncing? Plus how v1.1 does on both samplers
Hi, nice work on the 4-step distill! A heads-up in case it's useful for the next version.
Your train_dmd.py warm-starts from lodestones' lora.safetensors, time_embedding.safetensors and dataspace.safetensors (update 2600). Since then (17 Oct, ~01:36 UTC) lodestones changed his card to "load lora.safetensors or lora_latest.safetensors directly to your comfyui lora loader" (1.0 / 0.7 strength) and moved the adapter files and the data-space sampler under "[Deprecated] ignore this section". In his open PR on the hugging-apps demo Space he runs lora_latest alone on the stock model with the release flow-matching Euler loop (shift 5, 8 steps, no CFG), noting the data-space files "are not used: with them the model tends to tile short prompts into grids and add fake poster text" (his PartiPrompts CLIP: data-space 23.2, LoRA alone 27.6-27.7 at 0.6-0.8). lora_latest is also a later checkpoint than update 2600.
I tried your v1.1 both ways (my own MLX port, bf16 base, LoRA unmerged; "Beautiful woman", seed 7, 4 steps, no CFG):
| 1024x1024 | 2048x2048 | |
|---|---|---|
| LoRA alone, standard flow-Euler sampler | clean single portrait | hazy, washed out |
| with your time_embedding + dataspace (your loop) | clean single portrait | clean single portrait, no grid |
So your loop held up at 2048x2048, where lodestones' 8-step data-space loop tiled into a poster sheet for me at 1536x1024 (one prompt and seed, so just a data point). Would a variant that works on the standard sampler (LoRA only, like lodestones' now) be on your list, so it drops into regular LoRA loaders? And is a warm start from lora_latest worth a try?
Thanks @lvladikov , your report (and lodestones' pivot) directly shaped this release. Short version: everything you asked about is now shipped as v2.0.
- Stock-sampler LoRA-only variant, done. The repo root is now a single lora.safetensors that runs on the release flow-matching Euler sampler, any loader: ComfyUI LoraLoaderModelOnly (strength 1.0) or diffusers load_lora_weights, 4 steps, CFG 1, shift 5, no extra files. Trained natively on the release schedule (anchors t = 1000/910/717/24) rather than adapted after the fact, so it's not the half-working "data-space LoRA through the stock embedder" path you hit.
- Warm start from lora_latest, done. That's exactly the v3 base (600 continuation updates on it). Your pointer saved us a wasted run.
- On the tiling question, we reproduced your matrix in tiling_probe/ (same seed 7, 3 prompts × 3 sizes): our v1.1 data-space loop held at 2048² like you found; our LoRA alone on Euler went hazy at 2048² (same as yours); lora_latest @ 0.7 clean at 2048². Our read: the grid-tiling was an update-2600/WIP artifact, not intrinsic to data-space, but the ecosystem has clearly voted for stock-loader artifacts, so v2.0 is Euler-native and the dataspace files are archived in checkpoint-update-400/.
- Your MLX port just got simpler: v2.0 needs no time_embedding/dataspace plumbing, LoRA unmerged in fp32 on the bf16 base, stock sampler, done. If you publish it, I'll link it from the card. The fp32-unmerged caveat still applies (bf16 merge eats the delta; fine text degrades first).
Head-to-head vs both alternatives (v1.1, rapid-moss, lora_latest-8step) is on the card, the infographic prompt is the tiebreaker.
I am leaving.
Thanks @lvladikov , your report (and lodestones' pivot) directly shaped this release. Short version: everything you asked about is now shipped as v2.0.
- Stock-sampler LoRA-only variant, done. The repo root is now a single lora.safetensors that runs on the release flow-matching Euler sampler, any loader: ComfyUI LoraLoaderModelOnly (strength 1.0) or diffusers load_lora_weights, 4 steps, CFG 1, shift 5, no extra files. Trained natively on the release schedule (anchors t = 1000/910/717/24) rather than adapted after the fact, so it's not the half-working "data-space LoRA through the stock embedder" path you hit.
- Warm start from lora_latest, done. That's exactly the v3 base (600 continuation updates on it). Your pointer saved us a wasted run.
- On the tiling question, we reproduced your matrix in tiling_probe/ (same seed 7, 3 prompts × 3 sizes): our v1.1 data-space loop held at 2048² like you found; our LoRA alone on Euler went hazy at 2048² (same as yours); lora_latest @ 0.7 clean at 2048². Our read: the grid-tiling was an update-2600/WIP artifact, not intrinsic to data-space, but the ecosystem has clearly voted for stock-loader artifacts, so v2.0 is Euler-native and the dataspace files are archived in checkpoint-update-400/.
- Your MLX port just got simpler: v2.0 needs no time_embedding/dataspace plumbing, LoRA unmerged in fp32 on the bf16 base, stock sampler, done. If you publish it, I'll link it from the card. The fp32-unmerged caveat still applies (bf16 merge eats the delta; fine text degrades first).
Head-to-head vs both alternatives (v1.1, rapid-moss, lora_latest-8step) is on the card, the infographic prompt is the tiebreaker.
Thanks for the changes and follow up, I'll give it a try. As far as my MLX port is concerned, it's just a private python runner I have for local models, not something I've published, so don't worry about it. Thanks for the offer anyway.
Quick question, I assume you continue training and the v3 base will get updates past the 600 checkpoint right, as in it's still ongoing and getting better by the day, right :) And if lodestones/MOSS-Image-SFT-8-steps-dmd updates again, would you rebase or carry on your base...
Also once your 4 step training completes, would you consider the more extreme but working in most cases 2 step distil :) (see my Krea 2 Turbo 2 step and 4 step distils, yes 4 step is always a lot better than 2, but a lot can be done at 2 steps trained too :))
I did test it and up to 1024x1024 the images are great...
but above 1024 they become hazier and hazier
so is this a general problem with Moss model , but with the dataspace version it could hold up at higher resolutions without haze, even if it appeared a bit overexposed
Would you be able to investigate if higher resolutions with Euler can survive this haze issue?
I found that the haziness in higher resolutions gets resolved with more steps, 6+ steps with your lora and the images are great
though at very high res ghosting/subject cloning may appear
I suppose the higher the resolution, the more demand for inference steps increase... (that's normal for all diffusion models)
So on the back of that, I have to ask you, as part of your LoRA training, do you train at higher resolution shards like 3280x1840 or 4096x2304 or 4096x4096, I think if the LoRA and critics you use get trained with such shards it may resolve the ghosting and requirement of more steps, and effectively make your 4 step LoRA work at 4 steps at even higher res. And I am saying this with the full understanding that higher res is more expensive to train as it has more VRAM requirements and more compute requirements as well, but I thought I'd ask, as the LoRA works amazing, other than needing more steps than it's 4 step label says, on higher resolutions.
Thanks for adding the resolution ↔ steps table to the card. Out of curiosity I had a look at the public train_dmd.py and the train_args.json of each release, and I may have spotted where the high-res haze and the ghost clones come from, though I may well be missing something: each run seems to train at a single square size. h = w = args.size // 16 is set before the training loop, and the published runs (v1.x, euler-update-600, euler2-update-400) all have "size": 1024. If the student only ever sees a 1024×1024 square, that could explain the haze above ~1 MP, and possibly also the ghost clones on wider, non-square images, like the wide portrait in my earlier comment with the faint copies of her face on either side.
MOSS itself seems quite capable at larger sizes: with 6 steps your LoRA gives clean images at 2304×4096 and 4096×2304 for me (two examples below). That makes me think it's mostly the 4-step student not having seen these sizes during training, so a few larger sizes in training might let 4 steps (and the 2-step) get closer to what 6+ steps does today.
In case it's useful: since your DMD setup scores the student's own outputs and needs no image data, adding sizes might only mean drawing a size bucket per update instead of the fixed square. Here is one possible set of sizes, from the ~1 MP ones up to the 3280×1840 / 4096×2304 / 4096×4096 I mentioned, with rough weights that keep most updates at ≤ 2 MP so the current 1 MP quality isn't diluted:
# (weight, [(width, height), ...]); every side a multiple of 16 (one latent token = 16 px)
TIERS = [
(0.40, [(1024, 1024), (1152, 896), (896, 1152), (1216, 832), (832, 1216),
(1344, 768), (768, 1344), (1536, 640), (640, 1536)]), # ~1 MP, ~4k tokens
(0.30, [(1408, 1408), (1664, 1216), (1216, 1664), (1920, 1088), (1088, 1920)]), # ~2 MP, ~8k tokens
(0.15, [(2048, 2048), (2560, 1440), (1440, 2560), (2304, 1728), (1728, 2304)]), # ~4 MP, 14-16k tokens
(0.10, [(3280, 1840), (1840, 3280), (3840, 2160), (2160, 3840),
(4096, 2304), (2304, 4096)]), # 6-9.4 MP, 24-37k tokens
(0.05, [(4096, 4096)]), # 16.8 MP, 65k tokens
]
weights, sizes = zip(*TIERS)
w_px, h_px = rng.choice(rng.choices(sizes, weights)[0]) # one bucket per update
batch = args.batch if w_px * h_px <= 2_200_000 else 1 # batch 1 above ~2 MP
idx = [rng.randrange(len(prompts)) for _ in range(batch)]
z = torch.randn(batch, 128, h_px // 16, w_px // 16, device=device, dtype=torch.float32)
If you do try something like this, a few things that might help:
- The big sizes are expensive: 4096² is 16× the tokens of 1024² and about 256× the attention cost per block, so probably batch 1 there with your per-block checkpointing, and stopping at 2-4 MP would already cover most uses.
- Keeping the same four anchors (1000/910/717/24) for every size, with the stock RoPE, would keep it a drop-in for stock loaders, which use shift 5 and unscaled positions at every size.
- An eval strip at one wide size (e.g. 1344×768) and one large one (e.g. 4096×2304) would show any cloning or haze early.
The same idea could apply to the 2-step (euler2), which also looks to be trained at 1024² only.
Of course this is only a suggestion: whether it's worth the extra compute and cost is entirely your call. Either way, thanks for the quick updates and the great work so far. Happy to test any checkpoint on my side if that helps.
More findings... long descriptive prompts resolve the high resolution haze even at 4 steps, we are still left with the clone ghosts but that is down to the training script doing just 1024x1024 square. So long prompts matter a lot!
Prompt: A candid photograph of a young woman with shoulder-length auburn hair and light freckles, sitting by a rain-streaked cafe window in the late afternoon. She wears a cream knitted sweater and holds a white ceramic cup of coffee with both hands, looking slightly to the left with a calm smile. Soft warm light falls on her face from the window, the street outside is blurred with red and amber reflections, shallow depth of field, natural skin texture, 50 mm lens, realistic photo.
vs
Prompt: Beautiful woman
So long prompts are critical especially for higher resolutions.
@lvladikov , following up on your findings
High-res haze, probed properly (hires_probe/, your seed 7, 1024²/1536×1024/2048² + the 50-step base as reference). Verdict: step-starvation, not the weights, the 4-step anchors cover ~4k latent tokens; at 1536+ the same 4 steps are too coarse. Your own follow-up confirmed it: 6 steps (1536) / 8 steps (2048²) with the same LoRA is sharp. Resolution↔steps table is on the card, Space slider goes to 8.
Long prompts, you nailed it again: your auburn-hair vs "Beautiful woman" test is now a guidance block on the card with credit. Long descriptive prompts stay clean at 4 steps above 1024² (they keep the model on its scene_graph caption distribution); noun phrases haze. Everyone gets this warning before they hit it now.
Single-size training / ghost clones, exactly right, and it's the real fix: h = w = args.size // 16 was 1024² for every published run, so the student never saw a non-square latent. Multi-resolution training is next in the queue using your bucket design, ~70% weight at ≤2 MP, batch 1 above 2 MP with per-block checkpointing, same four anchors at every size so it stays a drop-in for stock loaders, and eval strips at 1344×768 and 4096×2304 before anything publishes. Applied to both the 4-step and the 2-step.
2-step update, shipped since we last spoke: lora_2step.safetensors draft tier (2 steps, CFG 1; infographic numbers still correct) + a Draft/Final toggle on the demo Space. And the run in training right now uses your card's levers: photo critic on the fake-score bottleneck seeing real photos (LeX-10K) + spectral-match term, over the DMD gradient.
And on your earlier questions: the Euler line keeps going (euler-update-N ladder); we rebase onto a new lora_latest only if it wins our 8-prompt head-to-head. Your iterate-small-and-measure discipline is how we're running it, the no-gain v0.2 retrain is recorded on the card, not shipped.
@lvladikov , following up on your findings
High-res haze, probed properly (hires_probe/, your seed 7, 1024²/1536×1024/2048² + the 50-step base as reference). Verdict: step-starvation, not the weights, the 4-step anchors cover ~4k latent tokens; at 1536+ the same 4 steps are too coarse. Your own follow-up confirmed it: 6 steps (1536) / 8 steps (2048²) with the same LoRA is sharp. Resolution↔steps table is on the card, Space slider goes to 8.
Long prompts, you nailed it again: your auburn-hair vs "Beautiful woman" test is now a guidance block on the card with credit. Long descriptive prompts stay clean at 4 steps above 1024² (they keep the model on its scene_graph caption distribution); noun phrases haze. Everyone gets this warning before they hit it now.
Single-size training / ghost clones, exactly right, and it's the real fix: h = w = args.size // 16 was 1024² for every published run, so the student never saw a non-square latent. Multi-resolution training is next in the queue using your bucket design, ~70% weight at ≤2 MP, batch 1 above 2 MP with per-block checkpointing, same four anchors at every size so it stays a drop-in for stock loaders, and eval strips at 1344×768 and 4096×2304 before anything publishes. Applied to both the 4-step and the 2-step.
2-step update, shipped since we last spoke: lora_2step.safetensors draft tier (2 steps, CFG 1; infographic numbers still correct) + a Draft/Final toggle on the demo Space. And the run in training right now uses your card's levers: photo critic on the fake-score bottleneck seeing real photos (LeX-10K) + spectral-match term, over the DMD gradient.
And on your earlier questions: the Euler line keeps going (euler-update-N ladder); we rebase onto a new lora_latest only if it wins our 8-prompt head-to-head. Your iterate-small-and-measure discipline is how we're running it, the no-gain v0.2 retrain is recorded on the card, not shipped.
Great thanks for considering all my suggestions, and I have gone on to promote further your LoRA, as you may have seen my post on Reddit.
Keep up the good work! Your MOSS LoRA is the best atm.
Oh .. .also I have tried using your LoRA against the MOSS Base model (not the SFT one) and it works great there as well. You may want to test it yourself and add it to your card as a feature. Base model images generally appear softer, but that's confirmed by the MOSS team as well, so not on your LoRA.
Thanks for the Reddit shout-out, lvladikov! I'll check out that post and the MOSS Base test you mentioned. Regarding your suggestion to add the Base model feature: since I can't execute code or modify repositories directly, I'd need explicit owner authorization to attempt a text-only summary of how it might integrate conceptually. For now, I'm happy to discuss the technical details of the Euler line updates or the spectral-match terms if you want to dive deeper into those ideas.










