Word Cloud node add mask output

This commit is contained in:
chflame163
2024-01-16 18:17:57 +08:00
committed by GitHub
parent decfe42068
commit e685edd8a5
8 changed files with 450 additions and 430 deletions
+4
View File
@@ -5,6 +5,9 @@ A plugin to generating word cloud images for ComfyUI, it is the implementation o
[中文说明点这里](./README_CN.MD)
## Update:
* Word Cloud node add mask output.
![image](image/word_cloud_mask.png)
* Add RGB Color Picker node that makes color selection more convenient.
* By editing the font_dir.ini, located in the root directory of the plugin, users can customize the font directory. Every time comfyUI is launched, the *.ttf and *.otf files
@@ -54,6 +57,7 @@ Node options:
Output Type:
image(support alpha channel)
mask
### RGB Color Picker
![image](image/rgb_color_picker.png)
+4
View File
@@ -3,6 +3,9 @@ ComfyUI
![image](image/comfy_wordcloud_advance.png)
## 更新:
* Word Cloud节点增加mask输出。
![image](image/word_cloud_mask.png)
* 增加RGB Color Picker节点,选择颜色更加方便。
* 通过编辑插件根目录下的font_dir.ini,用户可以自定义字体目录。每次启动comfyUI时,这个目录下*.ttf和*.otf文件将收集显示在插件font_path选择项中。
@@ -51,6 +54,7 @@ font_dir.iniĬ
输出:
image(支持alpha通道)
mask
### RGB Color Picker
![image](image/rgb_color_picker.png)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB

+327 -321
View File
@@ -1,110 +1,7 @@
{
"last_node_id": 15,
"last_link_id": 37,
"last_node_id": 18,
"last_link_id": 42,
"nodes": [
{
"id": 7,
"type": "ImageScale",
"pos": [
1384,
493
],
"size": {
"0": 315,
"1": 130
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 13
},
{
"name": "width",
"type": "INT",
"link": 15,
"widget": {
"name": "width"
}
},
{
"name": "height",
"type": "INT",
"link": 16,
"widget": {
"name": "height"
}
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
25
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "ImageScale"
},
"widgets_values": [
"nearest-exact",
512,
512,
"disabled"
]
},
{
"id": 8,
"type": "GetImageSize",
"pos": [
1386,
396
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 23
}
],
"outputs": [
{
"name": "width",
"type": "INT",
"links": [
15
],
"shape": 3,
"slot_index": 0
},
{
"name": "height",
"type": "INT",
"links": [
16
],
"shape": 3,
"slot_index": 1
}
],
"properties": {
"Node name for S&R": "GetImageSize"
}
},
{
"id": 15,
"type": "PreviewImage",
@@ -112,10 +9,10 @@
1377,
29
],
"size": [
326.0002197265626,
305.60007629394534
],
"size": {
"0": 326.0002136230469,
"1": 305.6000671386719
},
"flags": {},
"order": 6,
"mode": 0,
@@ -162,193 +59,6 @@
"C:\\AIRes\\test2.txt"
]
},
{
"id": 14,
"type": "RGB_Picker",
"pos": [
942,
25
],
"size": {
"0": 210,
"1": 94
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "value",
"type": "STRING",
"links": [
36
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "RGB_Picker"
},
"widgets_values": [
"#000000",
"HEX"
]
},
{
"id": 9,
"type": "ComfyWordCloud",
"pos": [
940,
177
],
"size": [
394.4380239257812,
623.7396584472658
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "color_ref_image",
"type": "IMAGE",
"link": 19
},
{
"name": "mask_image",
"type": "IMAGE",
"link": 28
},
{
"name": "text",
"type": "STRING",
"link": 21,
"widget": {
"name": "text"
}
},
{
"name": "background_color",
"type": "STRING",
"link": 36,
"widget": {
"name": "background_color"
}
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
23,
24,
37
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "ComfyWordCloud"
},
"widgets_values": [
"",
512,
512,
4,
0,
"锐字真言体RZZhenYan.ttf",
4,
128,
0.5,
"Oranges",
"#000000",
false,
0.9,
200,
false,
false,
-1,
"的,是,再",
0,
"#000000",
"重,大,新,闻",
60
]
},
{
"id": 13,
"type": "SaveImage",
"pos": [
1731,
35
],
"size": [
673.695284497071,
738.2767741210939
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 35
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 10,
"type": "ImageBlend",
"pos": [
1381,
676
],
"size": {
"0": 315,
"1": 102
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "image1",
"type": "IMAGE",
"link": 24
},
{
"name": "image2",
"type": "IMAGE",
"link": 25
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
35
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "ImageBlend"
},
"widgets_values": [
0.56,
"screen"
]
},
{
"id": 3,
"type": "LoadImage",
@@ -361,7 +71,7 @@
"1": 314
},
"flags": {},
"order": 2,
"order": 1,
"mode": 0,
"outputs": [
{
@@ -436,6 +146,302 @@
10,
"none"
]
},
{
"id": 14,
"type": "RGB_Picker",
"pos": [
941,
26
],
"size": {
"0": 210,
"1": 94
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "value",
"type": "STRING",
"links": [
36
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "RGB_Picker"
},
"widgets_values": [
"#ffffff",
"HEX"
]
},
{
"id": 9,
"type": "ComfyWordCloud",
"pos": [
940,
177
],
"size": {
"0": 394.4380187988281,
"1": 623.7396850585938
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "color_ref_image",
"type": "IMAGE",
"link": 19
},
{
"name": "mask_image",
"type": "IMAGE",
"link": 28
},
{
"name": "text",
"type": "STRING",
"link": 21,
"widget": {
"name": "text"
}
},
{
"name": "background_color",
"type": "STRING",
"link": 36,
"widget": {
"name": "background_color"
}
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
23,
37,
42
],
"shape": 3,
"slot_index": 0
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "ComfyWordCloud"
},
"widgets_values": [
"",
512,
512,
4,
0,
"锐字真言体RZZhenYan.ttf",
4,
128,
0.5,
"Oranges",
"#000000",
true,
0.9,
200,
false,
false,
-1,
"的,是,再",
0,
"#000000",
"重,大,新,闻",
60
]
},
{
"id": 13,
"type": "SaveImage",
"pos": [
1731,
35
],
"size": [
678.1050823120122,
754.5836868286134
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 40
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 8,
"type": "GetImageSize",
"pos": [
1383,
391
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 23
}
],
"outputs": [
{
"name": "width",
"type": "INT",
"links": [
15
],
"shape": 3,
"slot_index": 0
},
{
"name": "height",
"type": "INT",
"links": [
16
],
"shape": 3,
"slot_index": 1
}
],
"properties": {
"Node name for S&R": "GetImageSize"
}
},
{
"id": 7,
"type": "ImageScale",
"pos": [
1379,
493
],
"size": {
"0": 315,
"1": 130
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 13
},
{
"name": "width",
"type": "INT",
"link": 15,
"widget": {
"name": "width"
}
},
{
"name": "height",
"type": "INT",
"link": 16,
"widget": {
"name": "height"
}
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
41
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "ImageScale"
},
"widgets_values": [
"nearest-exact",
512,
512,
"disabled"
]
},
{
"id": 18,
"type": "Image Blending Mode",
"pos": [
1379,
684
],
"size": {
"0": 315,
"1": 102
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "image_a",
"type": "IMAGE",
"link": 42
},
{
"name": "image_b",
"type": "IMAGE",
"link": 41
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
40
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Image Blending Mode"
},
"widgets_values": [
"add",
0.55
]
}
],
"links": [
@@ -487,22 +493,6 @@
0,
"IMAGE"
],
[
24,
9,
0,
10,
0,
"IMAGE"
],
[
25,
7,
0,
10,
1,
"IMAGE"
],
[
27,
3,
@@ -519,14 +509,6 @@
1,
"IMAGE"
],
[
35,
10,
0,
13,
0,
"IMAGE"
],
[
36,
14,
@@ -542,6 +524,30 @@
15,
0,
"IMAGE"
],
[
40,
18,
0,
13,
0,
"IMAGE"
],
[
41,
7,
0,
18,
1,
"IMAGE"
],
[
42,
9,
0,
18,
0,
"IMAGE"
]
],
"groups": [],
+115 -109
View File
@@ -1,110 +1,116 @@
{
"last_node_id": 2,
"last_link_id": 1,
"nodes": [
{
"id": 1,
"type": "ComfyWordCloud",
"pos": [
971,
304
],
"size": [
439.34042327880866,
655.6006048583986
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"name": "color_ref_image",
"type": "IMAGE",
"link": null
},
{
"name": "mask_image",
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
1
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "ComfyWordCloud"
},
"widgets_values": [
"据国家铁路局消息,近年来,随着铁路建设不断推进,我国铁路网越织越密,“八纵八横”高速铁路网主通道已建成约80%,普速铁路网不断完善。与此同时,铁路运输服务正由“走得了”“运得出”向“走得好”“运得畅”转变。我国铁路客运周转量、货物发送量、货运周转量以及运输密度均居世界首位;复兴号实现对31个省份全覆盖;客运服务市场化、便利化、信息化加速推进,建成世界规模最大的铁路互联网售票系统;货运产品供给不断优化,重载运输、快运货物班列、集装箱、冷链运输、高铁快运全面发展,实现运输服务品质全面跃升。",
512,
512,
1,
0,
"c:\\font.ttf",
4,
128,
0.5,
"viridis",
"#FFFFFF",
false,
1,
200,
false,
false,
-1,
"",
0,
"#000000",
"重 大 新 闻",
60
]
},
{
"id": 2,
"type": "PreviewImage",
"pos": [
1488,
305
],
"size": [
398.4970375366213,
362.77627069091807
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 1
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
}
],
"links": [
[
1,
1,
0,
2,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
{
"last_node_id": 2,
"last_link_id": 1,
"nodes": [
{
"id": 2,
"type": "PreviewImage",
"pos": [
1488,
305
],
"size": {
"0": 398.4970397949219,
"1": 362.7762756347656
},
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 1
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 1,
"type": "ComfyWordCloud",
"pos": [
971,
304
],
"size": {
"0": 439.3404235839844,
"1": 655.6005859375
},
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"name": "color_ref_image",
"type": "IMAGE",
"link": null
},
{
"name": "mask_image",
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
1
],
"shape": 3,
"slot_index": 0
},
{
"name": "mask",
"type": "MASK",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "ComfyWordCloud"
},
"widgets_values": [
"据国家铁路局消息,近年来,随着铁路建设不断推进,我国铁路网越织越密,“八纵八横”高速铁路网主通道已建成约80%,普速铁路网不断完善。与此同时,铁路运输服务正由“走得了”“运得出”向“走得好”“运得畅”转变。我国铁路客运周转量、货物发送量、货运周转量以及运输密度均居世界首位;复兴号实现对31个省份全覆盖;客运服务市场化、便利化、信息化加速推进,建成世界规模最大的铁路互联网售票系统;货运产品供给不断优化,重载运输、快运货物班列、集装箱、冷链运输、高铁快运全面发展,实现运输服务品质全面跃升。",
512,
512,
1,
0,
"Alibaba-PuHuiTi-Heavy.ttf",
4,
128,
0.5,
"viridis",
"#FFFFFF",
false,
1,
200,
false,
false,
-1,
"",
0,
"#000000",
"重 大 新 闻",
60
]
}
],
"links": [
[
1,
1,
0,
2,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}