Skip to content

Support native-layout Krea2 checkpoints (community GGUFs) in from_single_file()#14264

Open
spartanz51 wants to merge 5 commits into
huggingface:mainfrom
spartanz51:krea2-native-gguf-layout
Open

Support native-layout Krea2 checkpoints (community GGUFs) in from_single_file()#14264
spartanz51 wants to merge 5 commits into
huggingface:mainfrom
spartanz51:krea2-native-gguf-layout

Conversation

@spartanz51

Copy link
Copy Markdown

What does this PR do?

Builds on #14126 (includes its commits, happy to rebase once it lands).

The converter there covers the repack layout, but the community GGUF exports of Krea 2 (vantagewithai/Krea-2-Turbo-GGUF, realrebelai/KREA-2_GGUFs, ~145k downloads combined) keep the native key names from the krea-ai/krea-2 inference code: prenorm/postnorm.scale, attn.qknorm.*, flat mod.lin tables, first/tmlp/tproj/txtmlp/last.*. Those fall through remap_key untouched, so loading ends with ~180 unassigned params and crashes on meta tensors.

This extends the converter:

  • norm scales → norm1/norm2 and attn.norm_q/norm_k
  • flat mod.lin → per-block scale_shift_table, last.modulation.linfinal_layer.scale_shift_table
  • first/tmlp/tproj/txtmlp/last.*img_in/time_embed/time_mod_proj/txt_in/final_layer
  • drops last.up/down.weight (not part of the current LastLayer; the official diffusers weights don't ship them either — 430 keys vs 432 in native exports)
  • reshapes the squeezed projector.weight found in some exports

Tested with GGUFQuantizationConfig on Q3_K_M / Q4_K_M / Q8_0 from both repos: all load with zero missing/unexpected keys, and end-to-end Krea2Pipeline generation (8 steps, 768x768, mps) produces correct images.

Fixes the GGUF side of #14122.

Who can review?

cc @buffett0323 @DN6

@github-actions github-actions Bot added documentation Improvements or additions to documentation models tests single-file labels Jul 21, 2026
@github-actions github-actions Bot added the size/L PR with diff > 200 LOC label Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @spartanz51, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation models single-file size/L PR with diff > 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants