Moebius: 0.2B Lightweight Image Inpainting Framework with 10B-Level Performance
Kangsheng Duan, Ziyang Xu, Wenyu Liu, Xiaohu Ruan, Xiaoxin Chen, Xinggang Wang
Moebius is a 0.2B-parameter inpainting specialist that matches 10B-level foundation models via structural distillation.
How can we compress a latent diffusion inpainting model to 0.2B parameters while maintaining the visual quality of 10B-scale models?
Industrial foundation models for image inpainting have scaled to 10 billion parameters, creating massive memory and latency barriers for edge deployment. Naive attempts to compress these models trigger a representation bottleneck, causing catastrophic quality degradation. Moebius replaces standard diffusion blocks with Local-$\lambda$ Mix Interaction (L$\lambda$MI) modules that summarize spatial and semantic contexts into fixed-size linear matrices. This structural change is paired with an adaptive multi-granularity distillation strategy that aligns the lightweight student with a high-capacity teacher entirely within the latent space. The resulting 0.22B-parameter model delivers a 15× speedup over industrial generalists while matching or exceeding their generation quality on natural and portrait benchmarks.
Paper Primer
The core mechanism hinges on the L$\lambda$MI block, which acts like a data summarizer: it reads local spatial features and global semantic priors, then compresses them into fixed-size linear matrices to enable efficient interaction without the quadratic cost of standard attention.
Moebius achieves performance parity with 10B-level industrial models while using less than 2% of their parameter count.
Quantitative benchmarks on Places2 and CelebA-HQ show Moebius matching or surpassing FLUX.1-Fill-Dev and SD3.5 Large-Inpainting in FID and LPIPS scores. 0.22B parameters vs. 11.9B parameters; >15× total inference acceleration.
The distillation strategy is the second pillar of the framework. It uses an adaptive weighting mechanism to dynamically balance coarse-grained feature alignment, fine-grained output supervision, and latent-space perceptual constraints, ensuring the student model converges despite its extreme structural compression.
Why does this paper focus on a "specialist" model rather than just distilling a generalist?
The authors argue that industrial generalists contain massive redundancy for specific restoration tasks; by optimizing for a specialist role, they can push architectural efficiency to limits that generalist models cannot reach without losing their zero-shot versatility.
What is the primary trade-off when using this extreme compression?
While Moebius excels at structured and natural contexts, it faces limitations in restoring fine-grained geometry within tiny background aesthetics where contextual textures are severely limited.
Introduction and Motivation
Lightweight diffusion can match 10 B‑level inpainting quality by bridging the efficiency‑quality gap.
Industrial‑scale diffusion models with ~10 B parameters achieve state‑of‑the‑art inpainting but demand prohibitive compute and memory. A lightweight specialist could cut cost, yet naïve structural compression creates a severe representation bottleneck that collapses semantic and texture fidelity. Moebius tackles this by pairing a compact architecture with an adaptive multi‑granularity distillation that restores activation fidelity within a $0.22\text{B}$‑parameter budget, delivering >15× speedup while matching 10 B‑level quality.
The trade‑off is that shrinking parameters cuts compute but also harms generation fidelity; the gap quantifies how far a compact model falls short of a full‑scale model.
**Fig. 8:** More qualitative comparison on natural scenes (Places2). Even with significantly lower parameter counts, Moebius still achieves better contextual consistency across diverse natural scenes compared with other methods, including avoiding structural confusion in rocky terrains (row 2), large-scale blurriness or artifacts in rice fields (row 6), and inconsistent generation in beach and land regions (rows 7 and 8).
**Fig. 9:** More qualitative comparison on portrait scenes (CelebA-HQ and FFHQ). Rows 1–4: CelebA-HQ; rows 5–8: FFHQ. Moebius excels in facial restoration, maintaining superior structural integrity and skin texture fidelity compared to other methods. Specifically, Moebius provides sharper and more coherent results, avoiding color discrepancies on face (row 1), reducing blurriness and artifacts at mouth and ear (rows 2 and 3), suppressing semantic inconsistencies in hair (rows 4 and 5), and preventing structural confusion at teeth and background (rows 6, 7 and 8).
**Fig. 10: Qualitative comparison with commercial edit systems.** Despite massive scale gap, Moebius demonstrates visual quality comparable to commercial models (Nano Banana & Qwen Image Edit), effectively handling complex details restoration.
The impossibility triangle of parameters, speed, and quality forces a trade‑off; Moebius shows that careful distillation can simultaneously shrink all three.
The Moebius Architecture
Moebius achieves extreme architectural efficiency by replacing memory-intensive attention with linear-complexity $\lambda$-modules.
Moebius is a lightweight framework for image inpainting that replaces standard attention mechanisms with linear-complexity interactions. We build upon the Latent Diffusion Model (LDM) framework, which performs diffusion in a compressed latent space rather than pixel space, and integrate Latent Categories Guidance (LCG) to inject semantic category priors as global priors during denoising.
Instead of computing quadratic attention maps, we summarize spatial context into fixed-size linear matrices, allowing the model to capture relationships without the memory cost of standard attention.
The module computes $\lambda_c$ by multiplying the transposed key matrix with the value matrix, resulting in a $(C, C)$ summary matrix.
The module computes $\lambda_p$ using a local convolution over the value matrix, capturing spatial neighbors in the $2 \times 2$ window.
The query $Q_l$ interacts with these $(C, C)$ matrices, producing an output $Y_l$ of the same shape as the input.
The complexity shifts from $O(H^2 W^2)$ to $O(H W C^2)$, making the operation independent of the sequence length for large images.
This module enables cross-attention between latent features and global semantic priors ($E_{LCG}$) by projecting both into a shared linear interaction space, bypassing the need for expensive cross-attention maps.
**Fig. 3:** Illustration of local context aggregation (Local-$\lambda$) and cross-embedding interaction (Interactive-$\lambda$) in the latent domain. In both modules, $\lambda$ efficiently summarizes either spatial contexts or the global prior $E_{LCG}$ into a fixed-size linear matrix, bypassing memory-intensive attention calculations.
Multi-Granularity Distillation
We train Moebius by aligning teacher and student representations at multiple scales with adaptive loss weighting.
Compressing the diffusion backbone to 0.2 B parameters cuts capacity, risking degraded generation quality. The remedy is to let the tiny student learn from a large teacher at several spatial resolutions, preserving fine details without exploding memory use.
PixelHacker is a high‑capacity diffusion backbone that defines the performance ceiling for the student.
The student aligns its latent features to the teacher at coarse, fine, and perceptual levels, while an adaptive weighting scheme balances the competing losses.
How does Adaptive Multi‑Granularity Distillation differ from ordinary knowledge distillation?
Standard distillation usually aligns a single output (e.g., logits) between teacher and student. Here we align representations at multiple spatial resolutions, add a latent‑space perceptual term, and dynamically re‑weight each loss based on its gradient magnitude, which prevents any single term from dominating the training dynamics.
Compute $W_{F\_KD}= (4^2)/(2^2)=16/4=4$.
Compute $W_{\text{perceptual}}= (4^2)/(1^2)=16/1=16$.
Suppose $L_{\text{task}}=0.05$, $L_{F\_KD}=0.02$, $L_{\text{perceptual}}=0.01$.
Weighted fine loss $L_{\text{out}}=0.05 + 4\cdot0.02 + 16\cdot0.01 = 0.05 + 0.08 + 0.16 = 0.29$.
Even a small perceptual loss can dominate the total loss if its gradient is weak; the adaptive weights amplify it to keep its influence comparable to the task loss.
Forward pass the student and teacher on the same latent input.
Compute coarse, fine, task, and perceptual losses.
Calculate gradient norms $G(\cdot,\theta_C)$ and $G(\cdot,\theta_F)$ for each loss.
Derive adaptive weights $W_{F\_KD}$, $W_{\text{perceptual}}$, and $W_{C\_task}$.
Form $L_{\text{out}}$ and $L_{\text{total}}$ using the weights.
Back‑propagate $L_{\text{total}}$ to update the student parameters.
**Fig. 4:** Small feature spaces can still maintain high representation quality. Moebius (0.22B) exhibits highly similar activation maps to the teacher model, PixelHacker (0.86B), across multiple spatial granularities, demonstrating that it maintains consistent representational quality despite a severely compressed (4x smaller) architecture. This validates the optimal synergy between our lightweight design and the adaptive multi-granularity distillation.
Performance and Benchmarking
Extreme compression hurts quality; Moebius uses multi‑granularity distillation to keep fidelity in 0.2 B parameters.
The previous section introduced multi‑granularity distillation, which lets a tiny diffusion model retain the activation patterns of a much larger teacher. Here we quantify how that translates into concrete speed and quality gains.
Moebius runs with 0.226 B parameters and 26.01 ms/step latency, a 6× speedup over 10 B‑level industrial models while matching their generation quality.
Table 1 shows Moebius’s parameter count is 2–3 % of FLUX.1‑Fill‑Dev (11.9 B) and SD3.5 Large‑Inp. (8.05 B), and its single‑step latency is six times lower.
**Fig. 5:** Qualitative comparison with SOTA academic and industrial methods on natural and portrait scenes. Left: Places2. Right, rows 1–2: CelebA-HQ; rows 3–4: FFHQ. Moebius delivers consistent contextual generation across natural and portrait domains, avoiding the common failure cases of other methods, including color discrepancies, blur, artifacts, semantic inconsistencies, and structural confusion.
**Fig. 6:** User study of Moebius (0.22B) against teacher and 10B-level generalist models across various scenes. Moebius matches its teacher's performance and significantly outperforms massive generalists, excelling particularly in portrait scene.
Moebius delivers 10 B‑level generation quality with only 0.2 B parameters.
Ablation and Limitations
Ablations reveal that only full architectural synergy and multi‑granularity distillation preserve quality at extreme compression.
We now examine how each architectural tweak and each distillation objective contributes to the overall quality‑efficiency trade‑off. Experiments 11–15 in Table 2 isolate individual components, while Table 5 isolates loss terms.
Integrating all structural modifications (Exp 9) yields more than a fifteen‑fold inference speedup without sacrificing quality.
Table 2 shows Exp 9 achieving the lowest parameter count (226 M) and GFLOPs (154.00) while keeping FID comparable to the baseline.
Removing the full set of multi‑granularity distillation losses degrades generation quality dramatically.
Table 5 reports FID 74.20 when only the coarse‑grained loss (`LC_KD`) is used, versus FID 26.43 with the complete loss suite.
**Fig. 7: Real-World Object Removal.** Moebius handles realistic masks with superior consistency compared to baselines.
**Fig. 11: Failure case analysis.** Compared with its teacher model (PixelHacker), Moebius may exhibit minor detail loss or less plausible textures in extremely tiny background regions when context is limited. These instances illustrate the capacity-efficiency trade-off of our lightweight specialist.
Supplementary Analysis
Supplementary material provides extra qualitative results, ablations, and OOD evaluation.
We begin with an overview of the supplementary content, which includes extra qualitative comparisons on natural and portrait datasets, a commercial system benchmark, a failure‑case discussion, and detailed ablations of classifier‑free guidance (CFG) and out‑of‑distribution performance.
Natural‑scene showcases on the Places2 dataset illustrate that Moebius preserves structural continuity better than 10 B‑parameter industrial models, despite its 0.22 B‑parameter footprint.
Portrait‑scene showcases on CelebA‑HQ and FFHQ demonstrate Moebius’s ability to maintain facial symmetry and fine skin texture, often surpassing its 1 B‑parameter teacher.
We also compare Moebius against leading commercial image‑editing services, observing that Moebius yields fewer semantic artifacts and higher visual fidelity.
**Table 6.** Ablation of CFG scales. To validate the optimal CFG configuration on natural (Places2) and portrait (CelebA-HQ) scenes, we conducted extensive ablation studies on Places2 (Test) and CelebA-HQ (512) benchmarks. Results indicate that the optimal CFG scales for natural and portrait scenes are 2.5 and 2.0 (highlighted in green), which serve as our default settings.
Failure‑case analysis reveals that Moebius can struggle with extremely fine‑grained geometry in tiny background inpainting, where the teacher model still produces more plausible details.
**Table 7.** OOD evaluation for verifying generalization & zero-shot capability. We sampled 10k images from LVIS [11] as OOD natural dataset and 3k images from the wiki subset of DeepFakeFace [39] as OOD portrait dataset. Mask settings follow the evaluation protocol of Places2 (Test)/CelebA-HQ (512) in main paper. All academic methods, including Moebius, are evaluated using available Places2/CelebA-HQ weights. The strong results demonstrate Moebius' excellent generalizability.
Questions & answers
What is Moebius and what does it contribute?
Moebius is a lightweight image inpainting framework with 0.22B parameters that achieves generation quality comparable to 10B-parameter industrial models while delivering a 15× speedup, enabled by a novel Local-λ Mix Interaction (LλMI) architecture and an adaptive multi-granularity distillation strategy.
What problem does Moebius address?
Moebius addresses the prohibitive memory and latency costs of industrial-scale diffusion inpainting models (~10B parameters), which create barriers for edge deployment, while also solving the representation bottleneck that causes catastrophic quality degradation when naively compressing such models.
Why does Moebius focus on a specialist model rather than distilling a generalist?
The authors argue that industrial generalist models contain massive redundancy for specific restoration tasks, so optimizing for a specialist role allows architectural efficiency to be pushed to limits that generalist models cannot reach without sacrificing their zero-shot versatility.
How does the Local-λ Mix Interaction (LλMI) module work?
The LλMI module replaces standard attention mechanisms by reading local spatial features and global semantic priors, then compressing them into fixed-size linear matrices to enable efficient interaction without the quadratic cost of standard attention, effectively acting as a data summarizer.
What is the Adaptive Multi-Granularity Distillation strategy?
It aligns the lightweight student model with a large teacher at multiple spatial resolutions, adds a latent-space perceptual term, and dynamically re-weights each loss based on its gradient magnitude to prevent any single term from dominating training dynamics, all operating entirely within the latent space.
How does Adaptive Multi-Granularity Distillation differ from ordinary knowledge distillation?
Standard distillation typically aligns a single output (e.g., logits) between teacher and student, whereas Moebius's approach aligns representations at multiple spatial resolutions, incorporates a latent-space perceptual constraint, and uses adaptive gradient-magnitude-based re-weighting across all loss terms.
What architectural framework does Moebius build upon?
Moebius is built upon the Latent Diffusion Model (LDM) framework, which performs diffusion in a compressed latent space rather than pixel space, and integrates Latent Categories Guidance (LCG) to inject semantic category priors as global priors during denoising.
What datasets and benchmarks were used to evaluate Moebius?
The paper reports evaluations on natural-scene benchmarks using the Places2 dataset and portrait benchmarks using CelebA-HQ and FFHQ; it also includes comparisons against leading commercial image-editing services.
What are the key quantitative results of Moebius?
Moebius achieves a 15× speedup over industrial generalist models while matching or exceeding their generation quality on natural and portrait benchmarks, all with only 0.22B parameters compared to the ~10B parameters of those industrial models.
How does Moebius perform on portrait inpainting specifically?
On CelebA-HQ and FFHQ portrait benchmarks, Moebius maintains facial symmetry and fine skin texture, and the paper states it often surpasses its 1B-parameter teacher model in these tasks.
How does Moebius compare to commercial image-editing services?
The paper reports that Moebius yields fewer semantic artifacts and higher visual fidelity compared to leading commercial image-editing services in their supplementary benchmark, though specific service names and numerical metrics are not detailed in the provided text.
What are the limitations of Moebius?
Moebius struggles with restoring fine-grained geometry in tiny background inpainting regions where contextual textures are severely limited, and in these failure cases the larger teacher model still produces more plausible details.
How was the contribution of individual components validated?
The paper includes ablation studies in Table 2 (experiments 11–15) that isolate individual architectural components and Table 5 that isolates individual distillation loss terms, quantifying each component's contribution to the quality-efficiency trade-off.
What is the parameter count of Moebius and how does it compare to its teacher?
Moebius has 0.22B parameters; the paper references a 1B-parameter teacher model it is distilled from and 10B-parameter industrial generalist models it is benchmarked against.
Who are the authors of Moebius and where was it published?
The paper does not specify individual author names or the publication venue in the provided text; it is available on arXiv at arxiv.org/abs/2606.19195.
Key terms
- LλMI (Local-λ Mix Interaction)
- A novel architectural module in Moebius that compresses local spatial features and global semantic priors into fixed-size linear matrices, replacing standard attention to achieve linear rather than quadratic computational complexity.
- Latent Diffusion Model (LDM)
- A class of diffusion generative models that perform the iterative denoising process in a compressed latent space rather than directly in pixel space, reducing computational cost.
- Latent Categories Guidance (LCG)
- A mechanism integrated into Moebius that injects semantic category priors as global conditioning signals during the latent-space denoising process.
- Adaptive Multi-Granularity Distillation
- A training strategy that transfers knowledge from a large teacher model to a small student model by aligning their representations at multiple spatial resolutions with dynamically re-weighted loss terms based on gradient magnitudes.
- Knowledge distillation
- A model compression technique where a smaller student model is trained to mimic the outputs or internal representations of a larger, more capable teacher model.
- Representation bottleneck
- A failure mode in model compression where reducing model capacity causes the model to lose the ability to encode sufficient semantic and texture information, leading to severe quality degradation.
- Image inpainting
- The task of filling in missing, masked, or corrupted regions of an image with plausible and visually coherent content.
- Classifier-Free Guidance (CFG)
- A technique in diffusion models that steers generation toward a conditioning signal (e.g., a text prompt or category label) without requiring a separate classifier, by interpolating between conditional and unconditional model outputs.
- Latent-space perceptual constraint
- A distillation loss term that enforces perceptual similarity between teacher and student model representations within the compressed latent space rather than in pixel space.
- Specialist model
- A model optimized for a specific task (here, image inpainting) rather than a broad range of tasks, allowing greater architectural efficiency at the cost of zero-shot generalization.
- Places2
- A large-scale dataset of natural scene images commonly used as a benchmark for image inpainting and scene understanding tasks.
- CelebA-HQ / FFHQ
- High-resolution face image datasets widely used as benchmarks for evaluating portrait-related generative and restoration tasks.
- Quadratic attention cost
- The computational complexity of standard self-attention mechanisms, which scales with the square of the sequence (or spatial token) length, making them expensive for high-resolution inputs.