Instructions to use mlx-community/Moebius-Places2-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Moebius-Places2-fp16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir Moebius-Places2-fp16 mlx-community/Moebius-Places2-fp16
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
mlx-community/Moebius-Places2-fp16
MLX conversion of hustvl/Moebius (the Places2 fine-tune) β a 0.22B-parameter latent-diffusion image inpainting / object removal model ("Moebius: 0.2B Lightweight Image Inpainting Framework with 10B-Level Performance"), distilled from PixelHacker. Reference code: hustvl/Moebius (Apache-2.0).
The repo is consolidated: unet.safetensors (the LambdaNetworks-based denoiser, fp16, 453 MB)
plus vae.safetensors (the SDXL-family KL-f8 AutoencoderKL from
hustvl/PixelHacker, scaling_factor 0.13025, fp16,
167 MB). The VAE conversion is lossless β upstream ships it fp16 (round-trip worst |Ξ| = 0).
Conversion notes
- Tensors are stored in PyTorch's own layouts (OIHW conv weights, original key names, no remapping); consumers perform their own layout transposes at load.
- The 124
num_batches_trackedBatchNorm counters are dropped (int64, never read at inference). - BatchNorm
running_mean/running_varstay fp32 inside the fp16 file β a small variance that rounds toward zero at fp16 would makersqrtexplode. - fp16 was chosen by measurement, not default: per-forward error vs the fp32 reference is rel 9.3e-04 (at the GPU fp32 noise floor), end-to-end trajectory cosine 0.99994, output visually identical. bf16 was rejected (~9Γ worse per forward β the 8-bit mantissa punishes these well-scaled conv weights).
Usage notes (things that will silently produce wrong output)
- 512Γ512 only.
rel_pos_embis spatially baked at construction (64Γ64 latent) and the attention wrapper assumes a square grid β other resolutions are structurally invalid, not merely off-distribution. Resize in, paste the fill back at the original resolution through a blurred mask. - Mask convention: white = remove (luma β₯ 0.5), binarized.
- Denoiser input is 9 channels: noisy(4) + mask(1) + masked-image(4) β the mask is the middle channel group.
- Conditioning is a learned 20Γ3072 category table (no text encoder): rows 0β9 = conditional,
rows 10β19 = unconditional, CFG batch-doubled
[uncond, cond]through one forward (reference CFG scale 2.5). - Sampler: DDIM,
beta_start 0.00085 / beta_end 0.012 / scaled_linear / 1000train steps,clip_sample false,eta 0. Reference runsnum_steps 20atstrength 0.99β 19 real steps starting at t=900, initialized from the clean image latents noised attimesteps[0](not pure noise), withnoise_offset 0.0357per-channel offset noise.
Swift / MLX runtime
This checkpoint is consumed by xocialize/mlx-moebius-swift
(MLX-Swift port, parity-locked component-by-component against the PyTorch reference: full-UNet
forward rel 1.1e-06 fp32 CPU vs oracle; full 19-step pipeline matches the reference's decoded
image at the VAE's measured fp32 floor; ~4 s per 512Β² inpaint on an M-series GPU in release).
Licenses
- Weights: MIT (per the upstream hustvl/Moebius model card). VAE: MIT (hustvl/PixelHacker repo; SDXL KL-f8 family).
- Reference code: Apache-2.0 (github.com/hustvl/Moebius).
- Fine-tune training data is Places2; see upstream for dataset terms.
Quantized
Model tree for mlx-community/Moebius-Places2-fp16
Base model
hustvl/Moebius