huggingface的缓存目录 ~/.cach
cd ~/.cache
# pwd 后展示 /home/fxbox/.cache
pwd
pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_pretrained(
model_id_or_path,
).to(device=self.device, dtype=self.dtype)
改为:
if os.path.exists(model_id_or_path):
pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_single_file(
model_id_or_path
).to(device=self.device, dtype=self.dtype)
else:
pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_pretrained(
model_id_or_path,
).to(device=self.device, dtype=self.dtype)
参考:
https://www.cnblogs.com/FrostyForest/p/17841926.html文章来源:https://www.toymoban.com/news/detail-814010.html
python diffusers StableDiffusionXLPipeline 离线使用_runwayml/stable-diffusion-v1-5 离线下载-CSDN博客 文章来源地址https://www.toymoban.com/news/detail-814010.html
到了这里,关于huggingface 连不上 from_pretrained from_single_file的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!