当前位置:   article > 正文

huggingface 连不上 from_pretrained from_single_file_stablediffusion3 离线使用 huggingface

stablediffusion3 离线使用 huggingface

huggingface的缓存目录 ~/.cach  

  1. cd ~/.cache
  2. # pwd 后展示 /home/fxbox/.cache
  3. pwd
  1. pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_pretrained(
  2. model_id_or_path,
  3. ).to(device=self.device, dtype=self.dtype)

改为:

  1. if os.path.exists(model_id_or_path):
  2. pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_single_file(
  3. model_id_or_path
  4. ).to(device=self.device, dtype=self.dtype)
  5. else:
  6. pipe: StableDiffusionPipeline = StableDiffusionPipeline.from_pretrained(
  7. model_id_or_path,
  8. ).to(device=self.device, dtype=self.dtype)

参考:

https://www.cnblogs.com/FrostyForest/p/17841926.html

python diffusers StableDiffusionXLPipeline 离线使用_runwayml/stable-diffusion-v1-5 离线下载-CSDN博客 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小桥流水78/article/detail/868319
推荐阅读
相关标签
  

闽ICP备14008679号