Instructions to use hustvl/Moebius with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hustvl/Moebius with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("hustvl/Moebius", torch_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
metadata
license: mit
pipeline_tag: image-to-image
Moebius: 0.2B Lightweight Image Inpainting Framework with 10B-Level Performance
Moebius is a highly efficient, lightweight image inpainting framework that operates with a mere 0.22B parameters (less than 2% of the size of the 11.9B FLUX.1-Fill-Dev) while delivering comparable or superior generation quality and a $>15\times$ acceleration in total inference time.
Key Features
- Extreme Parametric Efficiency (< 2%): Moebius operates with a mere 0.22B (226M) parameters, bypassing heavy-compute bottlenecks.
- 15ร Inference Speedup: Blistering inference latency of only 26.01 ms per step on a single GPU.
- 10B-Level Inpainting Quality: Performs on par with, and in certain scenarios surpasses, SOTA generalist models (FLUX.1-Fill-Dev, SD3.5 Large-Inpainting) across both natural and portrait scenes.
๐ฆ Environment Setup
To get started, clone the official GitHub repository, set up the environment, and install dependencies:
git clone https://github.com/hustvl/Moebius.git
cd Moebius
conda create -n moebius python=3.14.4
conda activate moebius
pip install -r requirements.txt
๐๏ธ Model Checkpoints Setup
Organize your model weights in the ./weight folder as follows:
- Download the VAE checkpoint from hustvl/PixelHacker and put it into
./weight/vae. - Download the Moebius checkpoints (e.g., pretrained, ft_places2, ft_celebahq, ft_ffhq) and place them under
./weight/Moebius.
โโโ weight
| โโโ Moebius
| โโโ pretrained
| โโโ diffusion_pytorch_model.bin
| โโโ ft_places2
| โโโ diffusion_pytorch_model.bin
| โโโ ft_celebahq
| โโโ diffusion_pytorch_model.bin
| โโโ ft_ffhq
| โโโ diffusion_pytorch_model.bin
| โโโ vae
| โโโ config.json
| โโโ diffusion_pytorch_model.bin
๐ฎ Inference
Run the following command to perform inpainting on custom images and masks. Place your input images and masks with matching filenames under data/images and data/masks respectively:
python -m infer.infer_moebius \
--model-config config/model_cfg/moebius.yaml \
--model-weight weight/Moebius/ft_celebahq/diffusion_pytorch_model.bin \
--real-dir data/images \
--mask-dir data/masks \
--save-dir ./outputs \
--cfg 2.0 \
--batch-size 8 \
--num-workers 8
๐ Citation
If you find Moebius useful in your research, please consider citing:
@misc{DuanAndXu2026Moebius,
title={Moebius: 0.2B Lightweight Image Inpainting Framework with 10B-Level Performance},
author={Kangsheng Duan and Ziyang Xu and Wenyu Liu and Xiaohu Ruan and Xiaoxin Chen and Xinggang Wang},
year={2026},
eprint={2606.19195},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2606.19195},
}