antirez/iris.c
FreeFlux 2 image generation model pure C inference
FreeFree tier
About antirez/iris.c
Iris is a C inference pipeline for generating images from text prompts using open-weight diffusion transformer models. It is implemented entirely in C with zero external dependencies beyond the C standard library, and optionally supports MPS (Apple Silicon) and BLAS acceleration. The tool supports the FLUX.2 model family (4B distilled, 4B base, 9B distilled, 9B base) from Black Forest Labs and the Z-Image-Turbo model from Tongyi-MAI. It provides a command-line interface, model download scripts, and can generate images locally on CPU or GPU.
Key Features
Implemented entirely in C with zero external dependencies
Supports FLUX.2 family (4B distilled, 4B base, 9B distilled, 9B base) and Z-Image-Turbo models
Optional MPS and BLAS acceleration for faster inference
Command-line interface for generating images from text prompts
Includes download scripts (curl and Python) for model weights
Open source under MIT license (inference code), with model licenses varying
Pros & Cons
Pros
- No external dependencies beyond C standard library
- Fast performance on Apple Silicon via MPS backend
- Supports both distilled (few-step) and base (high-quality) model variants
- Lightweight and portable inference code
- Active development with multiple model support
Cons
- Model weights require large downloads (4B ~16GB, 9B ~30GB)
- Non-commercial license applies to 9B models
- Pure C implementation may lack some optimizations of dedicated frameworks
- No built-in GUI; command-line only
Best For
Local text-to-image generation on Apple Silicon or Linux machinesRunning diffusion transformer models without deep learning frameworksEmbedding image generation in lightweight C applicationsExperimenting with FLUX.2 and Z-Image-Turbo model families
FAQ
What models does iris.c support?
Iris supports FLUX.2 Klein models (4B distilled, 4B base, 9B distilled, 9B base) from Black Forest Labs and the Z-Image-Turbo model (6B) from Tongyi-MAI.
How do I build iris.c?
You can build with 'make mps' for Apple Silicon, 'make blas' for Intel Mac/Linux with OpenBLAS, or 'make generic' for a pure C build with no dependencies.
Is iris.c free to use?
The inference code is open source under a permissive license (MIT). However, the 9B models (FLUX.2-klein-9B) have a non-commercial license; the 4B models have a more permissive license.
Does iris.c require a GPU?
No, it can run on CPU using the generic build. For faster performance, MPS (Apple Silicon GPU) or BLAS acceleration is recommended.