What problem does it solve? Running Flux.2 image generation models locally on Apple Silicon Macs requires a native Swift implementation with careful memory management, since models range from 4B to 32B parameters and can exceed available RAM without quantization. ## Core Features & Use Cases - Text-to-Image and Image-to-Image Generation: Generate images from prompts or transform reference images with configurable strength, supporting Klein 4B, Klein 9B, and Dev 32B models. - On-the-fly Quantization: Reduce transformer memory by 47% (qint8) or 72% (int4) so large models fit on 16-96 GB Macs, with a two-phase loading architecture that never holds the text encoder and transformer in memory simultaneously. - LoRA Support and Training: Load LoRA adapters for style transfer or train custom LoRAs on Apple Silicon with gradient checkpointing and YAML configuration. - Use Case: An iOS/macOS developer adds local image generation to a SwiftUI app by integrating the Flux2Core Swift package, selecting Klein 4B with qint8 quantization to generate 1024x1024 images in about 28 seconds on a 16 GB Mac. ## Quick Start Add the flux-2-swift-mlx Swift package to my project and generate a 1024x1024 image from a text prompt using the Klein 4B model with balanced quantization.