commit TextJoin node

This commit is contained in:
chflame
2024-03-19 11:08:48 +08:00
parent c38330f5c7
commit 8cb6b07774
4 changed files with 53 additions and 0 deletions
+5
View File
@@ -83,6 +83,7 @@ When this error has occurred, please check the network environment.
## Update
<font size="4">**If the dependency package error after updating, please reinstall the relevant dependency packages. for details, please refer to [here](https://github.com/chflame163/ComfyUI_LayerStyle/issues/5). </font><br />
* Commit [TextJoin](#TextJoin) node.
* Commit [PromptEmbellish](#PromptEmbellish) node. it output polished prompt words, and support inputting images as references.
* Ultra nodes have been fully upgraded to V2 version, with the addition of VITMatte edge processing method, which is suitable for handling semi transparent areas. Include [MaskEdgeUltraDetailV2](#MaskEdgeUltraDetailV2), [SegmentAnythingUltraV2](#SegmentAnythingUltraV2), [RmBgUltraV2](#RmBgUltraV2) and [PersonMaskUltraV2](#PersonMaskUltraV2) nodes.
* Commit [Color of Shadow & Highlight](#Highlight) node, it can adjust the color of the dark and bright parts separately. Commit [Shadow & Highlight Mask](#Shadow) node, it can output mask for dark and bright areas.
@@ -883,6 +884,10 @@ Output:
* height: The height of image.
* original_size: The original size data of the image is used for subsequent node recovery.
### <a id="table1">TextJoin</a>
![image](image/text_join_example.png)
Combine multiple paragraphs of text into one.
### <a id="table1">PrintInfo</a>
![image](image/print_info_node.png)
Used to provide assistance for workflow debugging. When running, the properties of any object connected to this node will be printed to the console.
+6
View File
@@ -83,6 +83,7 @@ git clone https://github.com/chflame163/ComfyUI_LayerStyle.git
## 更新说明
<font size="4">**如果本插件更新后出现依赖包错误,请重新安装相关依赖包。详情见[这里](https://github.com/chflame163/ComfyUI_LayerStyle/issues/5)。 </font><br />
* 添加 [TextJoin](#TextJoin) 节点。
* 添加 [PromptEmbellish](#PromptEmbellish) 节点, 对简单的提示词润色,支持图片输入参考,支持中文输入。
* Ultra 节点全面升级到V2版本,增加了VITMatte边缘处理方法,此方法适合处理半透明区域。包括 [MaskEdgeUltraDetailV2](#MaskEdgeUltraDetailV2), [SegmentAnythingUltraV2](#SegmentAnythingUltraV2), [RmBgUltraV2](#RmBgUltraV2) 以及 [PersonMaskUltraV2](#PersonMaskUltraV2) 节点。
* 添加 [Color of Shadow & Highlight](#Highlight) 节点,可对暗部和亮部分别进行色彩调整。添加 [Shadow & Highlight Mask](#Shadow) 节点, 可输出暗部和亮部的遮罩。
@@ -878,6 +879,11 @@ cropped_mask: 裁切后的遮罩。
* height: 图像高度。
* original_size: 图像的原始大小数据,用于后续节点进行恢复。
### <a id="table1">TextJoin</a>
![image](image/text_join_example.png)
将多段文字组合为一段。
### <a id="table1">PrintInfo</a>
![image](image/print_info_node.png)
用于给工作流调试提供辅助。当运行时,任何接上这个节点的对象的属性将被打印到控制台。
Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

+42
View File
@@ -0,0 +1,42 @@
NODE_NAME = 'TextJoin'
class TextJoin:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"text_1": ("STRING", {"multiline": True}),
"text_2": ("STRING", {"multiline": True}),
},
"optional": {
"text_3": ("STRING", {"multiline": True}),
"text_4": ("STRING", {"multiline": True}),
}
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("text",)
FUNCTION = "text_join"
CATEGORY = '😺dzNodes/LayerUtility'
OUTPUT_NODE = True
def text_join(self, **kwargs):
texts = [kwargs[key] for key in kwargs if key.startswith('text')]
combined_text = ', '.join(texts)
return (combined_text,)
NODE_CLASS_MAPPINGS = {
"LayerUtility: TextJoin": TextJoin
}
NODE_DISPLAY_NAME_MAPPINGS = {
"LayerUtility: TextJoin": "LayerUtility: TextJoin"
}