1 Star 0 Fork 15

雪狐/ComfyUI_Lam_1

forked from yanlang0123/ComfyUI_Lam 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MultiTextConcatenate.py 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
马噥 提交于 2024-04-13 13:13 +08:00 . 新增节点 功能优化
class MultiTextConcatenate:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"linebreak_addition": (['false', 'true'],),
"text0": ("STRING", {"forceInput": True}),
"text1": ("STRING", {"forceInput": True}),
},
"optional": {
"delimiter": ('STRING', {"forceInput": False}),
}
}
RETURN_TYPES = ("STRING","LIST",)
FUNCTION = "text_concatenate"
CATEGORY = "lam"
def text_concatenate(self, linebreak_addition='false', delimiter='',**kwargs):
# Initialize return_text with text_
def append_text(base_text, new_text):
if linebreak_addition == 'true':
return base_text + delimiter + "\n" + new_text
else:
return base_text + delimiter + new_text
return_text=''
strList=[]
for arg in kwargs:
if type(kwargs[arg]) != str:
continue
if arg.startswith('text'):
strList.append(kwargs[arg])
if return_text=='':
return_text = kwargs[arg]
else:
return_text = append_text(return_text, kwargs[arg])
return (return_text,strList, )
NODE_CLASS_MAPPINGS = {
"MultiTextConcatenate": MultiTextConcatenate
}
NODE_DISPLAY_NAME_MAPPINGS = {
"MultiTextConcatenate": "多文本联合"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/assassindesign/ComfyUI_Lam_1.git
git@gitee.com:assassindesign/ComfyUI_Lam_1.git
assassindesign
ComfyUI_Lam_1
ComfyUI_Lam_1
cu121

搜索帮助