Skip to content

Commit

Permalink
[Tests] Test for passing local config file to from_single_file() (h…
Browse files Browse the repository at this point in the history
…uggingface#6638)

make config file local too.
  • Loading branch information
sayakpaul authored and Jimmy committed Apr 26, 2024
1 parent 396605e commit 3e31a1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/pipelines/stable_diffusion/test_stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1246,9 +1246,12 @@ def test_download_from_hub(self):
assert image_out.shape == (512, 512, 3)

def test_download_local(self):
filename = hf_hub_download("runwayml/stable-diffusion-v1-5", filename="v1-5-pruned-emaonly.ckpt")
ckpt_filename = hf_hub_download("runwayml/stable-diffusion-v1-5", filename="v1-5-pruned-emaonly.ckpt")
config_filename = hf_hub_download("runwayml/stable-diffusion-v1-5", filename="v1-inference.yaml")

pipe = StableDiffusionPipeline.from_single_file(filename, torch_dtype=torch.float16)
pipe = StableDiffusionPipeline.from_single_file(
ckpt_filename, config_files={"v1": config_filename}, torch_dtype=torch.float16
)
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
pipe.to("cuda")

Expand Down

0 comments on commit 3e31a1d

Please sign in to comment.