Run this model with HF Jobs

Run lvladikov/MOSS-Base-Distill-4step-LoRA 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/lvladikov/MOSS-Base-Distill-4step-LoRA. 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/lvladikov/MOSS-Base-Distill-4step-LoRA 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.
How to use from the
Use from the
Diffusers library
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-Base", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("lvladikov/MOSS-Base-Distill-4step-LoRA")

prompt = "Portrait of a young woman with freckles and windswept auburn hair, soft window light, shallow depth of field, photograph, sharp detail"
image = pipe(prompt).images[0]

MOSS-Image Base โ€” 4-Step Distillation LoRA

4 steps at CFG 1 instead of 50 at CFG 5 ยท 4 model calls instead of 100 ยท about 17ร— less GPU time per picture ยท the teacher's fine texture ยท 12 trained resolutions up to 1824ร—1024 and 1024ร—1824 ยท 27,000 training samples

A LoRA for MOSS-Image Base that renders in 4 steps without CFG what the model renders in 50 steps at CFG 5 with a quality negative prompt โ€” 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.

  • โšก 4 steps, CFG 1 โ€” 4 model calls against the teacher's 100 (50 steps, two calls each at CFG 5), on MOSS's own 4-step schedule
  • โฑ๏ธ About 17ร— less GPU time โ€” 45.9 s against 776.7 s for the same 22 pictures at 1824ร—1024 on Comfy Cloud (the jobs' billed GPU time)
  • ๐ŸŽฏ The teacher's look and detail โ€” against the teacher on the same 22 test prompts and noise at 1824ร—1024 in ComfyUI: fine texture 1.04ร— the teacher's, haze 0.94ร—, colour 0.92ร—; on average 3.4 L* brighter than the teacher's pictures (scale 0โ€“100)
  • ๐ŸŒซ๏ธ No washed-out look โ€” against plain MOSS-Image Base at CFG 5 without a negative prompt, on the same prompts and noise: haze 0.70ร—, colour 1.25ร—, blacks not lifted, fine texture 2.1ร—
  • ๐Ÿ”ค Writes the words a prompt spells out โ€” every requested string right on 13 of the 15 text test prompts at 1824ร—1024 (the teacher 15)
  • ๐Ÿ“ 12 trained resolutions โ€” wide, tall and square, from 768ร—512 and 512ร—768 up to 1824ร—1024 and 1024ร—1824
  • ๐Ÿ”Œ Two files, one LoRA โ€” the exact LoRA for diffusers / Python, and a ComfyUI file that is right at strength 1.0 in ComfyUI's standard loader
  • ๐Ÿงฉ Six ComfyUI workflows โ€” text to image, layout and PiD 4ร—, each for local ComfyUI and for Comfy Cloud
  • ๐ŸŽฒ 34,000 prompts from Lakonik's 3M-prompt dataset and 2,877 prompts that spell out words โ€” signs, menus, posters, labels
  • ๐Ÿ“ท About 8,000 captioned photo crops and the teacher's own pictures in the critic's real set
  • ๐Ÿ”ข 27,000 training samples in the shipped weights โ€” rank 64, 252 modules
  • ๐Ÿ“… Trained on NVIDIA H200 and B300

Current published checkpoint: chk00027000 โ€” 27,000 training samples, produced 6 Dec 2026.

๐Ÿ’ก In ComfyUI, use the _comfyui file 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 7%, measured. The _comfyui file carries the measured factor (1.07) 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.

The test prompts, rendered by MOSS-Image Base with this LoRA at 4 steps


Examples

Prompt
Portrait of a young woman with freckles and windswept auburn hair, soft window light, shallow depth of field, photograph, sharp detail
Prompt
A snow leopard walking along a rocky ridge in falling snow, telephoto wildlife photograph, natural light
Prompt
A fox in a red scarf reading a small book with a plain cover under a mushroom, whimsical watercolour painting, one continuous scene filling the entire frame, watercolour texture, soft edges
Prompt
Busy outdoor street market crowded with many people browsing colorful fruit and vegetable stalls, awnings, midday sun, wide shot, photorealistic
Prompt
A kingfisher bird bursting out of water with spread wings, water droplets frozen mid-air, iridescent blue and orange feathers, high-speed photography
Prompt
A curious young inventor girl with oversized goggles, 3D animated film style, subsurface skin, soft studio lighting, shallow depth of field
Prompt
A giant mecha standing in a rain-soaked city plaza, anime style, panel lining, glowing cockpit, dramatic low angle
Prompt
Rainy night city street with glowing neon shop signs and readable text, wet asphalt reflections, pedestrians with umbrellas, cinematic
Prompt
A storm sorceress channelling lightning, video-game splash art, bold rim lighting, energetic brush strokes, high contrast
Prompt
A claymation chef holding a tiny cake, visible fingerprints in the clay, miniature set, tilt-shift
Prompt
A row of four small shops on a sunny street, each with its own sign above the door: a red sign that reads "PIZZA", a blue sign that reads "BOOKS", a green sign that reads "FLOWERS" and a yellow sign that reads "BARBER", people walking past, photograph
Prompt
A printed paper menu card standing on a restaurant table with the title "LUNCH" and five lines below it that read "Tomato Soup $6.00", "Cheese Toast $7.50", "Fish Tacos $11.00", "Lemon Cake $5.00" and "Green Tea $3.75", a glass of water and cutlery beside it, soft daylight, photograph

This LoRA at 4 steps, CFG 1, 1824ร—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 my SFT 4-step LoRA on Base: Compared with the teacher.


Files

file what it is
moss_base_4step_rank_64_lora.safetensors the LoRA, exact โ€” diffusers / Python at strength 1.0, see diffusers
moss_base_4step_rank_64_lora_comfyui.safetensors the same LoRA for ComfyUI's standard loader at strength 1.0 โ€” see ComfyUI
moss_base_4step_lora_*_local.json, moss_base_4step_lora_*_cloud.json six ComfyUI workflows, core nodes only: text to image in this folder; layout and PiD 4ร— in _more_workflows/ โ€” see ComfyUI
moss_base_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 โ†’ 68.48). Both carry the training details in their safetensors metadata. The file names carry no checkpoint number: both hold chk00027000, which also sits in _archive/checkpoints/.


