Instructions to use mlx-community/GFPGANv1.4-fp32 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/GFPGANv1.4-fp32 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir GFPGANv1.4-fp32 mlx-community/GFPGANv1.4-fp32
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
GFPGANv1.4-fp32 (MLX)
GFPGAN v1.4 blind face restoration converted to MLX
NHWC safetensors for Apple Silicon. 87,143,276 parameters (params_ema), fp32.
- Architecture:
GFPGANv1Cleanโ degradation-removal U-Net + StyleGAN2 (clean) decoder with channel-split SFT. 512ร512 aligned face crops, RGB in [-1, 1]. - Layout: MLX NHWC. Conv
(O,kH,kW,I); the 5-D modulated-conv kernels(1,O,kH,kW,I); every other 4-D tensor (biases, stored noise buffers, constant input) takes the same(0,2,3,1)transpose. Keys mirror the upstream state dict exactly. - Noise: the checkpoint's stored noise buffers ship in the file (
randomize_noise=Falseis the deterministic parity mode). - dtype: fp32. fp16 is DISQUALIFIED โ the e2e gate collapses (cosine โ โ0.3, PSNR 8 dB); bf16 gates clean at 48 dB if you need it, but restoration ships fp32 here.
License
Apache-2.0. The upstream repo carries third-party carve-outs (NVIDIA StyleGAN2,
DFDNet) that do NOT touch this artifact: the clean architecture contains no NVIDIA-derived
code, and the v1.4 decoder prior was trained from scratch by BasicSR
(StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth, Apache-2.0), not from NVIDIA's FFHQ
weights. Trained on FFHQ (dataset compilation CC-BY-NC-SA โ the standard unsettled
dataset-to-weights question that applies to every face model).
Consume
Swift (Apple Silicon): mlx-gfpgan-swift โ GFPGANMLXCore.GFPGANv1Clean +
MLXGFPGAN.GFPGANRestorePackage (MLXEngine imageRestore, Vision-based detect/align/paste).
Converted with oracle/convert.py in that repo; parity vs the PyTorch reference:
key contract 285/285 tensors, per-stage taps 94/94 โค 5e-4 relative (fp32, CPU stream).
Quantized