Merge branch 'main' into pyproject

This commit is contained in:
LA
2024-07-08 12:03:05 +02:00
5 changed files with 1702 additions and 307 deletions
@@ -1,6 +1,6 @@
{
"last_node_id": 14,
"last_link_id": 12,
"last_node_id": 15,
"last_link_id": 15,
"nodes": [
{
"id": 9,
@@ -9,12 +9,12 @@
360,
770
],
"size": [
320,
80
],
"size": {
"0": 320,
"1": 80
},
"flags": {},
"order": 5,
"order": 8,
"mode": 0,
"inputs": [
{
@@ -53,13 +53,13 @@
"1": 80
},
"flags": {},
"order": 8,
"order": 5,
"mode": 0,
"inputs": [
{
"name": "text",
"type": "STRING",
"link": 3,
"link": 15,
"widget": {
"name": "text"
}
@@ -92,13 +92,13 @@
"1": 80
},
"flags": {},
"order": 7,
"order": 4,
"mode": 0,
"inputs": [
{
"name": "text",
"type": "STRING",
"link": 2,
"link": 14,
"widget": {
"name": "text"
}
@@ -132,119 +132,19 @@
"1": 26
},
"flags": {},
"order": 6,
"order": 3,
"mode": 4,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 1
"link": 13
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 6,
"type": "IndustrialMagick",
"pos": [
0,
490
],
"size": [
320,
362
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
9
],
"shape": 3,
"slot_index": 0
},
{
"name": "image_path",
"type": "STRING",
"links": [
5
],
"shape": 3,
"slot_index": 1
},
{
"name": "error",
"type": "STRING",
"links": [
6
],
"shape": 3,
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "IndustrialMagick"
},
"widgets_values": [
true,
10,
"-size",
"320x100",
"xc:lightblue",
"-pointsize",
"36",
"-fill",
"blue",
"-draw",
"text 25,65 'Industrial Magick'",
"E:\\industrial-magick-test.png",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
{
"id": 8,
"type": "ShowText|pysssss",
@@ -252,12 +152,12 @@
360,
640
],
"size": [
320,
80
],
"size": {
"0": 320,
"1": 80
},
"flags": {},
"order": 4,
"order": 7,
"mode": 0,
"inputs": [
{
@@ -282,7 +182,7 @@
},
"widgets_values": [
"",
"E:\\industrial-magick-test.png"
"E:\\ComfyUI_fresh\\ComfyUI\\temp\\ImageMagick_20240629_211755.png"
]
},
{
@@ -292,12 +192,12 @@
710,
490
],
"size": [
320,
290
],
"size": {
"0": 320,
"1": 290
},
"flags": {},
"order": 3,
"order": 6,
"mode": 0,
"inputs": [
{
@@ -327,7 +227,7 @@
"Node name for S&R": "PreviewBridge"
},
"widgets_values": [
"$undefined-0"
"$12-0"
]
},
{
@@ -338,7 +238,7 @@
488.1457233886719
],
"size": {
"0": 210,
"0": 252,
"1": 26
},
"flags": {},
@@ -367,106 +267,6 @@
"Node name for S&R": "IndustrialMagickImageIngest"
}
},
{
"id": 1,
"type": "IndustrialMagick",
"pos": [
0,
30
],
"size": {
"0": 320,
"1": 362
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
1
],
"shape": 3,
"slot_index": 0
},
{
"name": "image_path",
"type": "STRING",
"links": [
2
],
"shape": 3,
"slot_index": 1
},
{
"name": "error",
"type": "STRING",
"links": [
3
],
"shape": 3,
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "IndustrialMagick"
},
"widgets_values": [
false,
10,
"-size",
"320x100",
"xc:lightblue",
"-pointsize",
"36",
"-fill",
"blue",
"-draw",
"text 25,65 'Industrial Magick'",
"E:\\industrial-magick-test.png",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
{
"id": 11,
"type": "ShowText|pysssss",
@@ -474,10 +274,10 @@
1334,
488.1457233886719
],
"size": [
320,
80
],
"size": {
"0": 320,
"1": 80
},
"flags": {},
"order": 10,
"mode": 0,
@@ -504,7 +304,68 @@
},
"widgets_values": [
"",
"E:\\ComfyUI_fresh\\ComfyUI\\temp\\ImageMagick_20240629_002641.png"
"E:\\ComfyUI_fresh\\ComfyUI/temp\\ImageMagick_20240629_211755_cec4ec767fb74f4e84b426a6205571c2.png"
]
},
{
"id": 14,
"type": "PreviewImage",
"pos": [
1690,
613.1457233886728
],
"size": {
"0": 210,
"1": 250
},
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 12
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 5,
"type": "CR Text",
"pos": [
780,
60
],
"size": {
"0": 680,
"1": 96
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "text",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"title": "Sample ImageMagick command",
"properties": {
"Node name for S&R": "CR Text"
},
"widgets_values": [
"magick -size 320x100 xc:lightblue -pointsize 36 -fill blue -draw \"text 25,65 'Industrial Magick'\" text_draw.gif"
]
},
{
@@ -516,7 +377,7 @@
],
"size": [
320,
220
190
],
"flags": {},
"order": 11,
@@ -562,11 +423,12 @@
},
"widgets_values": [
true,
4,
"",
false,
3,
"-rotate",
"-rotate",
"90",
"E:\\industrial-magick-test-rotated.png",
"",
"",
"",
"",
@@ -615,92 +477,209 @@
]
},
{
"id": 14,
"type": "PreviewImage",
"id": 15,
"type": "IndustrialMagick",
"pos": [
1690,
613.1457233886728
0,
10
],
"size": [
210,
250
320,
386
],
"flags": {},
"order": 12,
"order": 1,
"mode": 0,
"inputs": [
"outputs": [
{
"name": "images",
"name": "image",
"type": "IMAGE",
"link": 12
"links": [
13
],
"shape": 3,
"slot_index": 0
},
{
"name": "image_path",
"type": "STRING",
"links": [
14
],
"shape": 3,
"slot_index": 1
},
{
"name": "error",
"type": "STRING",
"links": [
15
],
"shape": 3,
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
"Node name for S&R": "IndustrialMagick"
},
"widgets_values": [
true,
10,
10,
"-size",
"320x100",
"xc:lightblue",
"-pointsize",
"36",
"-fill",
"blue",
"-draw",
"text 25,65 'Industrial Magick'",
"E:\\industrial-magick-test.png",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
{
"id": 5,
"type": "CR Text",
"id": 6,
"type": "IndustrialMagick",
"pos": [
780,
60
0,
490
],
"size": [
680,
96
320,
360
],
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "text",
"type": "*",
"links": null,
"shape": 3
"name": "image",
"type": "IMAGE",
"links": [
9
],
"shape": 3,
"slot_index": 0
},
{
"name": "show_help",
"name": "image_path",
"type": "STRING",
"links": null,
"shape": 3
"links": [
5
],
"shape": 3,
"slot_index": 1
},
{
"name": "error",
"type": "STRING",
"links": [
6
],
"shape": 3,
"slot_index": 2
}
],
"title": "Sample ImageMagick command",
"properties": {
"Node name for S&R": "CR Text"
"Node name for S&R": "IndustrialMagick"
},
"widgets_values": [
"magick -size 320x100 xc:lightblue -pointsize 36 -fill blue -draw \"text 25,65 'Industrial Magick'\" text_draw.gif"
true,
false,
9,
"-size",
"320x100",
"xc:lightblue",
"-pointsize",
"36",
"-fill",
"blue",
"-draw",
"text 25,65 'Industrial Magick'",
"E:\\industrial-magick-test.png",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}
],
"links": [
[
1,
1,
0,
2,
0,
"IMAGE"
],
[
2,
1,
1,
3,
0,
"STRING"
],
[
3,
1,
2,
4,
0,
"STRING"
],
[
5,
6,
@@ -756,6 +735,30 @@
14,
0,
"IMAGE"
],
[
13,
15,
0,
2,
0,
"IMAGE"
],
[
14,
15,
1,
3,
0,
"STRING"
],
[
15,
15,
2,
4,
0,
"STRING"
]
],
"groups": [
@@ -763,9 +766,9 @@
"title": "By default, no image is passed",
"bounding": [
-10,
-44,
-64,
710,
446
470
],
"color": "#3f789e",
"font_size": 24,
@@ -801,8 +804,8 @@
"ds": {
"scale": 0.7513148009015777,
"offset": [
271.0632514000008,
213.48768121772977
264.40825140000055,
288.02368121772975
]
}
},
+786
View File
@@ -0,0 +1,786 @@
{
"last_node_id": 11,
"last_link_id": 17,
"nodes": [
{
"id": 4,
"type": "CR Split String",
"pos": [
10,
230
],
"size": {
"0": 315,
"1": 162
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "string_1",
"type": "*",
"links": [
4
],
"shape": 3,
"slot_index": 0
},
{
"name": "string_2",
"type": "*",
"links": [
5
],
"shape": 3,
"slot_index": 1
},
{
"name": "string_3",
"type": "*",
"links": [],
"shape": 3,
"slot_index": 2
},
{
"name": "string_4",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Split String"
},
"widgets_values": [
"-fx u+#888888",
" "
]
},
{
"id": 7,
"type": "Simple String",
"pos": [
400,
530
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
9
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"rectangle 10,10 190,50"
]
},
{
"id": 8,
"type": "Simple String",
"pos": [
400,
630
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
11
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"rectangle 10,60 190,100"
]
},
{
"id": 9,
"type": "Simple String",
"pos": [
400,
740
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
13
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"rectangle 10,110 190,150"
]
},
{
"id": 10,
"type": "Simple String",
"pos": [
400,
840
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
15
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"rectangle 10,160 190,200"
]
},
{
"id": 3,
"type": "CR Split String",
"pos": [
10,
30
],
"size": {
"0": 315,
"1": 162
},
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "string_1",
"type": "*",
"links": [
1
],
"shape": 3,
"slot_index": 0
},
{
"name": "string_2",
"type": "*",
"links": [
2
],
"shape": 3,
"slot_index": 1
},
{
"name": "string_3",
"type": "*",
"links": [
3
],
"shape": 3,
"slot_index": 2
},
{
"name": "string_4",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Split String"
},
"widgets_values": [
"-size 200x210 xc:black",
" "
]
},
{
"id": 6,
"type": "Simple String",
"pos": [
400,
420
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 6,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
8,
10,
12,
14
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"-draw"
]
},
{
"id": 5,
"type": "CR Split String",
"pos": [
400,
200
],
"size": {
"0": 315,
"1": 162
},
"flags": {},
"order": 7,
"mode": 0,
"outputs": [
{
"name": "string_1",
"type": "*",
"links": [
6
],
"shape": 3,
"slot_index": 0
},
{
"name": "string_2",
"type": "*",
"links": [
7
],
"shape": 3,
"slot_index": 1
},
{
"name": "string_3",
"type": "*",
"links": [],
"shape": 3,
"slot_index": 2
},
{
"name": "string_4",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Split String"
},
"widgets_values": [
"-fill #353535",
" "
]
},
{
"id": 11,
"type": "Simple String",
"pos": [
810,
890
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 8,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
17
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"E:\\test.png"
]
},
{
"id": 2,
"type": "PreviewImage",
"pos": [
1630,
30
],
"size": {
"0": 210,
"1": 250
},
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 16
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 1,
"type": "IndustrialMagick",
"pos": [
1210,
30
],
"size": [
340,
410
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "param_1",
"type": "STRING",
"link": 1,
"widget": {
"name": "param_1"
}
},
{
"name": "param_2",
"type": "STRING",
"link": 2,
"widget": {
"name": "param_2"
}
},
{
"name": "param_3",
"type": "STRING",
"link": 3,
"widget": {
"name": "param_3"
}
},
{
"name": "param_4",
"type": "STRING",
"link": 4,
"widget": {
"name": "param_4"
}
},
{
"name": "param_5",
"type": "STRING",
"link": 5,
"widget": {
"name": "param_5"
}
},
{
"name": "param_6",
"type": "STRING",
"link": 6,
"widget": {
"name": "param_6"
}
},
{
"name": "param_7",
"type": "STRING",
"link": 7,
"widget": {
"name": "param_7"
}
},
{
"name": "param_8",
"type": "STRING",
"link": 8,
"widget": {
"name": "param_8"
}
},
{
"name": "param_9",
"type": "STRING",
"link": 9,
"widget": {
"name": "param_9"
}
},
{
"name": "param_10",
"type": "STRING",
"link": 10,
"widget": {
"name": "param_10"
}
},
{
"name": "param_11",
"type": "STRING",
"link": 11,
"widget": {
"name": "param_11"
}
},
{
"name": "param_12",
"type": "STRING",
"link": 12,
"widget": {
"name": "param_12"
}
},
{
"name": "param_13",
"type": "STRING",
"link": 13,
"widget": {
"name": "param_13"
}
},
{
"name": "param_14",
"type": "STRING",
"link": 14,
"widget": {
"name": "param_14"
}
},
{
"name": "param_15",
"type": "STRING",
"link": 15,
"widget": {
"name": "param_15"
}
},
{
"name": "param_16",
"type": "STRING",
"link": 17,
"widget": {
"name": "param_16"
}
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
16
],
"shape": 3,
"slot_index": 0
},
{
"name": "image_path",
"type": "STRING",
"links": null,
"shape": 3
},
{
"name": "error",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "IndustrialMagick"
},
"widgets_values": [
true,
16,
16,
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}
],
"links": [
[
1,
3,
0,
1,
0,
"STRING"
],
[
2,
3,
1,
1,
1,
"STRING"
],
[
3,
3,
2,
1,
2,
"STRING"
],
[
4,
4,
0,
1,
3,
"STRING"
],
[
5,
4,
1,
1,
4,
"STRING"
],
[
6,
5,
0,
1,
5,
"STRING"
],
[
7,
5,
1,
1,
6,
"STRING"
],
[
8,
6,
0,
1,
7,
"STRING"
],
[
9,
7,
0,
1,
8,
"STRING"
],
[
10,
6,
0,
1,
9,
"STRING"
],
[
11,
8,
0,
1,
10,
"STRING"
],
[
12,
6,
0,
1,
11,
"STRING"
],
[
13,
9,
0,
1,
12,
"STRING"
],
[
14,
6,
0,
1,
13,
"STRING"
],
[
15,
10,
0,
1,
14,
"STRING"
],
[
16,
1,
0,
2,
0,
"IMAGE"
],
[
17,
11,
0,
1,
15,
"STRING"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.7513148009015781,
"offset": [
255.35838607499917,
221.76176418700007
]
}
},
"version": 0.4
}
+597
View File
@@ -0,0 +1,597 @@
{
"last_node_id": 8,
"last_link_id": 9,
"nodes": [
{
"id": 1,
"type": "CR Text",
"pos": [
300,
150
],
"size": {
"0": 400,
"1": 180
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "text",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Text"
},
"widgets_values": [
"magick montage -size 100x20 xc:grey21 -duplicate 10 -tile 2x -geometry +4+4 -background grey53 miff:- | magick -size 224x40 xc:grey53 -fill grey21 -draw \"rectangle 8,8 216,40\" \\( - -bordercolor grey53 -border 4 \\) -append E:\\test.png\n"
]
},
{
"id": 3,
"type": "PreviewImage",
"pos": [
1590,
320
],
"size": {
"0": 210,
"1": 250
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 1
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 4,
"type": "CR Split String",
"pos": [
740,
50
],
"size": {
"0": 315,
"1": 162
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "string_1",
"type": "*",
"links": [
2
],
"shape": 3,
"slot_index": 0
},
{
"name": "string_2",
"type": "*",
"links": [
3
],
"shape": 3,
"slot_index": 1
},
{
"name": "string_3",
"type": "*",
"links": [
4
],
"shape": 3,
"slot_index": 2
},
{
"name": "string_4",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Split String"
},
"widgets_values": [
"-size 224x40 xc:grey53",
" "
]
},
{
"id": 5,
"type": "CR Split String",
"pos": [
740,
260
],
"size": {
"0": 315,
"1": 162
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "string_1",
"type": "*",
"links": [
5
],
"shape": 3,
"slot_index": 0
},
{
"name": "string_2",
"type": "*",
"links": [
6
],
"shape": 3,
"slot_index": 1
},
{
"name": "string_3",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "string_4",
"type": "*",
"links": null,
"shape": 3
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Split String"
},
"widgets_values": [
"-fill grey21",
" "
]
},
{
"id": 6,
"type": "Simple String",
"pos": [
750,
610
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
7
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"-draw"
]
},
{
"id": 7,
"type": "Simple String",
"pos": [
750,
730
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
8
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "Simple String"
},
"widgets_values": [
"rectangle 8,8 216,40"
]
},
{
"id": 8,
"type": "IndustrialMagick",
"pos": [
1220,
320
],
"size": [
320,
462
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "param_1",
"type": "STRING",
"link": 2,
"widget": {
"name": "param_1"
}
},
{
"name": "param_2",
"type": "STRING",
"link": 3,
"widget": {
"name": "param_2"
}
},
{
"name": "param_3",
"type": "STRING",
"link": 4,
"widget": {
"name": "param_3"
}
},
{
"name": "param_4",
"type": "STRING",
"link": 5,
"widget": {
"name": "param_4"
}
},
{
"name": "param_5",
"type": "STRING",
"link": 6,
"widget": {
"name": "param_5"
}
},
{
"name": "param_6",
"type": "STRING",
"link": 7,
"widget": {
"name": "param_6"
}
},
{
"name": "param_7",
"type": "STRING",
"link": 8,
"widget": {
"name": "param_7"
}
},
{
"name": "param_10",
"type": "STRING",
"link": 9,
"widget": {
"name": "param_10"
}
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
1
],
"shape": 3,
"slot_index": 0
},
{
"name": "image_path",
"type": "STRING",
"links": null,
"shape": 3,
"slot_index": 1
},
{
"name": "error",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "IndustrialMagick"
},
"widgets_values": [
true,
false,
17,
"",
"",
"",
"",
"",
"",
"",
"(",
"",
"",
"",
"-bordercolor",
"grey53",
"-border",
"4",
")",
"-append",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
{
"id": 2,
"type": "IndustrialMagick",
"pos": [
330,
450
],
"size": [
320,
530
],
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [],
"shape": 3,
"slot_index": 0
},
{
"name": "image_path",
"type": "STRING",
"links": [
9
],
"shape": 3,
"slot_index": 1
},
{
"name": "error",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "IndustrialMagick"
},
"widgets_values": [
false,
false,
16,
"montage",
"",
"-size",
"100x20",
"xc:grey21",
"",
"",
"",
"-duplicate",
"6",
"-tile",
"2x",
"-geometry",
"+4+4",
"-background",
"grey53",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}
],
"links": [
[
1,
8,
0,
3,
0,
"IMAGE"
],
[
2,
4,
0,
8,
0,
"STRING"
],
[
3,
4,
1,
8,
1,
"STRING"
],
[
4,
4,
2,
8,
2,
"STRING"
],
[
5,
5,
0,
8,
3,
"STRING"
],
[
6,
5,
1,
8,
4,
"STRING"
],
[
7,
6,
0,
8,
5,
"STRING"
],
[
8,
7,
0,
8,
6,
"STRING"
],
[
9,
2,
1,
8,
7,
"STRING"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.6830134553650705,
"offset": [
461.94570000000044,
128.34500000000008
]
}
},
"version": 0.4
}
+22 -13
View File
@@ -4,6 +4,7 @@ import numpy as np
import os
import subprocess
import torch
import uuid
from PIL import Image, ImageOps, ImageSequence
comfy_path = os.path.dirname(folder_paths.__file__)
@@ -21,12 +22,27 @@ def read_image_from_path(image_path):
image = torch.from_numpy(image)[None,]
return image
def get_image_temp_path():
now = datetime.datetime.now()
timestamp = now.strftime("%Y%m%d_%H%M%S")
img_file_name = f'ImageMagick_{timestamp}.png'
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)
img_full_path = f'{tmp_path}/{img_file_name}'
img_full_path = os.path.normpath(img_full_path)
if os.path.exists(img_full_path):
random_suffix = uuid.uuid4().hex
img_file_name = f'ImageMagick_{timestamp}_{random_suffix}.png'
img_full_path = os.path.join(tmp_path, img_file_name)
return img_full_path
class IndustrialMagick:
@classmethod
def INPUT_TYPES(cls):
inputs = {
"required": {
"return_image": ("BOOLEAN", {"default": False}),
"last_param_is_save_path": ("BOOLEAN", {"default": False}),
"param_count": ("INT", {"default": 5, "min": 0, "max": 50, "step": 1})
}
}
@@ -39,12 +55,15 @@ class IndustrialMagick:
FUNCTION = "execute"
CATEGORY = "IndustrialMagick"
def execute(self, return_image, param_count, **kwargs):
def execute(self, return_image, last_param_is_save_path, param_count, **kwargs):
# Extract values from kwargs
params = [kwargs.get(f"param_{i}") for i in range(1, param_count + 1)]
params.insert(0,"magick")
if(last_param_is_save_path is False):
params.append(get_image_temp_path())
filtered_params = [param for param in params if param not in ["",None]]
print(filtered_params)
@@ -76,17 +95,7 @@ class IndustrialMagickImageIngest:
for (batch_number, ii) in enumerate(image):
i = 255. * ii.cpu().numpy()
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
now = datetime.datetime.now()
timestamp = now.strftime("%Y%m%d_%H%M%S")
img_file_name = f'ImageMagick_{timestamp}.png'
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)
img_full_path = f'{tmp_path}/{img_file_name}'
img_full_path = os.path.normpath(img_full_path)
if os.path.exists(img_full_path):
random_suffix = uuid.uuid4().hex
img_file_name = f'ImageMagick_{timestamp}_{random_suffix}.png'
img_full_path = os.path.join(tmp_path, img_file_name)
img_full_path = get_image_temp_path()
img.save(img_full_path)
return (img_full_path,)
@@ -98,4 +107,4 @@ NODE_CLASS_MAPPINGS = {
NODE_DISPLAY_NAME_MAPPINGS = {
"IndustrialMagick": "Industrial Magick",
"IndustrialMagickImageIngest": "Industrial Magick Image Loader"
}
}
+3 -3
View File
@@ -16,9 +16,9 @@ function handleParamVisibility(node, countValue) {
origProps[pname] = { origType: paramWidget.type, origComputeSize: paramWidget.computeSize };
}
if (i <= countValue) {
paramWidget.type = origProps[paramWidget.name].origType;
paramWidget.computeSize = origProps[paramWidget.name].origComputeSize;
if (i <= countValue && !node.inputs?.some?.(input => input.name === pname)) {
paramWidget.type = origProps[pname].origType;
paramWidget.computeSize = origProps[pname].origComputeSize;
}
else {
paramWidget.type = HIDDEN_TAG;