Quick Start

diffusers

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-Base-Distill-4step-LoRA", "moss_base_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-Base",
    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=1824,
    num_inference_steps=4,
    guidance_scale=1.0,
    generator=torch.Generator("cpu").manual_seed(42),
).images[0]
image.save("moss_base_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.
  • Why the helper: MOSS's custom pipeline has no load_lora_weights. apply_4step_lora adds moss_base_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.

ComfyUI

file put it in
moss_base_4step_rank_64_lora_comfyui.safetensors (this repo) ComfyUI/models/loras/
moss_image_base_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_base_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 on MOSS's official 4-step sigmas (entered in ComfyUI's Manual Sigmas node: 1.0, 0.91, 0.717, 0.024, 0.0), CFG 1 (Basic Guider), LoRA strength 1.0 with the _comfyui file, on the bf16 MOSS-Image Base 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's simple scheduler 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_base_4step_lora_t2i text to image, the official MOSS-Image template set up for MOSS-Image Base and the LoRA. Its default size, 2848ร—1600, is above the sizes the LoRA is trained at
moss_base_4step_lora_layout_t2i layout-guided text to image: boxes with captions and text, the official layout template, 1024ร—1024
moss_base_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 samples from the sampler's output, vae from Load MOSS VAE and its IMAGE to 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.


LoRA Strength

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 more than the trained change; not a setting this LoRA is made for

Keep 1.0.


Method

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; on half the batches a coarse pull toward the teacher's own 50-step picture from the same noise keeps the layout on the teacher's. The teacher is MOSS-Image Base at 50 steps and CFG 5; the last 6,000 samples used it with the negative prompt "hazy, washed out, blurry, low detail". Details in the Detailed Model Card.


Hardware

Trained on NVIDIA H200 and B300.

The released LoRA is fp32 and is applied beside the bf16 weights, as in training.


Usage Notes

  • ๐ŸŽฏ MOSS-Image Base only โ€” trained against Base's weights and its schedule; for MOSS-Image SFT, use my SFT 4-step LoRA
  • ๐Ÿšซ CFG 1 โ€” diffusers guidance_scale=1.0, ComfyUI CFG 1; no negative prompt
  • ๐Ÿ“ MOSS's own schedule โ€” ฯƒ = 1.0, 0.910, 0.717, 0.024 at 4 steps, the noise levels the LoRA is trained on
  • ๐Ÿ“ Sizes โ€” trained from 768ร—512 / 512ร—768 up to 1824ร—1024 / 1024ร—1824, in multiples of 16; larger sizes are outside the trained range
  • ๐Ÿงฎ In ComfyUI, the bf16 MOSS-Image Base file (moss_image_base_bf16) โ€” the _comfyui file's factor is measured on it; the int8 file is not measured with this LoRA

