From 9be86ca66f211cf17d3c4d015b3de12795663180 Mon Sep 17 00:00:00 2001 From: Ruslan Rakhimov Date: Wed, 2 Sep 2026 12:27:11 +0300 Subject: [PATCH] Fix model path in Qwen-Image-Distill-DMD2 examples snapshot_download was called with cache_dir=, which writes the hub cache layout (models/models/--/snapshots//), but the following load_state_dict reads the local_dir layout (models///), so the file is never found. Other examples in the repo use local_dir= for this. --- examples/qwen_image/model_inference/Qwen-Image-Distill-DMD2.py | 2 +- .../model_inference_low_vram/Qwen-Image-Distill-DMD2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/qwen_image/model_inference/Qwen-Image-Distill-DMD2.py b/examples/qwen_image/model_inference/Qwen-Image-Distill-DMD2.py index 007538f76..65fff0ca6 100644 --- a/examples/qwen_image/model_inference/Qwen-Image-Distill-DMD2.py +++ b/examples/qwen_image/model_inference/Qwen-Image-Distill-DMD2.py @@ -15,7 +15,7 @@ tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"), ) -snapshot_download("MusePublic/Qwen-Image-Distill", allow_file_pattern="qwen_image_distill_3step.safetensors", cache_dir="models") +snapshot_download("MusePublic/Qwen-Image-Distill", allow_file_pattern="qwen_image_distill_3step.safetensors", local_dir="models/MusePublic/Qwen-Image-Distill") lora_state_dict = load_state_dict("models/MusePublic/Qwen-Image-Distill/qwen_image_distill_3step.safetensors") lora_state_dict = {i.replace("base_model.model.", ""): j for i, j in lora_state_dict.items()} pipe.load_lora(pipe.dit, state_dict=lora_state_dict) diff --git a/examples/qwen_image/model_inference_low_vram/Qwen-Image-Distill-DMD2.py b/examples/qwen_image/model_inference_low_vram/Qwen-Image-Distill-DMD2.py index 6b9566742..dc241c38c 100644 --- a/examples/qwen_image/model_inference_low_vram/Qwen-Image-Distill-DMD2.py +++ b/examples/qwen_image/model_inference_low_vram/Qwen-Image-Distill-DMD2.py @@ -26,7 +26,7 @@ vram_limit=torch.cuda.mem_get_info("cuda")[1] / (1024 ** 3) - 0.5, ) -snapshot_download("MusePublic/Qwen-Image-Distill", allow_file_pattern="qwen_image_distill_3step.safetensors", cache_dir="models") +snapshot_download("MusePublic/Qwen-Image-Distill", allow_file_pattern="qwen_image_distill_3step.safetensors", local_dir="models/MusePublic/Qwen-Image-Distill") lora_state_dict = load_state_dict("models/MusePublic/Qwen-Image-Distill/qwen_image_distill_3step.safetensors", device="cuda", torch_dtype=torch.bfloat16) lora_state_dict = {i.replace("base_model.model.", "").replace(".weight", ".default.weight"): j for i, j in lora_state_dict.items()} pipe.load_lora(pipe.dit, state_dict=lora_state_dict, hotload=True)