Skip to content

from_ckpt not working properly on windows #3574

@LyubimovVladislav

Description

@LyubimovVladislav

Describe the bug

When attempting to use the StableDiffusionPipeline.from_ckpt() with HF checkpoint link on Windows OS, a HFValidationError exception is raised. This issue stems from how the Path is processed in the code here. On Windows, the repo_id and file_path will contain backslashes instead of forward slashes, resulting in an improper repo_id and file_path format. E.g., repo_id = 'runwayml\\stable-diffusion-v1-5', file_path = 'blob\\main\\v1-5-pruned-emaonly.ckpt'
This issue is not present on Linux systems.

Reproduction

from diffusers import StableDiffusionPipeline
StableDiffusionPipeline.from_ckpt('https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt')

Logs

No response

System Info

  • Platform: Windows-10-10.0.19045-SP0

  • diffusers version: 0.16.1

  • Python version: 3.10.6

  • Huggingface_hub version: 0.14.1


  • Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35

  • diffusers version: 0.16.1

  • Python version: 3.10.6

  • Huggingface_hub version: 0.14.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions