mirror of
https://github.com/power88/webui-fooocus-prompt-expansion.git
synced 2026-01-26 19:29:50 +00:00
add empyt prompt check in create_positive
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user