diff --git a/examples/qwen_image/model_inference/Qwen-Image-Context-Control.py b/examples/qwen_image/model_inference/Qwen-Image-Context-Control.py index c6d478c..0e1a34f 100644 --- a/examples/qwen_image/model_inference/Qwen-Image-Context-Control.py +++ b/examples/qwen_image/model_inference/Qwen-Image-Context-Control.py @@ -3,9 +3,9 @@ import torch from modelscope import dataset_snapshot_download, snapshot_download from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig from diffsynth.controlnets.processors import Annotator -from diffsynth import download_models -download_models(["Annotators:Depth"]) +allow_file_pattern = ["sk_model.pth", "sk_model2.pth", "dpt_hybrid-midas-501f0c75.pt", "ControlNetHED.pth", "body_pose_model.pth", "hand_pose_model.pth", "facenet.pth", "scannet.pt"] +snapshot_download("lllyasviel/Annotators", local_dir="models/Annotators", allow_file_pattern=allow_file_pattern) pipe = QwenImagePipeline.from_pretrained( torch_dtype=torch.bfloat16, diff --git a/examples/qwen_image/model_inference_low_vram/Qwen-Image-Context-Control.py b/examples/qwen_image/model_inference_low_vram/Qwen-Image-Context-Control.py index 96d0856..227f2c8 100644 --- a/examples/qwen_image/model_inference_low_vram/Qwen-Image-Context-Control.py +++ b/examples/qwen_image/model_inference_low_vram/Qwen-Image-Context-Control.py @@ -3,9 +3,9 @@ import torch from modelscope import dataset_snapshot_download, snapshot_download from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig from diffsynth.controlnets.processors import Annotator -from diffsynth import download_models -download_models(["Annotators:Depth"]) +allow_file_pattern = ["sk_model.pth", "sk_model2.pth", "dpt_hybrid-midas-501f0c75.pt", "ControlNetHED.pth", "body_pose_model.pth", "hand_pose_model.pth", "facenet.pth", "scannet.pt"] +snapshot_download("lllyasviel/Annotators", local_dir="models/Annotators", allow_file_pattern=allow_file_pattern) pipe = QwenImagePipeline.from_pretrained( torch_dtype=torch.bfloat16,