Inpainting (MLX)
Collection
Apple-MLX fp16 inpainting / object-removal models (LaMa Apache-2.0 + MI-GAN MIT). Loaded by mlx-lama-swift. • 4 items • Updated • 1
How to use mlx-community/MI-GAN-512-places2-fp16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir MI-GAN-512-places2-fp16 mlx-community/MI-GAN-512-places2-fp16
MI-GAN mobile inpainting, 512 Places2 (fast/on-device tier).
Converted to Apple MLX (-fp16) for Apple-Silicon inference via the
mlx-lama-swift Swift package (the MLXEngine
imageInpaint ModelPackage / Forge Erase capability). From-scratch MLX-Swift architecture port
of Picsart-AI-Research/MI-GAN; parity-locked vs the PyTorch oracle on the CPU stream
(LaMa predicted max_abs 3.2e-5 · MI-GAN 5.5e-5).
// Package.swift → .package(url: "https://github.com/xocialize/mlx-lama-swift", from: "0.1.0")
import LaMa // or MIGAN
let inpainter = try LaMaInpainter.fromPretrained(weightsPath, dtype: .float16)
let filled: CGImage = inpainter(sourceCGImage, mask: maskCGImage) // white mask = remove
Input: image + mask (white = region to remove). Output: filled image at source resolution. Weights license: mit. Port code: MIT.
Quantized