Instructions to use AcademiaSD/MOSS-Image-NF4-for-LoRA-Training with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use AcademiaSD/MOSS-Image-NF4-for-LoRA-Training with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("AcademiaSD/MOSS-Image-NF4-for-LoRA-Training", dtype=torch.bfloat16, device_map="cuda") 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
MOSS-Image NF4 for LoRA Training
Not an official OpenMOSS release. This repository holds NF4 conversions of MOSS-Image Base and MOSS-Image SFT by the OpenMOSS Team, made so that the MOSS-Image trainer of AcademiaSD LoRAlab Trainer Studio can download them and train LoRAs on consumer GPUs. The transformers are stored in the trainer's own pre-quantized cache format, which diffusers and ComfyUI do not load directly: for inference, use OpenMOSS's original weights.
You do not need to download this repository by hand: the trainer downloads only the parts it uses on first use.
Contents
| Folder | Content | Size |
|---|---|---|
transformer/ |
MOSS-Image Base transformer (5B): the 252 attention and MLP layers of the 42 blocks in NF4 (bitsandbytes, pre-quantized); text refiner, embedders, modulations, norms and output layer in BF16 | 3.1 GB |
transformer_sft/ |
MOSS-Image SFT transformer, same format | 3.1 GB |
text_encoder_BF16/ |
Qwen3.5-9B text encoder, unchanged (BF16). Base and SFT use the same one | 16.8 GB |
text_encoder_INT8/ |
The same text encoder in INT8 (bitsandbytes LLM.int8); the vision tower, unused for text, stays in BF16 | 9.9 GB |
text_encoder_NF4/ |
The same text encoder in NF4 (bitsandbytes); the vision tower stays in BF16 | 6.5 GB |
tokenizer/, vae/, scheduler/ |
Unchanged (the VAE is the FLUX.2 autoencoder MOSS-Image ships with) | 0.3 GB |
LICENSE, NOTICE.md |
Apache License 2.0 and the list of changes |
The trainer downloads one transformer and one text encoder: 20.2 GB with the BF16 text encoder, 13.2 GB with INT8 or 9.9 GB with NF4 (the original model is 27.2 GB).
Format
transformer/andtransformer_sft/are not standard diffusers checkpoints. Each is a pre-quantized cache: one.safetensorsfile per layer inweights/(NF4 weight plus its packed bitsandbytesQuantState),others.safetensorswith the tensors kept in BF16, andindex.json. The trainer builds an empty transformer fromconfig.jsonand fills it from this cache. The parameter names are OpenMOSS's originals.text_encoder_INT8/andtext_encoder_NF4/are regular transformers checkpoints saved with theirquantization_config;text_encoder_BF16/,tokenizer/andvae/are the original files.- The converter is
tools/mossimage/5_conversor_MossImage_NF4.pyin the Trainer Studio repository.
Measured difference of the text embeddings against BF16 (last layer, relative error): INT8 ~7-14 %, NF4 ~20-30 %. The trainer uses BF16 by default, spread between GPU and RAM on small GPUs, so the LoRA is trained on exactly the embeddings ComfyUI computes.
LoRAs trained with it
The trainer exports LoRAs with the original layer names (diffusion_model.layers.N.proj.{q,k,v,o,ffn_up_gate,ffn_down}.lora_A / lora_B plus alpha), which ComfyUI (nightly, with native MOSS-Image support) loads with the standard LoRA loader.
Measured on an RTX 5080: 512², rank 8, ~1.0 s per step, under 6 GB of VRAM.
The fast previews of the trainer use darask0's 4-step adapter (Apache 2.0, built on lodestones' 8-step adapter), downloaded from its own repository; it is not part of this one.
License and attribution
MOSS-Image Base and SFT, including these modified versions, are released by the OpenMOSS Team under the Apache License 2.0. The Qwen3.5-9B text encoder is by the Qwen team, also under the Apache License 2.0. NOTICE.md lists what was changed.
This repository is provided "as is", without warranties of any kind.
Links
- Trainer: AcademiaSD LoRAlab Trainer Studio
- Original models: OpenMOSS-Team/MOSS-Image-Base · OpenMOSS-Team/MOSS-Image-SFT · GitHub
- ▶ YouTube: youtube.com/@Academia_SD
- 💬 Discord: discord.gg/Syuaduy678
- ☕ Ko-Fi: ko-fi.com/academiasd
- Downloads last month
- -
Model tree for AcademiaSD/MOSS-Image-NF4-for-LoRA-Training
Base model
OpenMOSS-Team/MOSS-Image-Base