twanghcmut/backup-foundation-physics / third_party /diffsynth /examples /qwen_image /model_training /scripts /Qwen-Image-Blockwise-ControlNet-Inpaint-Initialize.py
twanghcmut's picture
download
raw
555 Bytes
# This script is for initializing a Inpaint Qwen-Image-ControlNet
import torch
from diffsynth import hash_state_dict_keys
from diffsynth.models.qwen_image_controlnet import QwenImageBlockWiseControlNet
from safetensors.torch import save_file
controlnet = QwenImageBlockWiseControlNet(additional_in_dim=4).to(dtype=torch.bfloat16, device="cuda")
controlnet.init_weight()
state_dict_controlnet = controlnet.state_dict()
print(hash_state_dict_keys(state_dict_controlnet))
save_file(state_dict_controlnet, "models/blockwise_controlnet_inpaint.safetensors")

Xet Storage Details

Size:
555 Bytes
·
Xet hash:
628104ebc5790e4f4b8fb9530bb0b7319aa11e91a1c5d62a0027ab2d070befdd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.