mflux  by filipstrand

MLX port of FLUX for local image generation on Macs

created 11 months ago
1,500 stars

Top 28.1% on sourcepulse

GitHubView on GitHub
Project Summary

MFLUX is a Python library that ports the FLUX text-to-image diffusion models to Apple's MLX framework, enabling local execution on Macs. It targets users who want to leverage powerful image generation models efficiently on Apple Silicon hardware, offering features like quantization for reduced memory usage and faster inference, LoRA support, and various image manipulation tools.

How It Works

MFLUX is a line-by-line port of the Hugging Face Diffusers implementation of FLUX. It prioritizes a minimal and explicit codebase, with network architectures hardcoded and only tokenizers relying on external libraries. This approach aims for readability and efficiency, especially when models are quantized.

Quick Start & Requirements

  • Installation: uv tool install --upgrade mflux or pip install -U mflux.
  • Prerequisites: Python 3.13+ recommended for full compatibility. MLX framework is the core dependency.
  • Model Downloads: Official models (schnell, dev) are ~34GB; quantization significantly reduces this.
  • Docs: https://github.com/filipstrand/mflux

Highlighted Details

  • Supports 3, 4, 6, and 8-bit quantization for significant speedups and memory reduction.
  • Includes Image-to-Image, LoRA (including multi-LoRA), In-Context LoRA, ControlNet (Canny), Fill (inpainting/outpainting), Depth, and Redux tools.
  • Features Dreambooth fine-tuning for creating custom LoRA adapters.
  • Provides benchmarks showing generation times on various M-series Macs.

Maintenance & Community

  • Active development with contributions from various users.
  • Related projects include ComfyUI and WebUI integrations.

Licensing & Compatibility

  • MIT License. Permissive for commercial use and integration into closed-source projects.

Limitations & Caveats

  • Image generation is currently sequential; negative prompts are not supported.
  • LoRA support is limited to the transformer part of the network, and some adapters may not work.
  • ControlNet support is currently Canny-only. Dreambooth training configuration is experimental.
Health Check
Last commit

10 hours ago

Responsiveness

1 day

Pull Requests (30d)
14
Issues (30d)
6
Star History
173 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Sebastian Raschka Sebastian Raschka(Author of Build a Large Language Model From Scratch), and
2 more.

SimpleTuner by bghira

0.6%
2k
Fine-tuning kit for diffusion models
created 2 years ago
updated 3 days ago
Starred by Omar Sanseviero Omar Sanseviero(DevRel at Google DeepMind) and Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers).

sdnext by vladmandic

0.3%
6k
WebUI for AI generative image and video creation
created 2 years ago
updated 21 hours ago
Starred by Max Howell Max Howell(Author of Homebrew) and Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers).

kohya_ss by bmaltais

0.2%
11k
GUI for Stable Diffusion training scripts
created 2 years ago
updated 1 week ago
Feedback? Help us improve.