mflux  by filipstrand

MLX port of FLUX for local image generation on Macs

Created 1 year ago
1,557 stars

Top 26.8% 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

4 days ago

Responsiveness

1 day

Pull Requests (30d)
12
Issues (30d)
3
Star History
31 stars in the last 30 days

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), Georgios Konstantopoulos Georgios Konstantopoulos(CTO, General Partner at Paradigm), and
2 more.

diffusers-rs by LaurentMazare

0%
572
Rust implementation of the Diffusers API for generative models
Created 2 years ago
Updated 1 year ago
Starred by Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), Rodrigo Nader Rodrigo Nader(Cofounder of Langflow), and
1 more.

DiffSynth-Studio by modelscope

0.9%
10k
Open-source project for diffusion model exploration
Created 1 year ago
Updated 14 hours ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Eric Zhang Eric Zhang(Founding Engineer at Modal), and
13 more.

flux by black-forest-labs

0.2%
24k
Inference code for FLUX image generation & editing models
Created 1 year ago
Updated 1 month ago
Feedback? Help us improve.