I created Flux Generator to brings the power of local image generation to Apple Silicon Macs, offering both a standalone UI and seamless integration with Open WebUI. This tool leverages MLX for efficient image generation without requiring an internet connection or API keys.
The tool is available here, please star the repo to make the algorithm work.
Key Features
- 🚀 Fast local image generation on Apple Silicon
- 🎨 Built-in web interface
- 🔌 Open WebUI compatibility
- 📊 Real-time memory usage monitoring
- 🔄 Multiple model options (black-forest-labs Flux schnell/dev, stabilityai sdxl-turbo/stable-diffusion-2-1)
Quick Start
- Install the requirements:
python3.11 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Run the Flux server:
# Local use only (most secure).
Can be used when Open WebUI is running on the same maching:
python3.11 flux_app.py
# For Open WebUI integration running on different machine:
python3.11 flux_app.py --listen-all
– The UI is accessable here http://127.0.0.1:7860 .
– Enter a prompt and click generate button.
– On the first use the model will get downloaded which is about 23 GB in size.
– The downloaded status is visible on the terminal.
– Once the model is downloaded the image generation will start.
Download the model using CLI for better download speed.
# Install the HuggingFace CLI
pip install -U "huggingface_hub[cli]"
# Install hf_transfer for blazingly fast
speeds
pip install hf_transfer
# Login to your HF account
huggingface-cli login
# Now you can download any model with
uncapped speeds
HF_HUB_ENABLE_HF_TRANSFER=1
huggingface-cli download <model-id>
Integration with Open WebUI
To use Flux Generator with Open WebUI:
- Start Flux server with network access:
./run_flux.sh
- Run Open WebUI container:
docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-e AUTOMATIC1111_BASE_URL=http://host.docker.internal:7860/ \
-e ENABLE_IMAGE_GENERATION=True \
-v open-webui:/app/backend/data \
--name open-webui \
ghcr.io/open-webui/open-webui:main
- Access Open WebUI at
http://localhost:3000

Add the Base URL http://host.docker.internal:7860
If running Open WebUI directly without docker then use following base URL http://127.0.0.1:7860

The connection works like this:
Open WebUI (Docker) -> host.docker.internal:7860 -> Flux API (Host)
Model Options
- Flux Schnell
- Fast generation (2 steps)
- Good for rapid prototyping
- Default choice for quick results
- Flux Dev
- Higher quality (50 steps)
- Better for final images
- More resource intensive
Two new Stable Diffusion Models recently added
SD 2.1 Base
SDXL Turbo
Generation Parameters
- Width/Height: 256-1024px (must be divisible by 64)
- Steps: 1-100 (default: 2 for schnell, 50 for dev)
- Guidance Scale: 1-20 (default: 4.0)
- Seed: Optional for reproducible results
Resource Usage
The tool provides real-time memory monitoring:
- Text Encoding: ~9GB
- Image Generation: ~30GB
- Decoding: ~27GB
Ensure your Mac has sufficient memory for optimal performance.
Security Notes
- Local mode (
./run_flux.sh) is most secure - Network mode (
./run_flux.sh --network) listens to all IPs and is less secure - Use network mode only in trusted environments
Benefits
- No internet required after initial model download
- No API keys or subscriptions needed
- Full control over generation parameters
- Native Apple Silicon optimization
- Real-time performance monitoring
Requirements
- Apple Silicon Mac (M1/M2/M3)
- macOS
- Python 3.10+
- MLX framework
Whether you prefer the clean, built-in UI or the powerful Open WebUI interface, Flux Generator provides a robust solution for local image generation on Apple Silicon Macs.
Akash Gupta
Senior VoIP Engineer and AI Enthusiast

AI and VoIP Blog
Thank you for visiting the Blog. Hit the subscribe button to receive the next post right in your inbox. If you find this article helpful don't forget to share your feedback in the comments and hit the like button. This will helps in knowing what topics resonate with you, allowing me to create more that keeps you informed.
Thank you for reading, and stay tuned for more insights and guides!

Leave a Reply