1 Star 1 Fork 0

comfyui_custom_nodes/ComfyUI_LayerStyle

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
icmask_example.json 23.75 KB
一键复制 编辑 原始数据 按行查看 历史
chflame163 提交于 2024-12-15 10:02 +08:00 . Merge crop and resize to ICMarkCropBack node
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389
{
"last_node_id": 441,
"last_link_id": 638,
"nodes": [
{
"id": 11,
"type": "DualCLIPLoader",
"pos": [
-360,
1190
],
"size": [
320,
110
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "CLIP",
"type": "CLIP",
"links": [
28
],
"slot_index": 0,
"shape": 3,
"label": "CLIP"
}
],
"properties": {
"Node name for S&R": "DualCLIPLoader",
"ttNbgOverride": {
"color": "#223",
"bgcolor": "#335",
"groupcolor": "#88A"
}
},
"widgets_values": [
"clip_l.safetensors",
"t5xxl_fp8_e4m3fn.safetensors",
"flux"
]
},
{
"id": 223,
"type": "FluxGuidance",
"pos": [
410,
1580
],
"size": [
317.4000244140625,
58
],
"flags": {},
"order": 15,
"mode": 0,
"inputs": [
{
"name": "conditioning",
"type": "CONDITIONING",
"link": 186,
"label": "conditioning"
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
187
],
"slot_index": 0,
"label": "CONDITIONING"
}
],
"properties": {
"Node name for S&R": "FluxGuidance"
},
"widgets_values": [
30
]
},
{
"id": 333,
"type": "LoadImage",
"pos": [
-917.3848876953125,
1819.9569091796875
],
"size": [
424.71136474609375,
431.0491638183594
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
610,
627
],
"slot_index": 0,
"label": "IMAGE"
},
{
"name": "MASK",
"type": "MASK",
"links": [],
"slot_index": 1,
"label": "MASK"
}
],
"title": "Load Original Image",
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"clipspace/clipspace-mask-1551498.png [input]",
"image"
]
},
{
"id": 170,
"type": "CLIPVisionLoader",
"pos": [
-360,
1060
],
"size": [
331.7705383300781,
58
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
31
],
"slot_index": 0,
"label": "CLIP_VISION"
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"sigclip_vision_patch14_384.safetensors"
]
},
{
"id": 172,
"type": "CLIPVisionEncode",
"pos": [
20,
1070
],
"size": [
307.8326721191406,
78
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "clip_vision",
"type": "CLIP_VISION",
"link": 31,
"label": "clip_vision"
},
{
"name": "image",
"type": "IMAGE",
"link": 608,
"label": "image"
}
],
"outputs": [
{
"name": "CLIP_VISION_OUTPUT",
"type": "CLIP_VISION_OUTPUT",
"links": [
32
],
"slot_index": 0,
"label": "CLIP_VISION_OUTPUT"
}
],
"properties": {
"Node name for S&R": "CLIPVisionEncode"
},
"widgets_values": [
"center"
]
},
{
"id": 103,
"type": "CLIPTextEncode",
"pos": [
20,
1200
],
"size": [
309.6630554199219,
83.49517059326172
],
"flags": {
"collapsed": false
},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 28,
"label": "clip"
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
181,
621
],
"slot_index": 0,
"label": "CONDITIONING"
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
""
]
},
{
"id": 102,
"type": "KSampler",
"pos": [
780,
1060
],
"size": [
315.9761962890625,
277.810546875
],
"flags": {},
"order": 16,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 634,
"label": "model"
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 187,
"label": "positive"
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 184,
"label": "negative"
},
{
"name": "latent_image",
"type": "LATENT",
"link": 185,
"label": "latent_image"
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
11
],
"slot_index": 0,
"shape": 3,
"label": "LATENT"
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
0,
"fixed",
25,
1,
"euler",
"beta",
1
]
},
{
"id": 173,
"type": "StyleModelLoader",
"pos": [
20,
1440
],
"size": [
315,
58
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STYLE_MODEL",
"type": "STYLE_MODEL",
"links": [
33
],
"slot_index": 0,
"label": "STYLE_MODEL"
}
],
"properties": {
"Node name for S&R": "StyleModelLoader"
},
"widgets_values": [
"flux1-redux-dev.safetensors"
]
},
{
"id": 171,
"type": "StyleModelApply",
"pos": [
410,
1390
],
"size": [
311.9229736328125,
122
],
"flags": {},
"order": 14,
"mode": 0,
"inputs": [
{
"name": "conditioning",
"type": "CONDITIONING",
"link": 183,
"label": "conditioning"
},
{
"name": "style_model",
"type": "STYLE_MODEL",
"link": 33,
"label": "style_model"
},
{
"name": "clip_vision_output",
"type": "CLIP_VISION_OUTPUT",
"link": 32,
"label": "clip_vision_output"
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
186
],
"slot_index": 0,
"label": "CONDITIONING"
}
],
"properties": {
"Node name for S&R": "StyleModelApply"
},
"widgets_values": [
1,
"multiply"
]
},
{
"id": 220,
"type": "InpaintModelConditioning",
"pos": [
410,
1190
],
"size": [
315,
138
],
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "positive",
"type": "CONDITIONING",
"link": 181,
"label": "positive"
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 621,
"label": "negative"
},
{
"name": "vae",
"type": "VAE",
"link": 178,
"label": "vae"
},
{
"name": "pixels",
"type": "IMAGE",
"link": 600,
"label": "pixels"
},
{
"name": "mask",
"type": "MASK",
"link": 601,
"label": "mask"
}
],
"outputs": [
{
"name": "positive",
"type": "CONDITIONING",
"links": [
183
],
"slot_index": 0,
"label": "positive"
},
{
"name": "negative",
"type": "CONDITIONING",
"links": [
184
],
"slot_index": 1,
"label": "negative"
},
{
"name": "latent",
"type": "LATENT",
"links": [
185
],
"slot_index": 2,
"label": "latent"
}
],
"properties": {
"Node name for S&R": "InpaintModelConditioning"
},
"widgets_values": [
true
]
},
{
"id": 439,
"type": "UNETLoader",
"pos": [
410,
1050
],
"size": [
315,
82
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
634
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "UNETLoader"
},
"widgets_values": [
"flux1-fill-dev.safetensors",
"default"
]
},
{
"id": 10,
"type": "VAELoader",
"pos": [
-350,
1360
],
"size": [
310,
60
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "VAE",
"type": "VAE",
"links": [
12,
178
],
"slot_index": 0,
"shape": 3,
"label": "VAE"
}
],
"properties": {
"Node name for S&R": "VAELoader",
"ttNbgOverride": {
"color": "#223",
"bgcolor": "#335",
"groupcolor": "#88A"
}
},
"widgets_values": [
"ae.sft"
]
},
{
"id": 106,
"type": "VAEDecode",
"pos": [
1149.213623046875,
1337.4017333984375
],
"size": [
210,
50
],
"flags": {},
"order": 17,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 11,
"label": "samples"
},
{
"name": "vae",
"type": "VAE",
"link": 12,
"label": "vae"
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
283,
593
],
"slot_index": 0,
"label": "IMAGE"
}
],
"properties": {
"Node name for S&R": "VAEDecode",
"ttNbgOverride": {
"color": "#223",
"bgcolor": "#335",
"groupcolor": "#88A"
}
},
"widgets_values": []
},
{
"id": 438,
"type": "LayerMask: MaskGrow",
"pos": [
76.37625122070312,
1873.8795166015625
],
"size": [
315,
106
],
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "mask",
"type": "MASK",
"link": 632
}
],
"outputs": [
{
"name": "mask",
"type": "MASK",
"links": [
633
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "LayerMask: MaskGrow"
},
"widgets_values": [
false,
35,
10
],
"color": "rgba(27, 80, 119, 0.7)"
},
{
"id": 364,
"type": "LayerUtility: CropByMask V2",
"pos": [
76.44383239746094,
2047.63330078125
],
"size": [
314.82220458984375,
262
],
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 628
},
{
"name": "mask",
"type": "MASK",
"link": 633
},
{
"name": "crop_box",
"type": "BOX",
"link": null,
"shape": 7
}
],
"outputs": [
{
"name": "croped_image",
"type": "IMAGE",
"links": [
598
],
"slot_index": 0
},
{
"name": "croped_mask",
"type": "MASK",
"links": [
631
],
"slot_index": 1
},
{
"name": "crop_box",
"type": "BOX",
"links": [
460
],
"slot_index": 2
},
{
"name": "box_preview",
"type": "IMAGE",
"links": null
}
],
"properties": {
"Node name for S&R": "LayerUtility: CropByMask V2"
},
"widgets_values": [
false,
"mask_area",
64,
64,
64,
64,
"None"
],
"color": "rgba(38, 73, 116, 0.7)"
},
{
"id": 436,
"type": "LayerMask: SegmentAnythingUltra V2",
"pos": [
-346.82769775390625,
1879.7652587890625
],
"size": [
390.7541809082031,
366
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 627
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
628
],
"slot_index": 0
},
{
"name": "mask",
"type": "MASK",
"links": [
632
],
"slot_index": 1
}
],
"properties": {
"Node name for S&R": "LayerMask: SegmentAnythingUltra V2"
},
"widgets_values": [
"sam_vit_h (2.56GB)",
"GroundingDINO_SwinT_OGC (694MB)",
0.3,
"VITMatte",
6,
6,
0.15,
0.99,
true,
"fox",
"cuda",
2,
false
],
"color": "rgba(27, 80, 119, 0.7)"
},
{
"id": 252,
"type": "PreviewImage",
"pos": [
1458.465087890625,
1114.813232421875
],
"size": [
394.363037109375,
374.7708740234375
],
"flags": {},
"order": 18,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 283,
"label": "images"
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 229,
"type": "LoadImage",
"pos": [
-912.456787109375,
1296.161376953125
],
"size": [
422.3544921875,
438.38287353515625
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
588,
608
],
"slot_index": 0,
"label": "IMAGE"
},
{
"name": "MASK",
"type": "MASK",
"links": [],
"slot_index": 1,
"label": "MASK"
}
],
"title": "Load Reference Image",
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"girl_dino_1024.png",
"image"
]
},
{
"id": 426,
"type": "LayerUtility: ICMask",
"pos": [
509.5188293457031,
1940.498291015625
],
"size": [
315,
166
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "first_image",
"type": "IMAGE",
"link": 588
},
{
"name": "first_mask",
"type": "MASK",
"link": null,
"shape": 7
},
{
"name": "second_image",
"type": "IMAGE",
"link": 598,
"shape": 7
},
{
"name": "second_mask",
"type": "MASK",
"link": 631,
"shape": 7
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
600
],
"slot_index": 0
},
{
"name": "mask",
"type": "MASK",
"links": [
601
],
"slot_index": 1
},
{
"name": "icmask_data",
"type": "ICMASK_DATA",
"links": [
594
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "LayerUtility: ICMask"
},
"widgets_values": [
"auto",
1536,
"#FF0000"
],
"color": "rgba(38, 73, 116, 0.7)"
},
{
"id": 424,
"type": "PreviewImage",
"pos": [
1759.7010498046875,
1737.902587890625
],
"size": [
607.7578735351562,
616.5079345703125
],
"flags": {},
"order": 21,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 603
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 427,
"type": "LayerUtility: ICMaskCropBack",
"pos": [
909.0380859375,
1974.3905029296875
],
"size": [
260.3999938964844,
46.97600555419922
],
"flags": {},
"order": 19,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 593
},
{
"name": "icmask_data",
"type": "ICMASK_DATA",
"link": 594
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
637
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "LayerUtility: ICMaskCropBack"
},
"widgets_values": [],
"color": "rgba(38, 73, 116, 0.7)"
},
{
"id": 370,
"type": "LayerUtility: RestoreCropBox",
"pos": [
1285.8817138671875,
1942.3494873046875
],
"size": [
365.7912902832031,
118
],
"flags": {},
"order": 20,
"mode": 0,
"inputs": [
{
"name": "background_image",
"type": "IMAGE",
"link": 610
},
{
"name": "croped_image",
"type": "IMAGE",
"link": 637
},
{
"name": "crop_box",
"type": "BOX",
"link": 460
},
{
"name": "croped_mask",
"type": "MASK",
"link": null,
"shape": 7
}
],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
603
],
"slot_index": 0
},
{
"name": "mask",
"type": "MASK",
"links": null
}
],
"properties": {
"Node name for S&R": "LayerUtility: RestoreCropBox"
},
"widgets_values": [
false
],
"color": "rgba(38, 73, 116, 0.7)"
}
],
"links": [
[
11,
102,
0,
106,
0,
"LATENT"
],
[
12,
10,
0,
106,
1,
"VAE"
],
[
28,
11,
0,
103,
0,
"CLIP"
],
[
31,
170,
0,
172,
0,
"CLIP_VISION"
],
[
32,
172,
0,
171,
2,
"CLIP_VISION_OUTPUT"
],
[
33,
173,
0,
171,
1,
"STYLE_MODEL"
],
[
178,
10,
0,
220,
2,
"VAE"
],
[
181,
103,
0,
220,
0,
"CONDITIONING"
],
[
183,
220,
0,
171,
0,
"CONDITIONING"
],
[
184,
220,
1,
102,
2,
"CONDITIONING"
],
[
185,
220,
2,
102,
3,
"LATENT"
],
[
186,
171,
0,
223,
0,
"CONDITIONING"
],
[
187,
223,
0,
102,
1,
"CONDITIONING"
],
[
283,
106,
0,
252,
0,
"IMAGE"
],
[
460,
364,
2,
370,
2,
"BOX"
],
[
588,
229,
0,
426,
0,
"IMAGE"
],
[
593,
106,
0,
427,
0,
"IMAGE"
],
[
594,
426,
2,
427,
1,
"ICMASK_DATA"
],
[
598,
364,
0,
426,
2,
"IMAGE"
],
[
600,
426,
0,
220,
3,
"IMAGE"
],
[
601,
426,
1,
220,
4,
"MASK"
],
[
603,
370,
0,
424,
0,
"IMAGE"
],
[
608,
229,
0,
172,
1,
"IMAGE"
],
[
610,
333,
0,
370,
0,
"IMAGE"
],
[
621,
103,
0,
220,
1,
"CONDITIONING"
],
[
627,
333,
0,
436,
0,
"IMAGE"
],
[
628,
436,
0,
364,
0,
"IMAGE"
],
[
631,
364,
1,
426,
3,
"MASK"
],
[
632,
436,
1,
438,
0,
"MASK"
],
[
633,
438,
0,
364,
1,
"MASK"
],
[
634,
439,
0,
102,
0,
"MODEL"
],
[
637,
427,
0,
370,
1,
"IMAGE"
]
],
"groups": [
{
"id": 1,
"title": "IC Inference",
"bounding": [
-381.93109130859375,
938.3604125976562,
1783.418212890625,
715.2818603515625
],
"color": "#444",
"font_size": 24,
"flags": {}
},
{
"id": 2,
"title": "Crop Subject",
"bounding": [
-373.47540283203125,
1718.31396484375,
807.8248291015625,
615.7630004882812
],
"color": "#444",
"font_size": 24,
"flags": {}
},
{
"id": 3,
"title": "Create IC Mask and Crop back",
"bounding": [
480.09503173828125,
1722.6083984375,
717.63623046875,
606.0999755859375
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 5,
"title": "Restore Subject to Original",
"bounding": [
1245.623291015625,
1726.902587890625,
448.1443176269531,
601.8052368164062
],
"color": "#444",
"font_size": 24,
"flags": {}
}
],
"config": {},
"extra": {
"ds": {
"scale": 0.6830134553650707,
"offset": [
1070.8293436182964,
-836.2221698058116
]
},
"workspace_info": {
"id": "PpSQDIgnsCwzbb2Minf_g",
"saveLock": false,
"cloudID": null,
"coverMediaPath": null
}
},
"version": 0.4
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/comfyui_custom_nodes/ComfyUI_LayerStyle.git
git@gitee.com:comfyui_custom_nodes/ComfyUI_LayerStyle.git
comfyui_custom_nodes
ComfyUI_LayerStyle
ComfyUI_LayerStyle
main

搜索帮助