Known Limitations

Seen on the published sweep and the comparison sheets:

  • compositions stay simpler than the teacher's at the same noise: the mecha stands head-on at every size, where the teacher draws it at an angle; the race car comes nearly head-on at the four tall sizes (512ร—768, 768ร—1024, 960ร—1280, 1024ร—1824); the colony ship is a rounded white hull at every size
  • invented lettering where the prompt names no words: the storm sorceress gets an unasked, misspelled title at every size at the test seed (the sweep's 1024ร—768 picture is from a nearby seed) and sits in a white rounded frame at 1024ร—1024; the fox's plain book cover gets a made-up title at 960ร—1280, 1024ร—1024, 1024ร—1824, 1280ร—1280 and 1824ร—1024; the swordsman gets a title at 512ร—768; the neon street's signs and the boards around the show jump spell made-up words
  • two of the 15 text prompts slip: the Shanghai street's blue sign reads "24HOPEN" for "OPEN 24H", and the bakery's windows read "Fresh Daily" and "Bread Daily" for "Fresh Bread Daily"
  • pictures sit brighter than the teacher's: 3.4 L* on average at 1824ร—1024, with lighter shadows
  • 14 of the 279 sweep pictures come from a nearby seed (4243 to 4248) instead of the test seed (4242; the sorceress's own is 4243), where the test seed's picture drew a fault: a fifth or sixth diner at the family-of-four table (768ร—1024, 1280ร—1280, 1824ร—1024), a doubled or loose sword blade (512ร—768, 768ร—512, 768ร—1024, 1824ร—1024), faults in the group photo (1024ร—768, 1440ร—1440, 1024ร—1824) and at the piano (1440ร—1280, 1824ร—1024), a shopper drawn without an upper body in the market (1824ร—1024), and the sorceress's title (1024ร—768). The list is in the Detailed Model Card

Compared with the teacher

Every sheet below: the teacher (MOSS-Image Base, 50 steps, CFG 5, with the negative prompt "hazy, washed out, blurry, low detail" โ€” 100 model calls), my SFT 4-step LoRA on Base (its ComfyUI setting 1.08, CFG 1 โ€” 4 calls) and this LoRA (the _comfyui file at strength 1.0, CFG 1 โ€” 4 calls), at 1824ร—1024, the same prompt and noise in all three panels, rendered in ComfyUI on Comfy Cloud.

Portrait of a young woman with freckles and windswept auburn hair, soft window light, shallow depth...

portrait comparison


Busy outdoor street market crowded with many people browsing colorful fruit and vegetable stalls,...

market comparison


A snow leopard walking along a rocky ridge in falling snow, telephoto wildlife photograph, natural...

snowleopard comparison


A row of four small shops on a sunny street, each with its own sign above the door: a red sign that...

text_street4 comparison


A printed paper menu card standing on a restaurant table with the title "LUNCH" and five lines...

text_menu5 comparison


(32 more examples in the Detailed Model Card โ€” all 37 prompts, see assets/)


Resolution Sweeps

_archive/resolution_sweeps/chk00027000/ โ€” this LoRA at all 12 trained resolutions for the 22 test prompts, plus the 15 text prompts at 1824ร—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 1824ร—1024 are in the comparison sheets above.

Layout:

_archive/resolution_sweeps/chk00027000/
โ”œโ”€โ”€ 512x768/       22 pictures, one per test prompt (portrait.jpg, kingfisher.jpg, ...)
โ”œโ”€โ”€ 768x512/
โ”œโ”€โ”€ ...            (all 12 sizes)
โ””โ”€โ”€ 1824x1024/     the 22 + the 15 text prompts (text_*.jpg)

Two ways to read it: down the sweep (does it hold at every size?) or against the teacher at 1824ร—1024 in the comparison sheets.


Archive

Every published checkpoint and its resolution sweep are kept under _archive/ โ€” checkpoints/ and resolution_sweeps/, each under its number: chk00027000, this one.


Detailed Model Card

The full write-up is in the Detailed Model Card:


License

This adapter is a derivative of MOSS-Image Base 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 model the PiD workflow loads comes under its own licence.

Downloads last month
-
Inference Examples
Examples
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for lvladikov/MOSS-Base-Distill-4step-LoRA

Adapter
(102)
this model

Paper for lvladikov/MOSS-Base-Distill-4step-LoRA