From 3e31a1d3e741aae6711879b5f02398af9fef48b3 Mon Sep 17 00:00:00 2001 From: Sayak Paul Date: Tue, 23 Jan 2024 14:21:23 +0530 Subject: [PATCH] [Tests] Test for passing local config file to `from_single_file()` (#6638) make config file local too. --- tests/pipelines/stable_diffusion/test_stable_diffusion.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/pipelines/stable_diffusion/test_stable_diffusion.py b/tests/pipelines/stable_diffusion/test_stable_diffusion.py index dd4f233d62698..4ea22574cc5a5 100644 --- a/tests/pipelines/stable_diffusion/test_stable_diffusion.py +++ b/tests/pipelines/stable_diffusion/test_stable_diffusion.py @@ -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")