Skip to content

Commit 3e31a1d

Browse files
sayakpaulJimmy
authored and
Jimmy
committed
[Tests] Test for passing local config file to from_single_file() (huggingface#6638)
make config file local too.
1 parent 396605e commit 3e31a1d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/pipelines/stable_diffusion/test_stable_diffusion.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,9 +1246,12 @@ def test_download_from_hub(self):
12461246
assert image_out.shape == (512, 512, 3)
12471247

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

1251-
pipe = StableDiffusionPipeline.from_single_file(filename, torch_dtype=torch.float16)
1252+
pipe = StableDiffusionPipeline.from_single_file(
1253+
ckpt_filename, config_files={"v1": config_filename}, torch_dtype=torch.float16
1254+
)
12521255
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
12531256
pipe.to("cuda")
12541257

0 commit comments

Comments
 (0)