fix bug: IsNoneOrEmpty node

This commit is contained in:
刘雪峰
2024-10-30 19:03:20 +08:00
parent 26267c4ae5
commit e154998ec6
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -770,7 +770,7 @@ class IsNoneOrEmpty:
CATEGORY = "EasyApi/Utils"
DESCRIPTION = "判断输入是否为None、空列表、空字符串(trim后判断)、空字典"
def execute(self, any):
def execute(self, any=None):
if any is None:
return True,
if isinstance(any, (list, tuple)):
@@ -779,7 +779,7 @@ class IsNoneOrEmpty:
return (True if len(any.strip()) == 0 else False,)
if isinstance(any, dict):
return (True if len(any) == 0 else False,)
return False
return False,
class IsNoneOrEmptyOptional:
@@ -800,7 +800,7 @@ class IsNoneOrEmptyOptional:
CATEGORY = "EasyApi/Utils"
DESCRIPTION = "判断输入any是否为None、空列表、空字符串(trim后判断)、空字典,若为true,返回default的值,否则返回输入值"
def execute(self, any, default=None):
def execute(self, any=None, default=None):
if any is None:
return default,
if isinstance(any, (list, tuple)):
@@ -811,7 +811,7 @@ class IsNoneOrEmptyOptional:
return (default if len(any) == 0 else any,)
return (any,)
def check_lazy_status(self, any, default=None):
def check_lazy_status(self, any=None, default=None):
if any is None:
return ["default"]
if isinstance(any, (list, tuple)):
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-easyapi-nodes"
description = "Provides some features and nodes related to API calls."
version = "1.0.7"
version = "1.0.8"
license = { file = "LICENSE" }
dependencies = ["segment_anything", "simple_lama_inpainting", "insightface"]