4 steps at CFG 1 instead of 50 at CFG 3 · 4 model calls instead of 100 · about 14× less GPU time per picture · close to the teacher's tone, fine texture 1.22× the teacher's · 12 trained resolutions up to 1824×1024 and 1024×1824 · 15,000 training samples
A LoRA for MOSS-Image SFT that renders in 4 steps without CFG what the model renders in 50 steps at CFG 3 — MOSS's own sampler and schedule, one model call per step instead of two, trained by distribution matching against the 50-step teacher, with a critic that compares its pictures with the teacher's and with real photographs.
Current published checkpoint: chk00015000 — 15,000 training samples, produced 19 Nov 2026.
💡 In ComfyUI, use the
_comfyuifile at strength 1.0. ComfyUI adds a LoRA to the bf16 weights and rounds the sum, and a change as small as this LoRA's loses part of itself on the way: about a fifth, measured. The_comfyuifile carries the measured factor (1.18) in its alpha values, so ComfyUI's standard LoRA loader at 1.0 applies the trained change. diffusers and other exact loaders take the plain file at 1.0.
This LoRA at 4 steps, CFG 1, 1024×1024, rendered in ComfyUI on Comfy Cloud; each picture's prompt is in its caption. Click a picture to open it. Side by side with the teacher and akhaliq's 4-step: Compared with the teacher.
| file | what it is |
|---|---|
moss_sft_4step_rank_64_lora.safetensors |
the LoRA, exact — diffusers / Python at strength 1.0, see diffusers |
moss_sft_4step_rank_64_lora_comfyui.safetensors |
the same LoRA for ComfyUI's standard loader at strength 1.0 — see ComfyUI |
moss_sft_4step_lora_*_local.json, moss_sft_4step_lora_*_cloud.json |
eight ComfyUI workflows, core nodes only — see ComfyUI |
moss_sft_4step_rank_64_lora_checkpoint_info.md |
which checkpoint the files are, with their SHA-256s |
LICENSE |
the Apache License 2.0, the base model's licence |
NOTICE.txt |
the notice |
The two LoRA files hold the same tensors; the ComfyUI file's alpha values carry the measured factor (64 → 75.5). Both carry the training details in their safetensors metadata. The file names carry no checkpoint number: both hold chk00015000, which also sits in _archive/checkpoints/.
As on the official card: Python 3.10+, PyTorch 2.9+ with CUDA, then
pip install "diffusers>=0.38" "transformers>=5.3" "accelerate>=1.10" "safetensors>=0.6" "Pillow>=10"
import torch
import torch.nn.functional as F
from diffusers import DiffusionPipeline
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
def apply_4step_lora(transformer, strength=1.0):
"""Adds this LoRA beside the transformer's weights, unmerged: y = W x + scale * up(down(x)).
Call it after pipe.to("cuda"), so the LoRA lands on the transformer's device."""
path = hf_hub_download("lvladikov/MOSS-SFT-Distill-4step-LoRA", "moss_sft_4step_rank_64_lora.safetensors")
state = load_file(path)
for key in state:
if not key.endswith(".lora_down.weight"):
continue
stem = key[: -len(".lora_down.weight")] # diffusion_model.layers.N.proj.NAME
layer = transformer.get_submodule(stem.removeprefix("diffusion_model."))
down = state[key].to(layer.weight.device, layer.weight.dtype)
up = state[stem + ".lora_up.weight"].to(layer.weight.device, layer.weight.dtype)
scale = strength * state[stem + ".alpha"].item() / down.shape[0]
def hook(module, args, out, down=down, up=up, scale=scale):
return out + F.linear(F.linear(args[0], down), up) * scale
layer.register_forward_hook(hook)
pipe = DiffusionPipeline.from_pretrained(
"OpenMOSS-Team/MOSS-Image-SFT",
custom_pipeline="pipeline_moss_image",
trust_remote_code=True,
torch_dtype={"default": torch.bfloat16, "vae": torch.float32},
)
pipe.scheduler = type(pipe.scheduler).from_config(pipe.scheduler.config)
pipe.to("cuda")
apply_4step_lora(pipe.transformer)
image = pipe(
"A snow leopard walking along a rocky ridge in falling snow, telephoto wildlife photograph, natural light",
height=1024,
width=1024,
num_inference_steps=4,
guidance_scale=1.0,
generator=torch.Generator("cpu").manual_seed(42),
).images[0]
image.save("moss_4step.png")
num_inference_steps=4 and guidance_scale=1.0 are the whole configuration. The pipeline's own scheduler lands on σ = 1.0, 0.910, 0.717, 0.024 at 4 steps — the four noise levels the LoRA is trained on — and at guidance_scale=1.0 it makes one model call per step, with no negative pass.load_lora_weights. apply_4step_lora adds moss_sft_4step_rank_64_lora.safetensors beside the bf16 weights, as in training. Merged into bf16 weights with plain rounding, this LoRA would lose part of its change.| file | put it in |
|---|---|
moss_sft_4step_rank_64_lora_comfyui.safetensors (this repo) |
ComfyUI/models/loras/ |
moss_image_sft_bf16.safetensors (Comfy-Org/MOSS-Image) |
ComfyUI/models/diffusion_models/ |
qwen3.5_9b_w4a8_gptq.safetensors (same repo) |
ComfyUI/models/text_encoders/ |
flux2-vae_small.safetensors (same repo) |
ComfyUI/models/vae/ |
Load moss_sft_4step_lora_t2i_local.json — or its _cloud twin on Comfy Cloud. Core ComfyUI nodes only; update ComfyUI first, MOSS-Image support in it is recent.
Settings: euler with Manual Sigmas 1.0, 0.91, 0.717, 0.024, 0.0 (MOSS's own 4-step schedule), CFG 1 (Basic Guider), LoRA strength 1.0 with the _comfyui file, on the bf16 MOSS file. The pictures on this page used the full-precision text encoder, qwen3.5_9b_bf16 (same repo); the workflows load the templates' 4-bit one.
⚙️ Manual Sigmas, not
simple. ComfyUI'ssimplescheduler at 4 steps lands on other noise levels than the four the LoRA is trained on. CFG 1 is one model call per step: no negative prompt and no Skip Layer Guidance, both of which act on the negative pass.
workflow (_local.json / _cloud.json) |
what it does |
|---|---|
moss_sft_4step_lora_t2i |
text to image, the official MOSS-Image template set up for the LoRA. Its default size, 2848×1600, is above the sizes the LoRA is trained at |
moss_sft_4step_lora_layout_t2i |
layout-guided text to image: boxes with captions and text, the official layout template, 1024×1024 |
moss_sft_4step_lora_edit_i2i |
image edit with Comfy-Org's MOSS-Image edit LoRA on top, 4 steps at CFG 1; at some seeds the change lands on another item than the one named, and another seed sets it right |
moss_sft_4step_lora_t2i_PiD |
a supersampled render, 1184×672, that NVIDIA's PiD then draws at 4×: 4736×2688 |
The _cloud versions load this repo's _comfyui LoRA file from your Comfy Cloud library: import it once from its Hugging Face URL. Each workflow's Models note lists every file it needs.
🍎 On a Mac, large sizes can fail in VAE Decode with MPSGraph does not support tensor dims larger than INT_MAX (the text-to-image default, 2848×1600, is past that point; NVIDIA GPUs decode it directly). Switch to tiled decoding: delete Decode (MOSS VAE), add the core VAE Decode (Tiled) node, connect
samplesfrom the sampler'soutput,vaefrom Load MOSS VAE and itsIMAGEto the Output node. Its defaults (tile 512, overlap 64) are fine. Or start ComfyUI with--cpu-vae: every workflow then decodes on the CPU, slower, at any size.
Each graph at its defaults, then what it made. Click a picture for full size.
Text to image — 2848×1600
Layout — the boxes drawn in Create Bounding Boxes, 1024×1024
Image edit — the photo, then the edit
PiD 4× — 4736×2688
| strength | what happens |
|---|---|
| below 1.0 | only part of the trained change arrives; the pictures drift back toward the base model at 4 steps, which draws a blur |
| 1.0 | the trained point — the plain file in diffusers / Python, the _comfyui file in ComfyUI |
| above 1.0 | doubled edges: about 1.3× the trained change measured 1.7× the doubled edges (2.51 against 1.47) for little more fine texture (1.00 against 0.96) |
Keep 1.0: turning it up doubles edges rather than adding detail. The LoRA also runs at 6 and 8 steps; what they change is in More steps.
For the most photographic skin, the community MOSS Realism Enhancer LoRA can be added beside this one — Civitai · Hugging Face copy. It is a separate LoRA by its own author under its own licence, not part of this training, and none of the pictures or numbers on this page use it. In ComfyUI it goes in a second LoRA loader after this one.
eDMD + LADD — distribution matching with an endpoint critic (eDMD) against the 50-step teacher, plus a small LADD-style adversarial critic that compares the student's pictures with the teacher's and with about 8,000 real photo crops, so texture is anchored to real photographs as well as to the teacher. Details in the Detailed Model Card.
Trained on a single NVIDIA B300 in about 30 hours. The frozen base runs in bf16 with no quantisation, the LoRA in fp32 beside its weights; peak GPU memory 196 GB at 4 prompts per update, every activation kept.
The released LoRA is fp32 and is applied beside the bf16 weights, as in training.
guidance_scale=1.0, ComfyUI CFG 1; no negative promptmoss_image_sft_bf16) — the _comfyui file's factor is measured on it; the official template's int8 file is not measured with this LoRASeen on the published sweep and the comparison sheets:
Every sheet below: the teacher (MOSS-Image SFT, 50 steps, CFG 3 — 100 model calls), akhaliq's MOSS-Image-SFT-4-steps v2.0 (strength 1.0, CFG 1 — 4 calls) and this LoRA (the _comfyui file at strength 1.0, CFG 1 — 4 calls), at 1024×1024, the same prompt and noise in all three panels, rendered in ComfyUI on Comfy Cloud.
_archive/resolution_sweeps/chk00015000/ — this LoRA at all 12 trained resolutions for the 22 test prompts, plus the 15 text prompts at 1024×1024: 279 pictures, 4 steps, CFG 1, strength 1.0 with the _comfyui file, rendered in ComfyUI on Comfy Cloud. The teacher's pictures of the same prompts at 1024×1024 are in the comparison sheets above.
| wide | tall | square |
|---|---|---|
| 768×512 | 512×768 | 1024×1024 |
| 1024×768 | 768×1024 | 1280×1280 |
| 1280×960 | 960×1280 | 1440×1440 |
| 1440×1280 | 1024×1824 | |
| 1824×1024 |
Layout:
_archive/resolution_sweeps/chk00015000/
├── 512x768/ 22 pictures, one per test prompt (portrait.jpg, kingfisher.jpg, ...)
├── 768x512/
├── ... (all 12 sizes)
├── 1024x1024/ the 22 + the 15 text prompts (text_*.jpg)
└── 1824x1024/
Two ways to read it: down the sweep (does it hold at every size?) or against the teacher at 1024×1024 in the comparison sheets.
Every published checkpoint and its resolution sweep are kept under _archive/ — checkpoints/ and resolution_sweeps/, each under its number: chk00015000, this one.
The full write-up is in the Detailed Model Card:
This adapter is a derivative of MOSS-Image SFT and is released under its licence, the Apache License 2.0. Copy of the licence: LICENSE; notice: NOTICE.txt.
Not an official OpenMOSS product, not endorsed by the OpenMOSS team. The base model is OpenMOSS's; the adapter, the workflows and the pictures in this repo are mine. The other models the workflows load (the edit LoRA and PiD) come under their own licences.
_archive/checkpoints/moss_sft_4step_rank_64_lora_chk00015000_comfyui.safetensors 595 MBmoss_sft_4step_rank_64_lora_comfyui.safetensors 595 MB_archive/checkpoints/moss_sft_4step_rank_64_lora_chk00015000.safetensors 595 MBmoss_sft_4step_rank_64_lora.safetensors 595 MBOpenMOSS-Team/MOSS-Image-SFT