From bdc48be2933f761ed0753eb2c54a35bb1f186ce7 Mon Sep 17 00:00:00 2001 From: sachalin Date: Wed, 23 Nov 2022 15:10:02 +0100 Subject: [PATCH] float asserts fixed --- latent_blending.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latent_blending.py b/latent_blending.py index b9bfe2a..fa57416 100644 --- a/latent_blending.py +++ b/latent_blending.py @@ -213,7 +213,7 @@ class LatentBlending(): if list_injection_strength is None: assert list_injection_idx is not None, "Supply either list_injection_idx or list_injection_strength" - assert isinstance(list_injection_idx[0], int), "Need to supply integers for list_injection_idx" + assert isinstance(list_injection_idx[0], int) or isinstance(list_injection_idx[0], np.int) , "Need to supply integers for list_injection_idx" if list_injection_idx is None: assert list_injection_strength is not None, "Supply either list_injection_idx or list_injection_strength" @@ -222,7 +222,7 @@ class LatentBlending(): assert min(np.diff(list_injection_idx)) > 0, 'Injection idx needs to be increasing' if min(np.diff(list_injection_idx)) < 2: print("Warning: your injection spacing is very tight. consider increasing the distances") - assert isinstance(list_injection_strength[1], np.floating), "Need to supply floats for list_injection_strength" + assert isinstance(list_injection_strength[1], np.floating) or isinstance(list_injection_strength[1], float), "Need to supply floats for list_injection_strength" # we are checking element 1 in list_injection_strength because "0" is an int... [0, 0.5] assert max(list_injection_idx) < self.num_inference_steps, "Decrease the injection index or strength"