Repository navigation
Run Qwen-Image 2.1 from its DFloat11 checkpoint - #15
Merged
Merged
Conversation
…ded block indices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds Qwen-Image 2.1 to
mlx-dfloat generateand the Python API (DFloatModel("qwen-image-2.1")). It runs from the DFloat11 checkpointmingyi456/Qwen-Image-2.1-DF11-ComfyUI. That checkpoint is a single ComfyUI file with noconfig.json. The reader added in #13 opens it through a layout pinned to that file's revision.Qwen-Image 2.1 reuses the per-block hook from Z-Image: each of the 32 blocks gets its decoded weights just before it runs. mflux compiles the denoising step, so this path runs it uncompiled, and the per-block evaluation can't happen inside a compiled function. The defaults are mflux's own: 40 steps, guidance 1.0 and the
linearscheduler. Classifier-free guidance needs both a guidance above 1.0 and a negative prompt, as in mflux, and the command warns when one comes without the other. The text encoder, VAE and tokenizer come fromQwen/Qwen-Image-2.1, pinned to the revision the measured runs used. Only the tokenizer files are downloaded, not the whole processor folder.Evidence, measured on an M1 Max with 32 GB (macOS 27.0.1, mlx 0.32.2, mflux 0.20.0), 1024², seed 42:
bench/results/parity/qwen-image-2.1/full-vs-bf16.jsonbench/results/parity/qwen-image-2.1/kernel-vs-reference.jsonbench/results/identity/qwen-image-2.1-1024/compare.jsonbench/results/tiers/qwen-image-2.1-1024.jsonbench/results/refusals/andbench/results/tiers/aborts/The peak is the process's memory footprint as the OS counts it. The memory estimate is calibrated from the runs in
bench/results/calibration/qwen-image-2.1-1024.json. Its VAE term covers the highest of eleven samples, because the VAE phase varies by about 1 GiB between identical runs and a fit check must not under-predict. No 16 or 24 GB Mac was measured.Changes that reach every model:
generate_imagenow runs under the same memory capsmlx-dfloat generateinstalls, and puts MLX's limits back when it returns. Before this, a Python caller ran with no wired limit, while the memory estimates' VAE terms were measured under the caps. A wired limit the process already set is left alone.layers.01) is refused in every family.scripts/verify_remote_group.pychecks config-less checkpoints by range reads, andscripts/verify_image.pycovers Qwen-Image 2.1.The FLUX.1, Z-Image and FLUX.2 Klein model code is otherwise unchanged. The five commits each pass the test suite; the README table check passes from the last one, where the records and the README change together.