Comfy-Org / Comfy-Org/ComfyUI

Z-Image Base Finetune key fix.

Open
#12,165 2 comments 4 reactions 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Feature Idea

I was getting black image outputs and missing keys

Prompt executed in 23.49 seconds
got prompt
model weight dtype torch.bfloat16, manual cast: None
model_type FLOW
unet missing: ['x_embedder.weight', 'x_embedder.bias', 'noise_refiner.0.attention.qkv.weight', 'noise_refiner.0.attention.out.weight', 'noise_refiner.0.attention.q_norm.weight', 'noise_refiner.0.attention.k_norm.weight', 'noise_refiner.1.attention.qkv.weight', 'noise_refiner.1.attention.out.weight', 'noise_refiner.1.attention.q_norm.weight', 'noise_refiner.1.attention.k_norm.weight', 'context_refiner.0.attention.qkv.weight', 'context_refiner.0.attention.out.weight', 'context_refiner.0.attention.q_norm.weight', 'context_refiner.0.attention.k_norm.weight', 'context_refiner.1.attention.qkv.weight', 'context_refiner.1.attention.out.weight', 'context_refiner.1.attention.q_norm.weight', 'context_refiner.1.attention.k_norm.weight', 'layers.0.attention.qkv.weight', 'layers.0.attention.out.weight', 'layers.0.attention.q_norm.weight', 'layers.0.attention.k_norm.weight', 'layers.1.attention.qkv.weight', 'layers.1.attention.out.weight', 'layers.1.attention.q_norm.weight', 'layers.1.attention.k_norm.weight', 'layers.2.attention.qkv.weight', 'layers.2.attention.out.weight', 'layers.2.attention.q_norm.weight', 'layers.2.attention.k_norm.weight', 'layers.3.attention.qkv.weight', 'layers.3.attention.out.weight', 'layers.3.attention.q_norm.weight', 'layers.3.attention.k_norm.weight', 'layers.4.attention.qkv.weight', 'layers.4.attention.out.weight', 'layers.4.attention.q_norm.weight', 'layers.4.attention.k_norm.weight', 'layers.5.attention.qkv.weight', 'layers.5.attention.out.weight', 'layers.5.attention.q_norm.weight', 'layers.5.attention.k_norm.weight', 'layers.6.attention.qkv.weight', 'layers.6.attention.out.weight', 'layers.6.attention.q_norm.weight', 'layers.6.attention.k_norm.weight', 'layers.7.attention.qkv.weight', 'layers.7.attention.out.weight', 'layers.7.attention.q_norm.weight', 'layers.7.attention.k_norm.weight', 'layers.8.attention.qkv.weight', 'layers.8.attention.out.weight', 'layers.8.attention.q_norm.weight', 'layers.8.attention.k_norm.weight', 'layers.9.attention.qkv.weight', 'layers.9.attention.out.weight', 'layers.9.attention.q_norm.weight', 'layers.9.attention.k_norm.weight', 'layers.10.attention.qkv.weight', 'layers.10.attention.out.weight', 'layers.10.attention.q_norm.weight', 'layers.10.attention.k_norm.weight', 'layers.11.attention.qkv.weight', 'layers.11.attention.out.weight', 'layers.11.attention.q_norm.weight', 'layers.11.attention.k_norm.weight', 'layers.12.attention.qkv.weight', 'layers.12.attention.out.weight', 'layers.12.attention.q_norm.weight', 'layers.12.attention.k_norm.weight', 'layers.13.attention.qkv.weight', 'layers.13.attention.out.weight', 'layers.13.attention.q_norm.weight', 'layers.13.attention.k_norm.weight', 'layers.14.attention.qkv.weight', 'layers.14.attention.out.weight', 'layers.14.attention.q_norm.weight', 'layers.14.attention.k_norm.weight', 'layers.15.attention.qkv.weight', 'layers.15.attention.out.weight', 'layers.15.attention.q_norm.weight', 'layers.15.attention.k_norm.weight', 'layers.16.attention.qkv.weight', 'layers.16.attention.out.weight', 'layers.16.attention.q_norm.weight', 'layers.16.attention.k_norm.weight', 'layers.17.attention.qkv.weight', 'layers.17.attention.out.weight', 'layers.17.attention.q_norm.weight', 'layers.17.attention.k_norm.weight', 'layers.18.attention.qkv.weight', 'layers.18.attention.out.weight', 'layers.18.attention.q_norm.weight', 'layers.18.attention.k_norm.weight', 'layers.19.attention.qkv.weight', 'layers.19.attention.out.weight', 'layers.19.attention.q_norm.weight', 'layers.19.attention.k_norm.weight', 'layers.20.attention.qkv.weight', 'layers.20.attention.out.weight', 'layers.20.attention.q_norm.weight', 'layers.20.attention.k_norm.weight', 'layers.21.attention.qkv.weight', 'layers.21.attention.out.weight', 'layers.21.attention.q_norm.weight', 'layers.21.attention.k_norm.weight', 'layers.22.attention.qkv.weight', 'layers.22.attention.out.weight', 'layers.22.attention.q_norm.weight', 'layers.22.attention.k_norm.weight', 'layers.23.attention.qkv.weight', 'layers.23.attention.out.weight', 'layers.23.attention.q_norm.weight', 'layers.23.attention.k_norm.weight', 'layers.24.attention.qkv.weight', 'layers.24.attention.out.weight', 'layers.24.attention.q_norm.weight', 'layers.24.attention.k_norm.weight', 'layers.25.attention.qkv.weight', 'layers.25.attention.out.weight', 'layers.25.attention.q_norm.weight', 'layers.25.attention.k_norm.weight', 'layers.26.attention.qkv.weight', 'layers.26.attention.out.weight', 'layers.26.attention.q_norm.weight', 'layers.26.attention.k_norm.weight', 'layers.27.attention.qkv.weight', 'layers.27.attention.out.weight', 'layers.27.attention.q_norm.weight', 'layers.27.attention.k_norm.weight', 'layers.28.attention.qkv.weight', 'layers.28.attention.out.weight', 'layers.28.attention.q_norm.weight', 'layers.28.attention.k_norm.weight', 'layers.29.attention.qkv.weight', 'layers.29.attention.out.weight', 'layers.29.attention.q_norm.weight', 'layers.29.attention.k_norm.weight', 'final_layer.linear.weight', 'final_layer.linear.bias', 'final_layer.adaLN_modulation.1.weight', 'final_layer.adaLN_modulation.1.bias']
unet unexpected: ['all_final_layer.2-1.adaLN_modulation.1.bias', 'all_final_layer.2-1.adaLN_modulation.1.weight', 'all_final_layer.2-1.linear.bias', 'all_final_layer.2-1.linear.weight', 'all_x_embedder.2-1.bias', 'all_x_embedder.2-1.weight', 'noise_refiner.0.attention.norm_k.weight', 'noise_refiner.0.attention.norm_q.weight', 'noise_refiner.0.attention.to_k.weight', 'noise_refiner.0.attention.to_out.0.weight', 'noise_refiner.0.attention.to_q.weight', 'noise_refiner.0.attention.to_v.weight', 'noise_refiner.1.attention.norm_k.weight', 'noise_refiner.1.attention.norm_q.weight', 'noise_refiner.1.attention.to_k.weight', 'noise_refiner.1.attention.to_out.0.weight', 'noise_refiner.1.attention.to_q.weight', 'noise_refiner.1.attention.to_v.weight', 'context_refiner.0.attention.norm_k.weight', 'context_refiner.0.attention.norm_q.weight', 'context_refiner.0.attention.to_k.weight', 'context_refiner.0.attention.to_out.0.weight', 'context_refiner.0.attention.to_q.weight', 'context_refiner.0.attention.to_v.weight', 'context_refiner.1.attention.norm_k.weight', 'context_refiner.1.attention.norm_q.weight', 'context_refiner.1.attention.to_k.weight', 'context_refiner.1.attention.to_out.0.weight', 'context_refiner.1.attention.to_q.weight', 'context_refiner.1.attention.to_v.weight', 'layers.0.attention.norm_k.weight', 'layers.0.attention.norm_q.weight', 'layers.0.attention.to_k.weight', 'layers.0.attention.to_out.0.weight', 'layers.0.attention.to_q.weight', 'layers.0.attention.to_v.weight', 'layers.1.attention.norm_k.weight', 'layers.1.attention.norm_q.weight', 'layers.1.attention.to_k.weight', 'layers.1.attention.to_out.0.weight', 'layers.1.attention.to_q.weight', 'layers.1.attention.to_v.weight', 'layers.2.attention.norm_k.weight', 'layers.2.attention.norm_q.weight', 'layers.2.attention.to_k.weight', 'layers.2.attention.to_out.0.weight', 'layers.2.attention.to_q.weight', 'layers.2.attention.to_v.weight', 'layers.3.attention.norm_k.weight', 'layers.3.attention.norm_q.weight', 'layers.3.attention.to_k.weight', 'layers.3.attention.to_out.0.weight', 'layers.3.attention.to_q.weight', 'layers.3.attention.to_v.weight', 'layers.4.attention.norm_k.weight', 'layers.4.attention.norm_q.weight', 'layers.4.attention.to_k.weight', 'layers.4.attention.to_out.0.weight', 'layers.4.attention.to_q.weight', 'layers.4.attention.to_v.weight', 'layers.5.attention.norm_k.weight', 'layers.5.attention.norm_q.weight', 'layers.5.attention.to_k.weight', 'layers.5.attention.to_out.0.weight', 'layers.5.attention.to_q.weight', 'layers.5.attention.to_v.weight', 'layers.6.attention.norm_k.weight', 'layers.6.attention.norm_q.weight', 'layers.6.attention.to_k.weight', 'layers.6.attention.to_out.0.weight', 'layers.6.attention.to_q.weight', 'layers.6.attention.to_v.weight', 'layers.7.attention.norm_k.weight', 'layers.7.attention.norm_q.weight', 'layers.7.attention.to_k.weight', 'layers.7.attention.to_out.0.weight', 'layers.7.attention.to_q.weight', 'layers.7.attention.to_v.weight', 'layers.8.attention.norm_k.weight', 'layers.8.attention.norm_q.weight', 'layers.8.attention.to_k.weight', 'layers.8.attention.to_out.0.weight', 'layers.8.attention.to_q.weight', 'layers.8.attention.to_v.weight', 'layers.9.attention.norm_k.weight', 'layers.9.attention.norm_q.weight', 'layers.9.attention.to_k.weight', 'layers.9.attention.to_out.0.weight', 'layers.9.attention.to_q.weight', 'layers.9.attention.to_v.weight', 'layers.10.attention.norm_k.weight', 'layers.10.attention.norm_q.weight', 'layers.10.attention.to_k.weight', 'layers.10.attention.to_out.0.weight', 'layers.10.attention.to_q.weight', 'layers.10.attention.to_v.weight', 'layers.11.attention.norm_k.weight', 'layers.11.attention.norm_q.weight', 'layers.11.attention.to_k.weight', 'layers.11.attention.to_out.0.weight', 'layers.11.attention.to_q.weight', 'layers.11.attention.to_v.weight', 'layers.12.attention.norm_k.weight', 'layers.12.attention.norm_q.weight', 'layers.12.attention.to_k.weight', 'layers.12.attention.to_out.0.weight', 'layers.12.attention.to_q.weight', 'layers.12.attention.to_v.weight', 'layers.13.attention.norm_k.weight', 'layers.13.attention.norm_q.weight', 'layers.13.attention.to_k.weight', 'layers.13.attention.to_out.0.weight', 'layers.13.attention.to_q.weight', 'layers.13.attention.to_v.weight', 'layers.14.attention.norm_k.weight', 'layers.14.attention.norm_q.weight', 'layers.14.attention.to_k.weight', 'layers.14.attention.to_out.0.weight', 'layers.14.attention.to_q.weight', 'layers.14.attention.to_v.weight', 'layers.15.attention.norm_k.weight', 'layers.15.attention.norm_q.weight', 'layers.15.attention.to_k.weight', 'layers.15.attention.to_out.0.weight', 'layers.15.attention.to_q.weight', 'layers.15.attention.to_v.weight', 'layers.16.attention.norm_k.weight', 'layers.16.attention.norm_q.weight', 'layers.16.attention.to_k.weight', 'layers.16.attention.to_out.0.weight', 'layers.16.attention.to_q.weight', 'layers.16.attention.to_v.weight', 'layers.17.attention.norm_k.weight', 'layers.17.attention.norm_q.weight', 'layers.17.attention.to_k.weight', 'layers.17.attention.to_out.0.weight', 'layers.17.attention.to_q.weight', 'layers.17.attention.to_v.weight', 'layers.18.attention.norm_k.weight', 'layers.18.attention.norm_q.weight', 'layers.18.attention.to_k.weight', 'layers.18.attention.to_out.0.weight', 'layers.18.attention.to_q.weight', 'layers.18.attention.to_v.weight', 'layers.19.attention.norm_k.weight', 'layers.19.attention.norm_q.weight', 'layers.19.attention.to_k.weight', 'layers.19.attention.to_out.0.weight', 'layers.19.attention.to_q.weight', 'layers.19.attention.to_v.weight', 'layers.20.attention.norm_k.weight', 'layers.20.attention.norm_q.weight', 'layers.20.attention.to_k.weight', 'layers.20.attention.to_out.0.weight', 'layers.20.attention.to_q.weight', 'layers.20.attention.to_v.weight', 'layers.21.attention.norm_k.weight', 'layers.21.attention.norm_q.weight', 'layers.21.attention.to_k.weight', 'layers.21.attention.to_out.0.weight', 'layers.21.attention.to_q.weight', 'layers.21.attention.to_v.weight', 'layers.22.attention.norm_k.weight', 'layers.22.attention.norm_q.weight', 'layers.22.attention.to_k.weight', 'layers.22.attention.to_out.0.weight', 'layers.22.attention.to_q.weight', 'layers.22.attention.to_v.weight', 'layers.23.attention.norm_k.weight', 'layers.23.attention.norm_q.weight', 'layers.23.attention.to_k.weight', 'layers.23.attention.to_out.0.weight', 'layers.23.attention.to_q.weight', 'layers.23.attention.to_v.weight', 'layers.24.attention.norm_k.weight', 'layers.24.attention.norm_q.weight', 'layers.24.attention.to_k.weight', 'layers.24.attention.to_out.0.weight', 'layers.24.attention.to_q.weight', 'layers.24.attention.to_v.weight', 'layers.25.attention.norm_k.weight', 'layers.25.attention.norm_q.weight', 'layers.25.attention.to_k.weight', 'layers.25.attention.to_out.0.weight', 'layers.25.attention.to_q.weight', 'layers.25.attention.to_v.weight', 'layers.26.attention.norm_k.weight', 'layers.26.attention.norm_q.weight', 'layers.26.attention.to_k.weight', 'layers.26.attention.to_out.0.weight', 'layers.26.attention.to_q.weight', 'layers.26.attention.to_v.weight', 'layers.27.attention.norm_k.weight', 'layers.27.attention.norm_q.weight', 'layers.27.attention.to_k.weight', 'layers.27.attention.to_out.0.weight', 'layers.27.attention.to_q.weight', 'layers.27.attention.to_v.weight', 'layers.28.attention.norm_k.weight', 'layers.28.attention.norm_q.weight', 'layers.28.attention.to_k.weight', 'layers.28.attention.to_out.0.weight', 'layers.28.attention.to_q.weight', 'layers.28.attention.to_v.weight', 'layers.29.attention.norm_k.weight', 'layers.29.attention.norm_q.weight', 'layers.29.attention.to_k.weight', 'layers.29.attention.to_out.0.weight', 'layers.29.attention.to_q.weight', 'layers.29.attention.to_v.weight']
Requested to load Lumina2
loaded completely; 11739.54 MB loaded, full load: True
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:16<00:00, 2.47it/s]
Prompt executed in 24.77 seconds

I made a conversion script to fix it

### Existing Solutions

[convert_zimage_safetensors_to_comfy.py](https://github.com/user-attachments/files/24948626/convert_zimage_safetensors_to_comfy.py)

### Other

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.