Skip to content

Fix Ideogram4 full-model save: apply diffusers-to-original qkv fusion - #1589

Merged
dxqb merged 1 commit into
Nerogar:mergefrom
dxqb:fix-ideogram4-fullmodel-qkv-fusion
Jul 5, 2026
Merged

Fix Ideogram4 full-model save: apply diffusers-to-original qkv fusion#1589
dxqb merged 1 commit into
Nerogar:mergefrom
dxqb:fix-ideogram4-fullmodel-qkv-fusion

Conversation

@dxqb

@dxqb dxqb commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • IdeogramModelSaver.__save_safetensors saved the raw diffusers-split model.transformer.state_dict() directly, instead of routing it through model.checkpoint_diffusers_to_original() like every other fusing model's saver does (Flux, Flux2, Chroma, HunyuanVideo, PixArt-Alpha, SD3, Krea2, Anima).
  • Ideogram4's native/ComfyUI checkpoint format uses a fused qkv nn.Linear per block — this isn't a Comfy-only quirk (unlike Z-Image, where fused qkv really is Comfy-side convenience); the real upstream ideogram-oss/ideogram4 architecture has a genuine fused self.qkv, and diffusers is the one that re-expresses it as split to_q/to_k/to_v for its own API. IdeogramModel already declares fusion_groups() and diffusers_to_original() correctly — the saver just never applied them.
  • Symptom: a saved ORIGINAL_TRANSFORMER full-finetune checkpoint failed to load in ComfyUI:
    unet missing: ['layers.0.attention.qkv.weight', 'layers.0.attention.o.weight', ...]
    unet unexpected: ['layers.0.attention.to_q.weight', 'layers.0.attention.to_out.0.weight', ...]
    

Test plan

  • Loaded the previously-saved (broken) full-finetune checkpoint and ran it through model.checkpoint_diffusers_to_original() + convert(): confirmed the output has fused attention.qkv/attention.o keys for all 34 blocks and zero remaining split to_q/to_k/to_v/to_out keys.

Drafted by Claude

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.
@dxqb
dxqb merged commit f8a5bec into Nerogar:merge Jul 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant