Fix Ming-Image GGUF packed QKV loading - #484
Open
RealRebelAI wants to merge 1 commit into
Open
RealRebelAI wants to merge 1 commit into
RealRebelAI wants to merge 1 commit into
Conversation
Author
|
id also like to add that i have quants uploading for the model for anyone interested. theyll be in my HF repo. |
|
ComfyUI-GGUF-db80272b3d04f4747a4df00cb0a7ca95f63ec490.zip |
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.
Summary
Adds Ming-Image GGUF support for quantized Diffusers-format checkpoints that store attention Q/K/V as separate tensors.
ComfyUI's normal Diffusers conversion merges those tensors using ordinary Torch tensor assignment. With quantized GGUF tensors, the underlying physical storage is packed bytes while the
GGMLTensorkeeps a separate logical tensor shape. This can cause the packed row width to be used during the merge instead of the logical width.For Ming-Image-0.1-Design this produced:
Fix
When
UnetLoaderGGUFdetects a quantized Ming-Image state dict, it performs the Ming Diffusers key conversion before ComfyUI's generic model conversion.The Q/K/V merge:
is_largest_weightwhen presentThe GGUF model itself does not need to be rebuilt, repaired, dequantized, or requantized.
Tested
Tested successfully with:
--lowvramBefore the change the same GGUF failed during
convert_diffusers_mmdit()with the 3840 vs 4080 shape mismatch.After the change the original GGUF loads successfully and runs without modifying the model file.
Scope
This is deliberately detected using Ming-Image-specific tensor keys rather than changing
GGMLTensorbehavior globally.Ming currently shares ComfyUI's
z_image_to_diffusers()key mapping internally, but this change is specifically scoped and named for Ming-Image because that is the model and path tested here.