mflux

mflux-communityMIT活跃维护

在 Apple Silicon 上用 MLX 原生跑 FLUX、Qwen-Image 等前沿图像与视频生成模型,省去 PyTorch 依赖,让 Mac 本地出图更顺畅。

Apple MLX native implementations of state-of-the-art generative image & video models

v.0.24.0发布于 2026-10-27 02:53 UTC2,593star +12 / 7 天206fork同步于 2026-11-10 23:44 UTC

怎么上手

由 README 提炼,执行前请确认
uv tool install --upgrade mflux
mflux-generate-z-image-turbo --prompt "A puffin standing on a cliff" --width 1280 --height 500 --seed 42 --steps 9 -q 8
硬件要求按 README 说明

README 未给出具体显存要求;面向 Mac 本地运行,基于 Apple MLX,另附 DGX/NVIDIA 的安装说明。

支持 Apple Silicon需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在 Mac 上用原生 MLX 本地跑各类前沿生成式图像模型的工具

在 Apple Silicon 上用 MLX 原生跑 FLUX、Qwen-Image 等前沿图像与视频生成模型,省去 PyTorch 依赖,让 Mac 本地出图更顺畅。

核心能力

  • 用 MLX 从零逐行重写 Diffusers/Transformers 模型
  • 支持 Z-Image、FLUX.2、Qwen Image 等十余个模型家族
  • 提供 CLI 命令与 Python API 两种调用方式
  • 支持量化(如 -q 8)降低显存占用
  • 通过 mflux.web 命名空间可扩展第三方 UI

容易踩的坑

