Repository navigation
Run Z-Image Turbo and Z-Image from DFloat11 checkpoints - #12
Merged
Merged
Conversation
IonDen
force-pushed
the
feature/s2-zimage
branch
2 times, most recently
from
October 8, 2026 01:04
a4ae127 to
da1e1bf
Compare
Block seam for transformers without per-block hooks, name maps that rename and transform non-block extras, a resident non-block group, shared Hub and lifecycle helpers, a family registry with DFloatModel(name), and a generic generate CLI. The FLUX.1 modules keep their import paths through re-exports.
Adds the Z-Image name map, transformer build, memory phases measured at 1024 by 1024, and DFloatZImage with the shared encoder and set lifecycle.
The sampled check can compare against an FP32 original rounded to BF16, the image identity check covers Z-Image, and the tier table shows Z-Image and watchdog stops.
README and CHANGELOG describe Z-Image generation; the tier results hold the 1024 rows and the 16 GB tier abort.
IonDen
force-pushed
the
feature/s2-zimage
branch
from
October 8, 2026 08:44
da1e1bf to
7e29b69
Compare
This was referenced Oct 8, 2026
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.
mlx-dfloat could only run FLUX.1. This adds Z-Image-Turbo and Z-Image, two current image models with DFloat11 checkpoints, and the layer that lets more mflux model families follow.
The FLUX.1 integration hooks mflux's per-block methods, and Z-Image's transformer has none: it calls its blocks inline. The new layer swaps each block's class for a subclass that installs that block's weights from the compressed set just before it runs and puts placeholders back afterwards, so every parameter keeps the path mflux expects. Weight names come from mflux's own Z-Image weight mapping, including the renames outside the blocks. The one compressed group that is not a block, the caption embedder, is decoded once when the set loads. mflux compiles Z-Image's denoising step on M1/M2 Max and Ultra and on M3 or later, and evaluating after each block cannot happen inside a compiled function, so the adapter takes mflux's uncompiled path on every chip and refuses to run if mflux hands back a compiled step anyway. A model registry backs
mlx-dfloat generate --model z-image-turbo/--model z-imageand a newDFloatModel(name), which returns a ready model. FLUX.1 keeps its own hook and behaves as before.Measured on an M1 Max with 32 GB (macOS 27.0.1, mlx 0.32.2, mflux 0.20.0):
FLUX.1 is unchanged: compared with the commit this branch started from, schnell's 1024² image is pixel-identical and the watched peaks are 0.019 GiB apart, and schnell's latents are still bit-identical to the BF16-streamed run.
Smaller changes users will see: the default Z-Image checkpoints are fetched at fixed Hub revisions;
generatesays on stderr when a model spec is fetched from the Hub, warns when a negative prompt is ignored because guidance is 1 or less, and recordselapsed_secondsin its--report; a watchdog stop records the phase that was running.Also in this PR:
scripts/verify_remote_group.py --cast-fp32-to-bf16for checkpoints whose original is FP32, Z-Image support inscripts/verify_image.py(Turbo is refused there, since it has no BF16 original), and tier-table rows for runs the watchdog stopped, shown as lower bounds with the time they ran.