How to specify filename in ControlNetModel.from_pretrained()? #10687
-
I'm trying to load https://huggingface.co/thibaud/controlnet-openpose-sdxl-1.0/tree/main with diffusers pipeline controlnet = ControlNetModel.from_pretrained(
"thibaud/controlnet-openpose-sdxl-1.0",
torch_dtype=torchDtype
).to(device) It defaults to pickle file, but I wanted to load OpenPoseXL2.safetensors instead. How can I specify the filename? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, to be able load diffusers controlnets with If it doesn't work, you should ask the author what's the format of that file and if it's a diffusers format one, you can ask them to name it accordingly. |
Beta Was this translation helpful? Give feedback.
-
Understood, the name is deducted from the repo name, can't be changed during method call. |
Beta Was this translation helpful? Give feedback.
Hi, to be able load diffusers controlnets with
from_pretrained()
they need to have the correct naming, that means it should bediffusion_pytorch_model.safetensors
like for example, in this repository. This means that probably that model file is not in the diffusers format and in thesingle file format
which you can try to load usingfrom_single_file()
.If it doesn't work, you should ask the author what's the format of that file and if it's a diffusers format one, you can ask them to name it accordingly.