首次运行会自动下载模型,耗时较长;若启用 hf_transfer 但未安装该包会报错,需用 uv tool install --upgrade mflux --with hf_transfer 安装;不同模型有各自的步数与 CFG 用法,需查阅对应模型 README。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v.0.24.0
  1. v.0.24.0Release 0.24.0最新正式版2026-10-27 · 2026-10-27 02:53 UTC

    0.24.0

    Security

    • Pillow 13.0.0 or newer is now required. It fixes a critical heap overflow in FlashPix JPEG decoding (GHSA-5x8w-8jj5-q52h) and other advisories. (#935)
    • MFlux now requires Pillow 13 and Python 3.11 or newer. Python 3.10 is no longer supported. Upgrade to Python 3.11 or newer to install this version. (#933)
    • mflux commands no longer crash at startup with Pillow 13 (ImportError: cannot import name '_IntegralLike' from 'numbers'). (#890)

    New models

    • New model: FIBO 2 from Bria (Fibo 2.0 Dev and Fibo 2.0 Edit Turbo) with mflux-generate-fibo2 and mflux-generate-fibo2-edit. Text-to-image from JSON captions or short descriptions, editing of one to five images with optional masks, rendered text, LoRA and quantization. (#924)
    • New model: Anima from circlestone-labs (Turbo, Aesthetic and Base) with mflux-generate-anima. It loads the ComfyUI files of circlestone-labs/Anima and supports kohya LoRAs, -q 4 to 8, --compute-precision float16 and mflux-save. (#931)
    • New model: MOSS-Image-SFT from OpenMOSS, with mflux-generate-moss-image. It runs fully in MLX, including its Qwen3.5-9B text encoder, and supports quantization and mflux-save. (#914)
    • mflux-generate-iris runs Iris-3B, a 3B text-to-image model that generates the pixels directly (no VAE): Turbo in 4 steps (--model iris-3b, the default) and the base model (--model iris-3b-base). (#899)

    Improved

    • FIBO 2: mflux-generate-fibo2 also runs Edit Turbo, and both FIBO 2 commands take --expand-prompt (writes the JSON caption with FIBO-vlm), --cfg-end and --step-cache-ratio, check a JSON caption before the model loads and decode the VAE in low-memory strips. (#934)
    • mflux-generate-moss-image now takes --lora and keeps LoRAs as runtime layers, so step-distilled LoRAs keep all of their update. --model moss-image-base runs MOSS-Image-Base. (#929)
    • mflux-generate-qwen-2.1 and mflux-generate-qwen-2.1-edit have a new --small-text-encoder flag. It uses Qwen3.5-0.8B and the zen-image-edit adapter instead of Qwen3-VL-8B, and downloads about 2.1 GB instead of 17.5 GB. (#906)
    • FLUX 3, FLUX.2 Klein, ERNIE-Image, Z-Image, Lens and Ideogram 4 now decode the VAE in bf16 row strips. The decode needs approximately 1.6 GB at 1024×1024 instead of 7–14 GB. --vae-tiling no longer shifts the colours. --vae-full-precision uses the earlier full-image decode. (#910)
    • mflux-generate-flux2 and mflux-generate-flux2-edit have a new --small-text-encoder flag for FLUX.2-klein-4B. It uses Qwen3-0.6B and an adapter instead of the 4B text encoder, so the model needs less memory. (#896)
    • mflux-generate-flux2 and mflux-generate-flux2-edit have a new --small-decoder flag. It decodes FLUX.2 klein images with the small VAE decoder from Black Forest Labs, which is faster and needs less memory. (#897)
    • mflux-save --hf-symlink [USERNAME] adds a Hugging Face cache entry that links to the saved files, so --model USERNAME/<folder> loads the saved model by repo id. Super simple mflux-save --model Qwen/Qwen-Image-2.1 -q 5 now works with auto-naming - requires env var MFLUX_MODELS_DIR (#903)
    • Published mflux-community FLUX 3 repos now resolve by name alone: added hyphenated aliases (flux-3-image-klein, flux-3-image-klein-base) so repo names infer the correct base model instead of raising "Cannot infer base_model". (#909)

    Fixed

    • Saved Krea 2 checkpoints on Hugging Face, like the mflux-community/krea-2-* repos, now load by repo id; they downloaded without their transformer and failed. A file passed as --model now gets an error that says so on Krea 2, FLUX, FLUX.2 and Z-Image. (#873)
    • FLUX.2 klein: --config-from-metadata no longer turns on the small text encoder when a sidecar records "small_text_encoder" as a string such as "false"; it reports an error instead. (#905)
    • Fix the Z-Image ControlNet mlsd preprocessor crashing on OpenCV 5, and allow opencv-python 5. (#901)

    Changed

    • mflux-check validates local MFlux and Safet
  2. v.0.23.0Release 0.23.02026-10-16 · 2026-10-16 12:20 UTC
    查看更新说明

    0.23.0

    New

    • mflux-generate-flux3 and mflux-generate-flux3-edit now run FLUX 3 Image Klein (distilled and Base), with text-to-image, editing with up to ten reference images, and 4, 6 and 8 bit quantization. (#878)
    • mflux-generate-flux3 and mflux-generate-flux3-edit now load FLUX 3 Image Klein LoRAs with --lora, in the ComfyUI/ai-toolkit (BFL), diffusers/PEFT and kohya key formats. (#881)
    • mflux-generate-qwen-2.1, -edit and -controlnet now run Qwen-Image-2.1-Turbo in 8 steps (--model qwen-image-2.1-turbo). mflux-save now writes one Qwen-Image-2.1 checkpoint that both the text-to-image and edit commands load. (#859)
    • New command mflux-generate-krea2-controlnet: Krea 2 Turbo with a depth ControlNet. Give it a photo (Depth Pro estimates the depth) or a ready-made depth map. LoRAs and -q work as in mflux-generate-krea2. (#864)

    Improved

    • Built-in models now load from a pinned HuggingFace commit, so every install runs the same weights. A model cached from another commit needs one online run to switch; the weights already on disk are reused. (#872)
    • Qwen Image 2.1’s fused attention prologue now handles strided projections and preserves MLX RMSNorm precision and rounding while producing the attention layout directly. Generated pixels may differ from the previous fused implementation; unsupported configurations retain the composed path. (#846)
    • Qwen Image 2.1 packs compatible dense attention and feed-forward projections during generation, reducing projection overhead while preserving checkpoint compatibility. Quantized and adapter-bearing projections retain their original path. (#847)

    Changed

    • Image saving now fails the run when the output file cannot be written (permission error, full disk, missing volume) instead of logging the error and exiting 0. (#861)

    Docs

    • The Qwen-Image-2.1 README now documents mflux-generate-qwen-2.1-controlnet: control types, Turbo, inpainting with a mask, and how to size the control image. (#880)
    • The README entry for mlx-teacache now names the models where it skips steps: FLUX.1 dev and Krea, FLUX.2 Klein base, Z-Image base and Qwen-Image (original checkpoint). (#855)
    • docs/plugins.md tells how to find, install and write a plugin that adds commands under mflux.extras. The README links to it. (#856)

    Internal

    • The new /mflux-pr-docs agent skill writes the PR body and the release note for the developer to approve. Update skills for Claude Code, Cursor & GitHub Copilot in .claude/skills/. (#837)
    • /mflux-pr-docs now passes a developer-approved title to gh pr create, so it works from Claude Code. An open PR keeps its title unless the developer changes it. (#854)
    • Golden test references regenerated for Krea 2, Qwen-Image, Qwen-Image-2.1, FIBO lite and ERNIE-Image, and the golden test helper fixed for FIBO Edit and HuggingFace LoRA ids. Generated images don't change. (#871)
  3. v.0.22.0Release 0.22.02026-10-08 · 2026-10-08 11:03 UTC
    查看更新说明

    0.22.0

    Improved

    • mflux-generate-krea2, mflux-generate-lens, mflux-generate-boogu and mflux-generate-ideogram4 now expose validate, load and generate for Python callers. (#821)
    • mflux-generate-qwen and mflux-generate-qwen-edit now expose validate, load and generate for Python callers, and stop with an error when --model names another model instead of ignoring it. (#836)

    Fixed

    • mflux-generate-z-image and mflux-generate-ernie-image now keep a scheduler given as --scheduler=NAME. Before, that spelling was replaced by the command's default scheduler. (#849)

    Changed

    • Z-Image runs its transformer in bfloat16 instead of float32. Denoising is about 30% faster on an M5, and images for the same seed change slightly. Add --float32 to reproduce an image from an older release. (#803)
    • Z-Image now writes a warning when a prompt fills the 512-token limit. Before, the model ignored the extra text with no message. (#810)
    • LoRA training: a new adapter now starts with lora_B at zero, so step 0 is the base model. Before, each new adapter added a random change to every patched layer, which caused a grid pattern in the step-0 preview. (#811)
    • FLUX.2 klein, Z-Image and Qwen-Image 2.1 take a new opt-in --compute-precision float16 (compute_precision=mx.float16 in Python) that runs only the attention and feed-forward layers in float16. On an M1 Max it made each step 8–35% faster and a whole generation 7–29% faster, at the same peak memory; the image for a given seed changes slightly. It is off by default. (#820)
    • Update urllib3 to 2.8.0 or later to fix HTTPS proxy TLS and streamed-response denial-of-service vulnerabilities. (#822)
    • A LoRA baked into a model quantized at load (-q) on FLUX, FLUX.2, Qwen-Image, Krea 2 and Z-Image now has the same effect as the live adapter. It used to lose part of it, about 20% for a weak LoRA at scale 0.5 on q8. Layers below 8 bits keep their bits instead of being re-quantized at q8. (#824)
    • Loading a SeedVR2 model saved with mflux-save no longer warns that the folder "contains no files matching" the original file names. (#828)
    • Add Schedulers documentation (#829)
    • mflux-generate-qwen-2.1 and mflux-generate-qwen-2.1-edit no longer read every weight into memory at load. For an 8-bit model at 512x512 the peak drops from about 24 GB to about 13 GB, and --low-ram brings it to about 8 GB again in most runs. (#833)
    • mflux-generate-qwen-2.1-edit --scheduler now reaches the edit (it was checked, then ignored), and --enhance-prompt rewrites with every reference image instead of only the first. QwenImage21Edit gains rewrite_prompt() and a scheduler argument, and takes PIL images in image_paths. Both Qwen-Image-2.1 commands record a scheduler other than linear, so --config-from-conf replays it. (#835)
    • Require fsspec 2026.6.0 or later, which fixes a code execution vulnerability in its ReferenceFileSystem (GHSA-27vj-qcqg-25rc). mflux doesn't use fsspec directly. (#838)
    • FLUX.1, FIBO and Qwen-Image load the bias of their last normalization layer again. mflux 0.16.0 to 0.21.0 dropped it, so their images change: slightly for FLUX.1, visibly for Qwen-Image. A model saved with those versions generates as before; save it again from the original weights to include the bias. (#839)
    • New command mflux-generate-qwen-2.1-controlnet: Qwen-Image-2.1 with Alibaba's Fun ControlNet Union. One checkpoint takes Canny, depth, pose and five more kinds of control image, and inpaints through the same branch with --image-path and --mask-image. (#842)
    • The Qwen-Image-2.1 edit's step cache no longer skips steps in runs under 10 steps, such as the 6-step viggle_turbo schedule, where skipping changed the image noticeably. Baking a LoRA now warns when the baked weights hold less than 90% of its update, and suggests --no-bake-lora. (#843)
    • Qwen-Image-Edit-2511 runs as itself: mflux-generate-qwen-edit --model qwen-image-edit-2511 (or qwen-edit-2511) loa
  4. v.0.21.0Release 0.21.02026-10-03 · 2026-10-03 19:24 UTC
    查看更新说明

    0.21.0

    Added

    • Qwen-Image-2.1 now supports instruction-based editing with up to ten reference images, RGBA output, and prefix KV caching through mflux-generate-qwen-2.1-edit. The new QwenImage21Edit Python API can quantize and export complete vision-capable checkpoints; the existing generation command and text-only exports remain available. (#741)
    • Logging is now configured at CLI boot; use --verbose to make it more verbose. (#747)
    • Qwen-Image-2.1 edit: new --mask-image, --auto-mask, --strength, --enhance-prompt, --verify and --use-step-cache options for mflux-generate-qwen-2.1-edit. They give masked edits, automatic object masks, subtler edits, prompt rewrite, a self-check with retries, and faster runs. (#749)
    • Added Qwen Image 2.1 LoRA support for PEFT .default adapters via --lora. (#756)
    • Qwen-Image-2.1: new --scheduler viggle_turbo for mflux-generate-qwen-2.1 and mflux-generate-qwen-2.1-edit. With Viggle's distilled turbo LoRA and --steps 6, it generates and edits in 6 steps instead of 40. (#764)
    • New model: inclusionAI Ming-Image-0.1-Design (mflux-generate-ming), a design-focused text-to-image model with RGBA output; its 16B MoE text encoder can be quantized separately with --text-encoder-quantize. (#765)
    • Qwen Image 2.1 now accepts common transformer. and diffusion_model. LoRA exports, including fused gate_up weights and modulation/timestep embedding adapters. (#768)
    • Z-Image now loads ComfyUI LoRAs with fused QKV projections and normalization/bias deltas. Adapters containing direct deltas require the default baked inference mode. (#772)
    • Support independently installed mflux namespace extensions, enabling community mflux.web UI packages to coexist across editable checkouts and separate import directories. (#776)
    • Qwen-Image-2.1 reference editing now supports LoRA adapters through the same mappings as text-to-image, including baking controls and metadata replay. Both commands share the Transformer core and component-loading mechanism while retaining compatibility with existing model exports. (#777)
    • mflux-generate-z-image-turbo now exposes ZImageTurboCommand.load and ZImageTurboCommand.generate, so Python code can load the model once and generate many images with the command's own flag handling. (#780)
    • mflux-generate-z-image and mflux-generate-z-image-controlnet now expose load and generate for Python callers, and all three Z-Image commands add validate, which checks a request without loading weights. (#785)
    • mflux-save can now save the SeedVR2 3B and 7B upscalers. mflux-upscale-seedvr2 --model <dir> reads the variant from the saved weights. (#800)
    • mflux-generate-ernie-image-turbo and mflux-generate-ernie-image now expose validate, load and generate for Python callers. (#815)

    Improved

    • Qwen-Image-2.1 generates up to ~1.8x faster: denoise steps run ~12% faster (cached text prefix, bounded to the two most recent embeddings; fused Q/K norm+rope Metal kernel, disable with MFLUX_QWEN21_DISABLE_FUSED_PROLOGUE=1), and generate_image(..., teacache_ratio=0.25) reuses the previous noise on the least-changing steps for a further 1.4x (1.77x at 0.4). (#778)
    • Qwen Image 2.1's step reuse is now --step-cache-ratio (--teacache-ratio still works) and the ratio is recorded in image metadata and replayed by --config-from-conf. The logic is shared (mflux.models.common.step_cache.StepCache) so other models can adopt it. (#779)
    • MFlux now imports OpenCV and PyTorch only in the code paths that use them. Commands that do not use these libraries start without them. (#787)
    • LoRA and LoKr adapters now run in the precision the model was loaded in, not float32. Training and LoRA inference on bfloat16 models use less memory and run faster. (#801)

    Fixed

    • bump anyio due to CVE-2026-63374 & CVE-2026-64847. MFlux doesn't import it directly - it is used transitively by httpx through huggingface-hub (#744)
    • mflux now refuses a checkpoint whose wei
  5. v.0.20.0Release 0.20.02026-09-21 · 2026-09-21 17:31 UTC
    查看更新说明

    0.20.0

    Changed

    • Fix Z-Image producing a different image for the same seed when other code (a preview callback, another library) had run the model earlier in the same process. (#715)
    • mflux-generate-lens --low-ram no longer crashes with an AttributeError after the model has loaded. (#725)
    • In-loop callbacks can opt in to the model's per-step predicted image: declare a denoised parameter in call_in_loop and Krea 2 passes it alongside the noisy latents. Callbacks with the existing signature are unaffected; other models pass nothing yet. (#729)
    • The mflux_version recorded in image metadata and training checkpoints is mflux's own version again when mflux is installed as a dependency of another project; it used to report the host project's version. (#728) (#732)
    • mflux-generate-z-image-controlnet: --controlnet-strength now defaults to 1.0, so the strength given in each --control spec is the scale the model sees (it used to be multiplied by 0.4, and a 0.85 control ran at 0.34, too weak to follow the hint). The Z-Image README now documents the ControlNet command. (#721) (#733)
    • --vae-tiling and --low-ram now tile the final VAE decode on Krea 2 and Boogu, where the flag was accepted and ignored, cutting the decode at 1024 px from about 7 GB to about 3 GB. FLUX.2 Klein, Klein edit, Lens and Ideogram 4 tile only when you ask with --vae-tiling: their shared decoder takes its normalisation statistics per tile, which shifts colour between tiles, so low-RAM leaves them untiled. (#735)
    • New model: Qwen-Image-2.1 (Qwen/Qwen-Image-2.1) — 7.1B single-stream block-causal DiT with a Qwen3-VL text encoder and a 64-channel causal VAE. Available as mflux-generate-qwen-2.1 with txt2img, img2img, optional true CFG, and -q 8/-q 4 quantization (text encoder stays bf16). 40-step guidance-free sampling by default. (#736)
    • n/a for version bump PRs (#738)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    image

    MFLUX MLX CI Greptile: The War on Bugs

    About

    Run the latest state-of-the-art generative image models locally on your Mac in native MLX!

    Table of contents


    💡 Philosophy

    MFLUX is a line-by-line MLX port of several state-of-the-art generative image models from the Huggingface Diffusers and Huggingface Transformers libraries. All models are implemented from scratch in MLX, using only tokenizers from the Huggingface Transformers library. MFLUX is purposefully kept minimal and explicit, @karpathy style.


    💿 Installation

    If you haven't already, install uv, then run:

    uv tool install --upgrade mflux
    

    After installation, the following command shows all available MFLUX CLI commands:

    uv tool list 
    

    To generate your first image using, for example, the z-image-turbo model, run

    mflux-generate-z-image-turbo \
      --prompt "A puffin standing on a cliff" \
      --width 1280 \
      --height 500 \
      --seed 42 \
      --steps 9 \
      -q 8
    

    Puffin

    The first time you run this, the model will automatically download which can take some time. See the model section for the different options and features, and the common README for shared CLI patterns and examples.

    Create a standalone generate.py script with inline uv dependencies:

    #!/usr/bin/env -S uv run --script
    # /// script
    # requires-python = ">=3.11"
    # dependencies = [
    #   "mflux",
    # ]
    # ///
    from mflux.models.z_image import ZImageTurbo
    
    model = ZImageTurbo(quantize=8)
    image = model.generate_image(
        prompt="A puffin standing on a cliff",
        seed=42,
        num_inference_steps=9,
        width=1280,
        height=500,
    )
    image.save("puffin.png")
    

    Run it with:

    uv run generate.py
    

    For more Python API inspiration, look at the CLI entry points for the respective models.

    If you encounter a ValueError: Fast download using 'hf_transfer' is enabled (HF_HUB_ENABLE_HF_TRANSFER=1) but 'hf_transfer' package is not available, you can install MFLUX with the hf_transfer package included:

    uv tool install --upgrade mflux --with hf_transfer
    

    This will enable faster model downloads from Hugging Face.

    uv tool install --python 3.13 mflux
    

    🎨 Models

    MFLUX supports the following model families. They have different strengths and weaknesses; see each model’s README for full usage details.

    ModelRelease dateSizeTypeTrainingDescription
    Z-ImageNov 20256BDistilled & BaseYesFast, small, very good quality and realism.
    Krea 2Jun 202612BTurbo (distilled)YesVery good quality with a wide range of styles; good for creative exploration.
    FLUX.2Jan 20264B & 9BDistilled & BaseYesFastest + smallest with very good quality and edit capabilities.
    FLUX 3 Image KleinOct 20265.6B (+4B TE)Distilled & BaseNoText-to-image and editing with up to 10 reference images in one model; bounding-box layouts, strong text rendering. 16 steps distilled, 50 steps Base.
    Iris-3BOct 20263B (+4B TE)Turbo (distilled) & BaseYesPixel-space diffusion transformer: no VAE, direct RGB generation. 4 steps Turbo, 100 steps base.
    Ideogram 4Jun 20269BBaseNoJSON-caption-native, typography-focused text-to-image generation.
    ERNIE-ImageApr 20268BDistilled & BaseYesSingle-stream DiT from Baidu. Vivid, high-contrast output.
    LensMay 20263.8B (+20B TE)Turbo (distilled)NoDual-stream MMDiT from Microsoft with a GPT-OSS text encoder. Strong prompt adherence in 4 steps.
    Ming-ImageSep 20266.15B (+16B MoE TE)BaseNoDesign-focused (posters, cards, UI) with strong typography; outputs RGBA.
    MOSS-ImageOct 20264.9B (+9B TE)SFT & BaseNoSingle-stream DiT from OpenMOSS with a Qwen3.5 text encoder. Takes natural-language, tag and JSON-layout prompts. Renders English and Chinese text. 50 steps with CFG, or 8 or 4 steps with a community step-distilled LoRA.
    AnimaJan 20262B (+0.6B TE)Turbo (distilled), Aesthetic & BaseYesAnime and illustration model from CircleStone Labs and Comfy Org on Cosmos-Predict2, with a Qwen3 text encoder. Danbooru tags and natural language. 10 steps Turbo, 30 steps with CFG for Aesthetic and Base.
    Boogu ImageJun 202610BTurbo (distilled)NoDMD-distilled 4-step model with a photographic look and bilingual (EN/ZH) text rendering.
    FIBO 2Oct 20268.1B (+4B TE)Base & Edit Turbo (distilled)YesTrained on long structured JSON captions for precise control; renders text. Text-to-image and editing of 1 to 5 images, with masks. 50 steps with CFG; Edit Turbo runs 4 without.
    SeedVR2Jun 20253B & 7B—NoBest upscaling model.
    Qwen ImageAug 2025+20BBaseNoLarge model (slower); strong prompt understanding and world knowledge. Has edit capabilities
    Qwen Image 2.1Sep 2026+7.1B (+8B TE)Distilled & BaseYesSingle-stream block-causal DiT with a Qwen3-VL text encoder. Base: 40 steps without guidance. Turbo: 8 steps. Multi-reference editing, LoRA, and RGBA.
    Depth ProOct 2024——NoVery fast and accurate depth estimation model from Apple.
    FIBOOct 2025+8BDistilled & BaseNoLegacy option, superseded by FIBO 2. JSON-based prompt understanding and edit capabilities.
    FLUX.1Aug 202412BDistilled & BaseNo (legacy)Legacy option with decent quality. Has edit capabilities with 'Kontext' model and upscaling support via ControlNet

    Schedulers MFlux supports a small number of schedulers - see; Schedulers - User Manual Schedulers - Technical Overview


    ✨ Features

    General

    • Quantization and local model loading
    • LoRA support (multi-LoRA, scales, library lookup), including LyCORIS LoKr on FLUX.1 and FLUX.2
    • Metadata export + reuse, plus prompt file support
    • Float16 compute for Apple M1-family GPUs on FLUX.2, FLUX 3 Image Klein, Z-Image, Qwen-Image 2.1 and Anima (--compute-precision float16, see the common README)

    Model-specific highlights

    • Text-to-image and image-to-image generation.
    • LoRA finetuning
    • In-context editing, multi-image editing, and virtual try-on
    • ControlNet (Canny for FLUX.1, Union for Z-Image and Qwen-Image-2.1, depth for Krea 2), depth conditioning, fill/inpainting, and Redux
    • Upscaling (SeedVR2 and Flux ControlNet)
    • Depth map extraction and FIBO prompt tooling (VLM inspire/refine)

    See the common README for detailed usage and examples, and use the model section above to browse specific models and capabilities.

    [!NOTE] As MFLUX supports a wide variety of CLI tools and options, the easiest way to navigate the CLI in 2026 is to use a coding agent (like Cursor, Claude Code, or similar). Ask questions like: “Can you help me generate an image using z-image?”


    🦄 Contributors

    MFlux was originally created by Filip Strand in August 2024 and moved to this organisation in August 2026. It is maintained by:

    Where the models and the main features came from, read from the merge history (gh pr view <n> --json author,mergedAt):

    Model or featureContributorPR
    FLUX.1@filipstrandinitial release, 2024-08
    Depth Pro@filipstrand#159
    Qwen Image@filipstrand#269
    FIBO@filipstrand#279
    FIBO 2@filipstrand—
    Z-Image@filipstrand#284
    SeedVR2@filipstrand#297
    FLUX.2 Klein@filipstrand#323
    FLUX 3 Image Klein@cguldogan#876
    Iris-3B@cguldogan#898
    FLUX.2 KV cache (klein-9b-kv)@michaeltrefry#426
    ERNIE-Image@azrahello#417
    Ideogram 4@omercelik#433
    Krea 2@plz12345#453
    LyCORIS LoKr adapters@JanGrohn#422
    Fused-qkv LoRA loading@deadmansahil#459
    Boogu-Image@plz12345#446
    MOSS-Image@vanch007#895
    Anima@fxd0h#931
    PiD pixel-diffusion decoder@azrahello#490
    Z-Image Union ControlNet@fxd0h#482
    Krea 2 Raw, LoRA training, diffusers loading@fxd0h#462
    Lens (Turbo)@fxd0h#510
    mflux-capabilities, the machine-readable option contract@fxd0h#499
    Gradient checkpointing for training@qruz-hq#711
    Denoised prediction for in-loop callbacks@IonDen#729
    Qwen-Image-2.1@ivanfioravanti#736
    Qwen-Image-2.1 reference editing, RGBA, prefix cache@dreampuf#741, #777
    Qwen-Image-2.1 masks, auto-mask, strength, verify@flyingtimes#749, #764
    PEFT and ComfyUI LoRA formats (Qwen 2.1, Z-Image)@phplego#756, #768, #772
    Text-prefix KV cache, Metal kernel, step cache@murphymatt#778, #779
    Ming-Image-0.1-Design@joeynyc#765
    load and generate entry points for UIs@IonDen#780, #785
    mflux.web UI packages@anthonywu#776
    CI gates, justfile, ty, the pypi environment@anthonywu#576, #590, #646
    Release process and release notes@fxd0h#685
    test_tiny fixtures for every model@ianscrivener, @anthonywu#611, #620, #599

    Everyone else who fixed, tested and reviewed is in the contributor graph.


    🌱 Related projects

    Build a UI under mflux.web

    We welcome independently distributed mflux.web.* implementations using Gradio, FastAPI, FastHTML, or any other UI framework. Each project can choose its own framework, dependencies, release schedule, and launch command.

    mflux owns the parent initializer and inference implementation. Its package path extends across installed distributions, including separate editable checkouts. mflux.web is an implicit namespace package: Python combines the mflux/web/ directories contributed by independently installed UI packages. No intermediate distribution is required; neither core nor UI packages need to depend on mflux-web. The mflux-web distribution reserves the generic mflux-web name on PyPI; it does not provide the shared namespace and does not need to be installed. Its optional demo is just another child module, mflux.web.demo.

    Your UI distribution owns a unique child, for example src/mflux/web/example_ui/__init__.py. With uv_build, configure module-name = "mflux.web.example_ui". Declare mflux and your chosen framework as dependencies with versions your UI supports. The minimum mflux version for split-directory installs must include this parent path extension.

    Do not ship mflux/__init__.py, which belongs to core, or mflux/web/__init__.py, which must remain absent for the implicit namespace. Choose a unique child name to avoid collisions. PyPI distribution names can use hyphens; Python child names must be valid identifiers, such as example_ui. Reserving a PyPI distribution name does not reserve a Python namespace.

    After installation in the same environment, consumers can use import mflux.web.example_ui. Installing a UI does not automatically launch it, discover applications, or mount routes. UI framework dependencies belong to the individual UI distributions; this namespace support adds none to mflux.

    Extras under mflux.extras

    Plugins are optional packages that install next to mflux, put their code under mflux.extras and add their own commands. mflux's own commands do not change. The mflux-community plugins live in mflux-plugins. To find, install or write one, see Plugins - User Manual.

    Community applications

    🙏 Acknowledgements

    MFLUX would not be possible without the great work of:


    ⚖️ License

    This project is licensed under the MIT License.