Fix Ideogram4 full-model save: apply diffusers-to-original qkv fusion - #1589
Merged
Merged
Conversation
IdeogramModelSaver.__save_safetensors dumped the raw diffusers-split
transformer state dict instead of routing it through
model.checkpoint_diffusers_to_original(), unlike every other fusing
model's saver (Flux, Flux2, Chroma, HunyuanVideo, PixArt-Alpha, SD3,
Krea2, Anima). Ideogram4's native/ComfyUI checkpoint format uses a
fused qkv Linear (not a Comfy-only quirk -- diffusers is the one that
splits it), so a saved ORIGINAL_TRANSFORMER checkpoint failed to load
in ComfyUI ("unet missing: attention.qkv.weight ... unet unexpected:
attention.to_q.weight ...").
IdeogramModel already declared fusion_groups() and
diffusers_to_original() correctly; the saver just never used them.
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
IdeogramModelSaver.__save_safetensorssaved the raw diffusers-splitmodel.transformer.state_dict()directly, instead of routing it throughmodel.checkpoint_diffusers_to_original()like every other fusing model's saver does (Flux, Flux2, Chroma, HunyuanVideo, PixArt-Alpha, SD3, Krea2, Anima).qkvnn.Linearper block — this isn't a Comfy-only quirk (unlike Z-Image, where fused qkv really is Comfy-side convenience); the real upstreamideogram-oss/ideogram4architecture has a genuine fusedself.qkv, and diffusers is the one that re-expresses it as splitto_q/to_k/to_vfor its own API.IdeogramModelalready declaresfusion_groups()anddiffusers_to_original()correctly — the saver just never applied them.ORIGINAL_TRANSFORMERfull-finetune checkpoint failed to load in ComfyUI:Test plan
model.checkpoint_diffusers_to_original()+convert(): confirmed the output has fusedattention.qkv/attention.okeys for all 34 blocks and zero remaining splitto_q/to_k/to_v/to_outkeys.Drafted by Claude