From a1b7dbfa5442b9823a8d69a47f27be827880e0d5 Mon Sep 17 00:00:00 2001 From: Ryan Dick Date: Fri, 28 Jun 2024 10:30:32 -0400 Subject: [PATCH] Add unit test for patch_vae_tiling_params(). --- tests/backend/stable_diffusion/test_vae_tiling.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/backend/stable_diffusion/test_vae_tiling.py diff --git a/tests/backend/stable_diffusion/test_vae_tiling.py b/tests/backend/stable_diffusion/test_vae_tiling.py new file mode 100644 index 0000000000..4d97a8869b --- /dev/null +++ b/tests/backend/stable_diffusion/test_vae_tiling.py @@ -0,0 +1,13 @@ +from diffusers.models.autoencoders.autoencoder_kl import AutoencoderKL + +from invokeai.backend.stable_diffusion.vae_tiling import patch_vae_tiling_params + + +def test_patch_vae_tiling_params(): + """Smoke test the patch_vae_tiling_params(...) context manager. The main purpose of this unit test is to detect if + diffusers ever changes the attributes of the AutoencoderKL class that we expect to exist. + """ + vae = AutoencoderKL() + + with patch_vae_tiling_params(vae, 1, 2, 3): + pass