Views
No views yet
dit_model-*.safetensors (10 shards) → transformer state dicttext_encoder-*.safetensors (4 shards) → Qwen2.5-VL text-encoder1import torch, glob
2from safetensors.torch import load_file
3from diffusers import QwenImagePipeline
4from huggingface_hub import hf_hub_download, snapshot_download
5
6pipe = QwenImagePipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=torch.bfloat16)
7local = snapshot_download("heheyas/Qwen-Image-SP")
8
9for shard in sorted(glob.glob(f"{local}/dit_model-*.safetensors")):
10 pipe.transformer.load_state_dict(load_file(shard), strict=False)
11for shard in sorted(glob.glob(f"{local}/text_encoder-*.safetensors")):
12 pipe.text_encoder.load_state_dict(load_file(shard), strict=False)Qwen/Qwen-Image at load
time and not shipped here.