Skip to content

Pipeline.from_single_file/download_from_original_stable_diffusion_ckpt broken for local config yaml files #6615

Closed
@spezialspezial

Description

@spezialspezial

Describe the bug

When passing a local config yaml file path to Pipeline.from_single_file the file is not read in but handed over as a file path to yaml.safe_load(original_config_file). yaml expects the config contents and errors out. Something like this should be added:

diff --git a/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py b/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
index b871f7b..1ba06f8 100644
--- a/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
+++ b/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
@@ -1317,6 +1317,9 @@ def download_from_original_stable_diffusion_ckpt(
 
         if config_url is not None:
             original_config_file = BytesIO(requests.get(config_url).content)
+        else:
+            with open(original_config_file, "r") as f:
+                original_config_file = f.read()
 
     original_config = yaml.safe_load(original_config_file)

Reproduction

Try loading a pipe via from_single_file with a local yaml config

Logs

No response

System Info

diffusers 0.26.0.dev0 911202, torch 2.1.2+cu121 + cuda 12.1

Who can help?

No response

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