icakinser/mlx-flux2-swift — explained in plain English
Analysis updated 2026-05-18
Generate images from text prompts on Apple Silicon Macs without Python.
Edit existing images with mask-guided tools to change or remove specific regions.
Extend images beyond their borders using outpainting.
Add image generation and editing to your own Swift apps with the Flux2Kit library.
| icakinser/mlx-flux2-swift | bsnkhua/mole-widget | eeliberto/reset-macos | |
|---|---|---|---|
| Stars | 26 | 26 | 26 |
| Language | Swift | Swift | Swift |
| Setup difficulty | hard | easy | easy |
| Complexity | 4/5 | 2/5 | 2/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires an Apple Silicon Mac, macOS 26+, Xcode toolchain, a helper script to compile Metal shaders, and separately downloading roughly 15 GB of model weights from Hugging Face.
This repository brings the FLUX.2 [klein] image generation model to Apple Silicon Macs using Swift and Apple's MLX framework. The usual way to run FLUX involves Python, but this project rebuilds it entirely in Swift so it runs natively on Apple hardware with no Python runtime involved. It was adapted from an existing MLX-based reference project and checked to produce matching image outputs at the same random seed. The project covers several image tasks. It can generate images from text prompts, modify existing images, and do mask-guided editing where you specify a region to change or remove. It also supports outpainting, which extends an image beyond its original borders. Beyond the model-based features, it includes a set of instant image operations that need no model at all: resizing, cropping, color adjustments, blur, sharpen, sepia, and similar effects that run in roughly 50 milliseconds. Memory usage was a clear focus. A set of opt-in options for quantization and staged loading brings peak memory down from about 12.6 GB to roughly 1.65 GB, which matters because the model weights themselves are large. The weights are not bundled in the repository. You download them separately from Hugging Face, where the FLUX.2 model snapshot is roughly 15 GB. The README walks through pointing the tools at wherever you store those files. Running the generation features requires an Apple Silicon Mac, macOS 26 or newer, and the full Xcode toolchain because a compiled Metal shader library is needed for GPU operations. The README notes that swift build alone does not produce this shader file, so a helper script must be run afterward. The instant image operations and some tests are CPU-only and skip that requirement. The repository also provides a Swift library called Flux2Kit for developers who want to build image features into their own Swift packages, along with a sample project and ComfyUI integration nodes for graphical workflows. The full README is longer than what was shown.
Run the FLUX.2 image generation model natively on Apple Silicon Macs using Swift. Generate, edit, and modify images without Python.
Mainly Swift. The stack also includes Swift, MLX, Metal.
The license for this repository is not specified in the available information.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.