From 14dbf81da4b56638024a28d69b92e3ea1bdd5708 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:29:38 +0900 Subject: [PATCH] add empyt prompt check in create_positive --- scripts/expansion.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/expansion.py b/scripts/expansion.py index 6d84aa5..8004a57 100644 --- a/scripts/expansion.py +++ b/scripts/expansion.py @@ -101,7 +101,7 @@ class FooocusExpansion: @torch.no_grad() @torch.inference_mode() def __call__(self, prompt, seed): - if prompt == '': + if not prompt: return '' seed = int(seed) % SEED_LIMIT_NUMPY @@ -129,6 +129,8 @@ class FooocusExpansion: @lru_cache(maxsize=1024) def create_positive(positive, seed): + if not positive: + return '' expansion = FooocusExpansion() positive = expansion(positive, seed=seed) expansion.unload_model() # Unload the model after use