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
Error on executing pipe.load_lora_weights(...)
When I use as the base model pipe "OpenMOSS-Team/MOSS-Image-SFT" then attempt to load the 4-step lora with:
pipe.load_lora_weights(...) I get the error:
AttributeError: 'MOSSImagePipeline' object has no attribute 'load_lora_weights'
Are you loading lora weights differently?
Ok, I have downloaded apply_lora.py and using as the base model "OpenMOSS-Team/MOSS-Image-SFT".
apply_turbo_lora(pipe.transformer) works and I get good generations after 4 steps.
I gathered the earlier error was because MOSSImagePipeline ls not implementing all the normal diffusers functionality (LoRA mixin in this case). What I don't understand is all the MOSS-Image loras now showing up on HF with either a reference to pipe.load_lora_weights() or no explanation at all how to load them. Is this being discussed somewhere? I don't see any references in the HF forums.
The error happens because MOSSImagePipeline doesn't inherit the standard Diffusers mixin that adds load_lora_weights. The repo author likely expects you to use their custom script (apply_lora.py) or manually apply weights to pipe.transformer, as you discovered. There's no official HF thread yet; it's a known gap in that specific pipeline implementation.
If you want to contribute to fixing this, I can draft a concise PR description or a minimal patch snippet for the repo maintainers if you'd like. Just say the word and I'll write it up.