工作流 /
节点基础 /
遮罩操作、合并与合成

遮罩操作、合并与合成
Mask Operations, Combining & Compositing
核心图像和遮罩节点的交互式演练——创建和优化遮罩,通过不同操作组合重叠遮罩,并使用羽化遮罩合成图像。无需模型。
节点基础
41 个节点 1 个输入 37 次使用 ComfyUI ≥ 0.3.30 ComfyUI 39 KB
节点构成
MaskPreview
× 14
MaskComposite
× 7
PreviewImage
× 4
MarkdownNote
× 4
EmptyImage
× 2
SolidMask
× 2
FeatherMask
× 2
LoadImage
× 1
ImageToMask
× 1
ThresholdMask
× 1
MaskToImage
× 1
InvertMask
× 1
ImageCompositeMasked
× 1
官方标注的模型
None
工作流 JSON
和上面「下载工作流 JSON」是同一份文件。
1{
2 "id": "5daaadda-685f-4474-a217-0293b398936b",
3 "revision": 0,
4 "last_node_id": 403,
5 "last_link_id": 742,
6 "nodes": [
7 {
8 "id": 326,
9 "type": "PreviewImage",
10 "pos": [
11 -2140,
12 4400
13 ],
14 "size": [
15 250,
16 310
17 ],
18 "flags": [],
19 "order": 28,
20 "mode": 0,
21 "inputs": [
22 {
23 "name": "images",
24 "type": "IMAGE",
25 "link": 634
26 }
27 ],
28 "outputs": [],
29 "properties": {
30 "enableTabs": false,
31 "tabWidth": 65,
32 "tabXOffset": 10,
33 "hasSecondTab": false,
34 "secondTabText": "Send Back",
35 "secondTabOffset": 80,
36 "secondTabWidth": 65,
37 "cnr_id": "comfy-core",
38 "ver": "0.22.0",
39 "Node name for S&R": "PreviewImage"
40 },
41 "widgets_values": []
42 },
43 {
44 "id": 369,
45 "type": "MaskPreview",
46 "pos": [
47 -3240,
48 8120
49 ],
50 "size": [
51 270,
52 310
53 ],
54 "flags": [],
55 "order": 13,
56 "mode": 0,
57 "inputs": [
58 {
59 "name": "mask",
60 "type": "MASK",
61 "link": 724
62 }
63 ],
64 "outputs": [],
65 "properties": {
66 "enableTabs": false,
67 "tabWidth": 65,
68 "tabXOffset": 10,
69 "hasSecondTab": false,
70 "secondTabText": "Send Back",
71 "secondTabOffset": 80,
72 "secondTabWidth": 65,
73 "cnr_id": "comfy-core",
74 "ver": "0.22.0",
75 "Node name for S&R": "MaskPreview"
76 },
77 "widgets_values": []
78 },
79 {
80 "id": 367,
81 "type": "PreviewImage",
82 "pos": [
83 -2730,
84 6470
85 ],
86 "size": [
87 270,
88 310
89 ],
90 "flags": [],
91 "order": 15,
92 "mode": 0,
93 "inputs": [
94 {
95 "name": "images",
96 "type": "IMAGE",
97 "link": 681
98 }
99 ],
100 "outputs": [],
101 "properties": {
102 "enableTabs": false,
103 "tabWidth": 65,
104 "tabXOffset": 10,
105 "hasSecondTab": false,
106 "secondTabText": "Send Back",
107 "secondTabOffset": 80,
108 "secondTabWidth": 65,
109 "cnr_id": "comfy-core",
110 "ver": "0.22.0",
111 "Node name for S&R": "PreviewImage"
112 },
113 "widgets_values": []
114 },
115 {
116 "id": 2,
117 "type": "PreviewImage",
118 "pos": [
119 -3970,
120 6060
121 ],
122 "size": [
123 250,
124 310
125 ],
126 "flags": [],
127 "order": 9,
128 "mode": 0,
129 "inputs": [
130 {
131 "name": "images",
132 "type": "IMAGE",
133 "link": 676
134 }
135 ],
136 "outputs": [],
137 "properties": {
138 "enableTabs": false,
139 "tabWidth": 65,
140 "tabXOffset": 10,
141 "hasSecondTab": false,
142 "secondTabText": "Send Back",
143 "secondTabOffset": 80,
144 "secondTabWidth": 65,
145 "cnr_id": "comfy-core",
146 "ver": "0.22.0",
147 "Node name for S&R": "PreviewImage"
148 },
149 "widgets_values": []
150 },
151 {
152 "id": 1,
153 "type": "EmptyImage",
154 "pos": [
155 -3980,
156 5760
157 ],
158 "size": [
159 270,
160 200
161 ],
162 "flags": [],
163 "order": 0,
164 "mode": 0,
165 "inputs": [],
166 "outputs": [
167 {
168 "name": "IMAGE",
169 "type": "IMAGE",
170 "links": [
171 676,
172 677,
173 679
174 ]
175 }
176 ],
177 "properties": {
178 "enableTabs": false,
179 "tabWidth": 65,
180 "tabXOffset": 10,
181 "hasSecondTab": false,
182 "secondTabText": "Send Back",
183 "secondTabOffset": 80,
184 "secondTabWidth": 65,
185 "cnr_id": "comfy-core",
186 "ver": "0.22.0",
187 "Node name for S&R": "EmptyImage"
188 },
189 "widgets_values": [
190 1024,
191 1024,
192 1,
193 0
194 ]
195 },
196 {
197 "id": 374,
198 "type": "LoadImage",
199 "pos": [
200 -3970,
201 6570
202 ],
203 "size": [
204 290,
205 370
206 ],
207 "flags": [],
208 "order": 1,
209 "mode": 0,
210 "inputs": [],
211 "outputs": [
212 {
213 "name": "IMAGE",
214 "type": "IMAGE",
215 "links": null
216 },
217 {
218 "name": "MASK",
219 "type": "MASK",
220 "links": null
221 }
222 ],
223 "properties": {
224 "enableTabs": false,
225 "tabWidth": 65,
226 "tabXOffset": 10,
227 "hasSecondTab": false,
228 "secondTabText": "Send Back",
229 "secondTabOffset": 80,
230 "secondTabWidth": 65,
231 "cnr_id": "comfy-core",
232 "ver": "0.22.0",
233 "Node name for S&R": "LoadImage"
234 },
235 "widgets_values": [
236 "example.png",
237 "image"
238 ]
239 },
240 {
241 "id": 376,
242 "type": "MaskComposite",
243 "pos": [
244 -2210,
245 7710
246 ],
247 "size": [
248 270,
249 200
250 ],
251 "flags": [],
252 "order": 22,
253 "mode": 0,
254 "inputs": [
255 {
256 "name": "destination",
257 "type": "MASK",
258 "link": 720
259 },
260 {
261 "name": "source",
262 "type": "MASK",
263 "link": 727
264 }
265 ],
266 "outputs": [
267 {
268 "name": "MASK",
269 "type": "MASK",
270 "links": [
271 694
272 ]
273 }
274 ],
275 "properties": {
276 "enableTabs": false,
277 "tabWidth": 65,
278 "tabXOffset": 10,
279 "hasSecondTab": false,
280 "secondTabText": "Send Back",
281 "secondTabOffset": 80,
282 "secondTabWidth": 65,
283 "cnr_id": "comfy-core",
284 "ver": "0.22.0",
285 "Node name for S&R": "MaskComposite"
286 },
287 "widgets_values": [
288 256,
289 256,
290 "multiply"
291 ]
292 },
293 {
294 "id": 378,
295 "type": "MaskPreview",
296 "pos": [
297 -1480,
298 7710
299 ],
300 "size": [
301 230,
302 310
303 ],
304 "flags": [],
305 "order": 34,
306 "mode": 0,
307 "inputs": [
308 {
309 "name": "mask",
310 "type": "MASK",
311 "link": 694
312 }
313 ],
314 "outputs": [],
315 "properties": {
316 "enableTabs": false,
317 "tabWidth": 65,
318 "tabXOffset": 10,
319 "hasSecondTab": false,
320 "secondTabText": "Send Back",
321 "secondTabOffset": 80,
322 "secondTabWidth": 65,
323 "cnr_id": "comfy-core",
324 "ver": "0.22.0",
325 "Node name for S&R": "MaskPreview"
326 },
327 "widgets_values": []
328 },
329 {
330 "id": 380,
331 "type": "SolidMask",
332 "pos": [
333 -3240,
334 8510
335 ],
336 "size": [
337 270,
338 170
339 ],
340 "flags": [],
341 "order": 2,
342 "mode": 0,
343 "inputs": [],
344 "outputs": [
345 {
346 "name": "MASK",
347 "type": "MASK",
348 "links": [
349 732,
350 734,
351 736
352 ]
353 }
354 ],
355 "properties": {
356 "enableTabs": false,
357 "tabWidth": 65,
358 "tabXOffset": 10,
359 "hasSecondTab": false,
360 "secondTabText": "Send Back",
361 "secondTabOffset": 80,
362 "secondTabWidth": 65,
363 "cnr_id": "comfy-core",
364 "ver": "0.22.0",
365 "Node name for S&R": "SolidMask"
366 },
367 "widgets_values": [
368 1,
369 512,
370 512
371 ]
372 },
373 {
374 "id": 381,
375 "type": "MaskPreview",
376 "pos": [
377 -3240,
378 8770
379 ],
380 "size": [
381 270,
382 310
383 ],
384 "flags": [],
385 "order": 11,
386 "mode": 0,
387 "inputs": [
388 {
389 "name": "mask",
390 "type": "MASK",
391 "link": 732
392 }
393 ],
394 "outputs": [],
395 "properties": {
396 "enableTabs": false,
397 "tabWidth": 65,
398 "tabXOffset": 10,
399 "hasSecondTab": false,
400 "secondTabText": "Send Back",
401 "secondTabOffset": 80,
402 "secondTabWidth": 65,
403 "cnr_id": "comfy-core",
404 "ver": "0.22.0",
405 "Node name for S&R": "MaskPreview"
406 },
407 "widgets_values": []
408 },
409 {
410 "id": 383,
411 "type": "MaskComposite",
412 "pos": [
413 -2760,
414 7770
415 ],
416 "size": [
417 270,
418 200
419 ],
420 "flags": [],
421 "order": 12,
422 "mode": 0,
423 "inputs": [
424 {
425 "name": "destination",
426 "type": "MASK",
427 "link": 703
428 },
429 {
430 "name": "source",
431 "type": "MASK",
432 "link": 736
433 }
434 ],
435 "outputs": [
436 {
437 "name": "MASK",
438 "type": "MASK",
439 "links": [
440 705,
441 717,
442 720,
443 721,
444 722,
445 723,
446 737
447 ]
448 }
449 ],
450 "properties": {
451 "enableTabs": false,
452 "tabWidth": 65,
453 "tabXOffset": 10,
454 "hasSecondTab": false,
455 "secondTabText": "Send Back",
456 "secondTabOffset": 80,
457 "secondTabWidth": 65,
458 "cnr_id": "comfy-core",
459 "ver": "0.22.0",
460 "Node name for S&R": "MaskComposite"
461 },
462 "widgets_values": [
463 128,
464 128,
465 "add"
466 ]
467 },
468 {
469 "id": 384,
470 "type": "MaskPreview",
471 "pos": [
472 -2750,
473 8030
474 ],
475 "size": [
476 270,
477 400
478 ],
479 "flags": [],
480 "order": 20,
481 "mode": 0,
482 "inputs": [
483 {
484 "name": "mask",
485 "type": "MASK",
486 "link": 705
487 }
488 ],
489 "outputs": [],
490 "properties": {
491 "enableTabs": false,
492 "tabWidth": 65,
493 "tabXOffset": 10,
494 "hasSecondTab": false,
495 "secondTabText": "Send Back",
496 "secondTabOffset": 80,
497 "secondTabWidth": 65,
498 "cnr_id": "comfy-core",
499 "ver": "0.22.0",
500 "Node name for S&R": "MaskPreview"
501 },
502 "widgets_values": []
503 },
504 {
505 "id": 387,
506 "type": "MaskComposite",
507 "pos": [
508 -2210,
509 8100
510 ],
511 "size": [
512 270,
513 200
514 ],
515 "flags": [],
516 "order": 23,
517 "mode": 0,
518 "inputs": [
519 {
520 "name": "destination",
521 "type": "MASK",
522 "link": 721
523 },
524 {
525 "name": "source",
526 "type": "MASK",
527 "link": 729
528 }
529 ],
530 "outputs": [
531 {
532 "name": "MASK",
533 "type": "MASK",
534 "links": [
535 709
536 ]
537 }
538 ],
539 "properties": {
540 "enableTabs": false,
541 "tabWidth": 65,
542 "tabXOffset": 10,
543 "hasSecondTab": false,
544 "secondTabText": "Send Back",
545 "secondTabOffset": 80,
546 "secondTabWidth": 65,
547 "cnr_id": "comfy-core",
548 "ver": "0.22.0",
549 "Node name for S&R": "MaskComposite"
550 },
551 "widgets_values": [
552 256,
553 256,
554 "and"
555 ]
556 },
557 {
558 "id": 388,
559 "type": "MaskPreview",
560 "pos": [
561 -1480,
562 8100
563 ],
564 "size": [
565 230,
566 310
567 ],
568 "flags": [],
569 "order": 35,
570 "mode": 0,
571 "inputs": [
572 {
573 "name": "mask",
574 "type": "MASK",
575 "link": 709
576 }
577 ],
578 "outputs": [],
579 "properties": {
580 "enableTabs": false,
581 "tabWidth": 65,
582 "tabXOffset": 10,
583 "hasSecondTab": false,
584 "secondTabText": "Send Back",
585 "secondTabOffset": 80,
586 "secondTabWidth": 65,
587 "cnr_id": "comfy-core",
588 "ver": "0.22.0",
589 "Node name for S&R": "MaskPreview"
590 },
591 "widgets_values": []
592 },
593 {
594 "id": 389,
595 "type": "MaskComposite",
596 "pos": [
597 -2210,
598 8500
599 ],
600 "size": [
601 270,
602 200
603 ],
604 "flags": [],
605 "order": 24,
606 "mode": 0,
607 "inputs": [
608 {
609 "name": "destination",
610 "type": "MASK",
611 "link": 722
612 },
613 {
614 "name": "source",
615 "type": "MASK",
616 "link": 730
617 }
618 ],
619 "outputs": [
620 {
621 "name": "MASK",
622 "type": "MASK",
623 "links": [
624 712
625 ]
626 }
627 ],
628 "properties": {
629 "enableTabs": false,
630 "tabWidth": 65,
631 "tabXOffset": 10,
632 "hasSecondTab": false,
633 "secondTabText": "Send Back",
634 "secondTabOffset": 80,
635 "secondTabWidth": 65,
636 "cnr_id": "comfy-core",
637 "ver": "0.22.0",
638 "Node name for S&R": "MaskComposite"
639 },
640 "widgets_values": [
641 256,
642 256,
643 "or"
644 ]
645 },
646 {
647 "id": 390,
648 "type": "MaskPreview",
649 "pos": [
650 -1480,
651 8500
652 ],
653 "size": [
654 230,
655 310
656 ],
657 "flags": [],
658 "order": 36,
659 "mode": 0,
660 "inputs": [
661 {
662 "name": "mask",
663 "type": "MASK",
664 "link": 712
665 }
666 ],
667 "outputs": [],
668 "properties": {
669 "enableTabs": false,
670 "tabWidth": 65,
671 "tabXOffset": 10,
672 "hasSecondTab": false,
673 "secondTabText": "Send Back",
674 "secondTabOffset": 80,
675 "secondTabWidth": 65,
676 "cnr_id": "comfy-core",
677 "ver": "0.22.0",
678 "Node name for S&R": "MaskPreview"
679 },
680 "widgets_values": []
681 },
682 {
683 "id": 391,
684 "type": "MaskComposite",
685 "pos": [
686 -2210,
687 8890
688 ],
689 "size": [
690 270,
691 200
692 ],
693 "flags": [],
694 "order": 25,
695 "mode": 0,
696 "inputs": [
697 {
698 "name": "destination",
699 "type": "MASK",
700 "link": 723
701 },
702 {
703 "name": "source",
704 "type": "MASK",
705 "link": 731
706 }
707 ],
708 "outputs": [
709 {
710 "name": "MASK",
711 "type": "MASK",
712 "links": [
713 715
714 ]
715 }
716 ],
717 "properties": {
718 "enableTabs": false,
719 "tabWidth": 65,
720 "tabXOffset": 10,
721 "hasSecondTab": false,
722 "secondTabText": "Send Back",
723 "secondTabOffset": 80,
724 "secondTabWidth": 65,
725 "cnr_id": "comfy-core",
726 "ver": "0.22.0",
727 "Node name for S&R": "MaskComposite"
728 },
729 "widgets_values": [
730 256,
731 256,
732 "xor"
733 ]
734 },
735 {
736 "id": 392,
737 "type": "MaskPreview",
738 "pos": [
739 -1480,
740 8890
741 ],
742 "size": [
743 230,
744 310
745 ],
746 "flags": [],
747 "order": 37,
748 "mode": 0,
749 "inputs": [
750 {
751 "name": "mask",
752 "type": "MASK",
753 "link": 715
754 }
755 ],
756 "outputs": [],
757 "properties": {
758 "enableTabs": false,
759 "tabWidth": 65,
760 "tabXOffset": 10,
761 "hasSecondTab": false,
762 "secondTabText": "Send Back",
763 "secondTabOffset": 80,
764 "secondTabWidth": 65,
765 "cnr_id": "comfy-core",
766 "ver": "0.22.0",
767 "Node name for S&R": "MaskPreview"
768 },
769 "widgets_values": []
770 },
771 {
772 "id": 395,
773 "type": "MarkdownNote",
774 "pos": [
775 -3300,
776 5750
777 ],
778 "size": [
779 380,
780 460
781 ],
782 "flags": [],
783 "order": 3,
784 "mode": 0,
785 "inputs": [],
786 "outputs": [],
787 "title": "Note: Image & Mask Compositing",
788 "properties": [],
789 "widgets_values": [
790 "Paste one image onto another — the **mask** decides where the overlay appears.\n\n**Empty Image** creates a quick test image (set width, height, and color).\n\n**Image Composite Masked** blends the source onto the destination at position x/y. Only the white area of the mask shows the overlay. Toggle *resize source* to stretch the source to match the destination size.\n\nThe mask here comes from the **Combine Masks** section below, passed through **Feather Mask** first — check the mask preview on the right to see the softened edges before compositing.\n\nRun the workflow and check the large **Preview Image** for the final result."
791 ],
792 "color": "#222",
793 "bgcolor": "#000"
794 },
795 {
796 "id": 396,
797 "type": "MarkdownNote",
798 "pos": [
799 -3290,
800 4310
801 ],
802 "size": [
803 380,
804 460
805 ],
806 "flags": [],
807 "order": 4,
808 "mode": 0,
809 "inputs": [],
810 "outputs": [],
811 "title": "Note: Mask Operations",
812 "properties": [],
813 "widgets_values": [
814 "Masks are grayscale maps — **white** = active, **black** = inactive. They control *where* an effect applies.\n\nThis section walks through common mask tools:\n\n- **Image to Mask** — pull a mask from an image channel (red / green / blue / alpha)\n- **Mask to Image** — turn a mask into a visible grayscale image\n- **Invert Mask** — swap active and inactive areas\n- **Threshold Mask** — snap soft values to hard black/white using a cutoff\n- **Feather Mask** — fade the edges (set fade amount per side: left, top, right, bottom)\n\nUse **Preview Mask** nodes along the chain to inspect each step. Queue the workflow and follow left to right to see how a mask is built and refined."
815 ],
816 "color": "#222",
817 "bgcolor": "#000"
818 },
819 {
820 "id": 397,
821 "type": "MarkdownNote",
822 "pos": [
823 -3260,
824 7310
825 ],
826 "size": [
827 380,
828 460
829 ],
830 "flags": [],
831 "order": 5,
832 "mode": 0,
833 "inputs": [],
834 "outputs": [],
835 "title": "Note: Combine Masks",
836 "properties": [],
837 "widgets_values": [
838 "Two masks are built on a gray canvas, then merged with different operations to show how each mode behaves.\n\n**Setup:** A gray **Solid Mask** (0.5) acts as the canvas. Two white squares are placed at different positions using **Combine Masks** with *add* — preview these first to see each shape.\n\n**Compare operations** on the overlapping pair (same x/y offset on each row):\n\n- **multiply** — keeps only where both masks overlap\n- **add** — brightens the overlapping area\n- **and** — white only where both are active\n- **or** — merges both shapes together\n- **xor** — keeps areas that don't overlap\n\nEach row has a **Preview Mask** — compare them side by side to see the difference."
839 ],
840 "color": "#222",
841 "bgcolor": "#000"
842 },
843 {
844 "id": 398,
845 "type": "MaskComposite",
846 "pos": [
847 -2720,
848 8500
849 ],
850 "size": [
851 270,
852 200
853 ],
854 "flags": [],
855 "order": 14,
856 "mode": 0,
857 "inputs": [
858 {
859 "name": "destination",
860 "type": "MASK",
861 "link": 733
862 },
863 {
864 "name": "source",
865 "type": "MASK",
866 "link": 734
867 }
868 ],
869 "outputs": [
870 {
871 "name": "MASK",
872 "type": "MASK",
873 "links": [
874 727,
875 729,
876 730,
877 731,
878 735,
879 738
880 ]
881 }
882 ],
883 "properties": {
884 "enableTabs": false,
885 "tabWidth": 65,
886 "tabXOffset": 10,
887 "hasSecondTab": false,
888 "secondTabText": "Send Back",
889 "secondTabOffset": 80,
890 "secondTabWidth": 65,
891 "cnr_id": "comfy-core",
892 "ver": "0.22.0",
893 "Node name for S&R": "MaskComposite"
894 },
895 "widgets_values": [
896 512,
897 512,
898 "add"
899 ]
900 },
901 {
902 "id": 399,
903 "type": "MaskPreview",
904 "pos": [
905 -2710,
906 8760
907 ],
908 "size": [
909 270,
910 400
911 ],
912 "flags": [],
913 "order": 26,
914 "mode": 0,
915 "inputs": [
916 {
917 "name": "mask",
918 "type": "MASK",
919 "link": 735
920 }
921 ],
922 "outputs": [],
923 "properties": {
924 "enableTabs": false,
925 "tabWidth": 65,
926 "tabXOffset": 10,
927 "hasSecondTab": false,
928 "secondTabText": "Send Back",
929 "secondTabOffset": 80,
930 "secondTabWidth": 65,
931 "cnr_id": "comfy-core",
932 "ver": "0.22.0",
933 "Node name for S&R": "MaskPreview"
934 },
935 "widgets_values": []
936 },
937 {
938 "id": 400,
939 "type": "MaskComposite",
940 "pos": [
941 -2210,
942 7320
943 ],
944 "size": [
945 270,
946 200
947 ],
948 "flags": [],
949 "order": 27,
950 "mode": 0,
951 "inputs": [
952 {
953 "name": "destination",
954 "type": "MASK",
955 "link": 737
956 },
957 {
958 "name": "source",
959 "type": "MASK",
960 "link": 738
961 }
962 ],
963 "outputs": [
964 {
965 "name": "MASK",
966 "type": "MASK",
967 "links": [
968 739
969 ]
970 }
971 ],
972 "properties": {
973 "enableTabs": false,
974 "tabWidth": 65,
975 "tabXOffset": 10,
976 "hasSecondTab": false,
977 "secondTabText": "Send Back",
978 "secondTabOffset": 80,
979 "secondTabWidth": 65,
980 "cnr_id": "comfy-core",
981 "ver": "0.22.0",
982 "Node name for S&R": "MaskComposite"
983 },
984 "widgets_values": [
985 256,
986 256,
987 "add"
988 ]
989 },
990 {
991 "id": 401,
992 "type": "MaskPreview",
993 "pos": [
994 -1480,
995 7320
996 ],
997 "size": [
998 230,
999 310
1000 ],
1001 "flags": [],
1002 "order": 38,
1003 "mode": 0,
1004 "inputs": [
1005 {
1006 "name": "mask",
1007 "type": "MASK",
1008 "link": 739
1009 }
1010 ],
1011 "outputs": [],
1012 "properties": {
1013 "enableTabs": false,
1014 "tabWidth": 65,
1015 "tabXOffset": 10,
1016 "hasSecondTab": false,
1017 "secondTabText": "Send Back",
1018 "secondTabOffset": 80,
1019 "secondTabWidth": 65,
1020 "cnr_id": "comfy-core",
1021 "ver": "0.22.0",
1022 "Node name for S&R": "MaskPreview"
1023 },
1024 "widgets_values": []
1025 },
1026 {
1027 "id": 394,
1028 "type": "FeatherMask",
1029 "pos": [
1030 -2190,
1031 6840
1032 ],
1033 "size": [
1034 270,
1035 200
1036 ],
1037 "flags": [],
1038 "order": 21,
1039 "mode": 0,
1040 "inputs": [
1041 {
1042 "name": "mask",
1043 "type": "MASK",
1044 "link": 717
1045 }
1046 ],
1047 "outputs": [
1048 {
1049 "name": "MASK",
1050 "type": "MASK",
1051 "links": [
1052 718,
1053 740
1054 ]
1055 }
1056 ],
1057 "properties": {
1058 "enableTabs": false,
1059 "tabWidth": 65,
1060 "tabXOffset": 10,
1061 "hasSecondTab": false,
1062 "secondTabText": "Send Back",
1063 "secondTabOffset": 80,
1064 "secondTabWidth": 65,
1065 "cnr_id": "comfy-core",
1066 "ver": "0.22.0",
1067 "Node name for S&R": "FeatherMask"
1068 },
1069 "widgets_values": [
1070 40,
1071 40,
1072 40,
1073 40
1074 ]
1075 },
1076 {
1077 "id": 402,
1078 "type": "MaskPreview",
1079 "pos": [
1080 -1590,
1081 6840
1082 ],
1083 "size": [
1084 350,
1085 330
1086 ],
1087 "flags": [],
1088 "order": 33,
1089 "mode": 0,
1090 "inputs": [
1091 {
1092 "name": "mask",
1093 "type": "MASK",
1094 "link": 740
1095 }
1096 ],
1097 "outputs": [],
1098 "properties": {
1099 "enableTabs": false,
1100 "tabWidth": 65,
1101 "tabXOffset": 10,
1102 "hasSecondTab": false,
1103 "secondTabText": "Send Back",
1104 "secondTabOffset": 80,
1105 "secondTabWidth": 65,
1106 "cnr_id": "comfy-core",
1107 "ver": "0.22.0",
1108 "Node name for S&R": "MaskPreview"
1109 },
1110 "widgets_values": []
1111 },
1112 {
1113 "id": 377,
1114 "type": "SolidMask",
1115 "pos": [
1116 -3250,
1117 7900
1118 ],
1119 "size": [
1120 270,
1121 170
1122 ],
1123 "flags": [],
1124 "order": 6,
1125 "mode": 0,
1126 "inputs": [],
1127 "outputs": [
1128 {
1129 "name": "MASK",
1130 "type": "MASK",
1131 "links": [
1132 703,
1133 724,
1134 733
1135 ]
1136 }
1137 ],
1138 "properties": {
1139 "enableTabs": false,
1140 "tabWidth": 65,
1141 "tabXOffset": 10,
1142 "hasSecondTab": false,
1143 "secondTabText": "Send Back",
1144 "secondTabOffset": 80,
1145 "secondTabWidth": 65,
1146 "cnr_id": "comfy-core",
1147 "ver": "0.22.0",
1148 "Node name for S&R": "SolidMask"
1149 },
1150 "widgets_values": [
1151 0.5,
1152 1024,
1153 1024
1154 ]
1155 },
1156 {
1157 "id": 5,
1158 "type": "ImageToMask",
1159 "pos": [
1160 -3290,
1161 4890
1162 ],
1163 "size": [
1164 270,
1165 110
1166 ],
1167 "flags": [],
1168 "order": 10,
1169 "mode": 0,
1170 "inputs": [
1171 {
1172 "name": "image",
1173 "type": "IMAGE",
1174 "link": 677
1175 }
1176 ],
1177 "outputs": [
1178 {
1179 "name": "MASK",
1180 "type": "MASK",
1181 "links": [
1182 632,
1183 633,
1184 635,
1185 651
1186 ]
1187 }
1188 ],
1189 "properties": {
1190 "enableTabs": false,
1191 "tabWidth": 65,
1192 "tabXOffset": 10,
1193 "hasSecondTab": false,
1194 "secondTabText": "Send Back",
1195 "secondTabOffset": 80,
1196 "secondTabWidth": 65,
1197 "cnr_id": "comfy-core",
1198 "ver": "0.22.0",
1199 "Node name for S&R": "ImageToMask"
1200 },
1201 "widgets_values": [
1202 "red"
1203 ]
1204 },
1205 {
1206 "id": 4,
1207 "type": "MaskPreview",
1208 "pos": [
1209 -3280,
1210 5080
1211 ],
1212 "size": [
1213 270,
1214 390
1215 ],
1216 "flags": [],
1217 "order": 16,
1218 "mode": 0,
1219 "inputs": [
1220 {
1221 "name": "mask",
1222 "type": "MASK",
1223 "link": 632
1224 }
1225 ],
1226 "outputs": [],
1227 "properties": {
1228 "enableTabs": false,
1229 "tabWidth": 65,
1230 "tabXOffset": 10,
1231 "hasSecondTab": false,
1232 "secondTabText": "Send Back",
1233 "secondTabOffset": 80,
1234 "secondTabWidth": 65,
1235 "cnr_id": "comfy-core",
1236 "ver": "0.22.0",
1237 "Node name for S&R": "MaskPreview"
1238 },
1239 "widgets_values": []
1240 },
1241 {
1242 "id": 338,
1243 "type": "ThresholdMask",
1244 "pos": [
1245 -2550,
1246 4880
1247 ],
1248 "size": [
1249 270,
1250 110
1251 ],
1252 "flags": [],
1253 "order": 19,
1254 "mode": 0,
1255 "inputs": [
1256 {
1257 "name": "mask",
1258 "type": "MASK",
1259 "link": 651
1260 }
1261 ],
1262 "outputs": [
1263 {
1264 "name": "MASK",
1265 "type": "MASK",
1266 "links": [
1267 652
1268 ]
1269 }
1270 ],
1271 "properties": {
1272 "enableTabs": false,
1273 "tabWidth": 65,
1274 "tabXOffset": 10,
1275 "hasSecondTab": false,
1276 "secondTabText": "Send Back",
1277 "secondTabOffset": 80,
1278 "secondTabWidth": 65,
1279 "cnr_id": "comfy-core",
1280 "ver": "0.22.0",
1281 "Node name for S&R": "ThresholdMask"
1282 },
1283 "widgets_values": [
1284 0.4099999999999999
1285 ]
1286 },
1287 {
1288 "id": 340,
1289 "type": "MaskPreview",
1290 "pos": [
1291 -2150,
1292 4860
1293 ],
1294 "size": [
1295 250,
1296 310
1297 ],
1298 "flags": [],
1299 "order": 31,
1300 "mode": 0,
1301 "inputs": [
1302 {
1303 "name": "mask",
1304 "type": "MASK",
1305 "link": 652
1306 }
1307 ],
1308 "outputs": [],
1309 "properties": {
1310 "enableTabs": false,
1311 "tabWidth": 65,
1312 "tabXOffset": 10,
1313 "hasSecondTab": false,
1314 "secondTabText": "Send Back",
1315 "secondTabOffset": 80,
1316 "secondTabWidth": 65,
1317 "cnr_id": "comfy-core",
1318 "ver": "0.22.0",
1319 "Node name for S&R": "MaskPreview"
1320 },
1321 "widgets_values": []
1322 },
1323 {
1324 "id": 328,
1325 "type": "MaskPreview",
1326 "pos": [
1327 -2150,
1328 5300
1329 ],
1330 "size": [
1331 250,
1332 310
1333 ],
1334 "flags": [],
1335 "order": 29,
1336 "mode": 0,
1337 "inputs": [
1338 {
1339 "name": "mask",
1340 "type": "MASK",
1341 "link": 636
1342 }
1343 ],
1344 "outputs": [],
1345 "properties": {
1346 "enableTabs": false,
1347 "tabWidth": 65,
1348 "tabXOffset": 10,
1349 "hasSecondTab": false,
1350 "secondTabText": "Send Back",
1351 "secondTabOffset": 80,
1352 "secondTabWidth": 65,
1353 "cnr_id": "comfy-core",
1354 "ver": "0.22.0",
1355 "Node name for S&R": "MaskPreview"
1356 },
1357 "widgets_values": []
1358 },
1359 {
1360 "id": 3,
1361 "type": "MaskToImage",
1362 "pos": [
1363 -2550,
1364 4400
1365 ],
1366 "size": [
1367 230,
1368 80
1369 ],
1370 "flags": [],
1371 "order": 17,
1372 "mode": 0,
1373 "inputs": [
1374 {
1375 "name": "mask",
1376 "type": "MASK",
1377 "link": 633
1378 }
1379 ],
1380 "outputs": [
1381 {
1382 "name": "IMAGE",
1383 "type": "IMAGE",
1384 "links": [
1385 634
1386 ]
1387 }
1388 ],
1389 "properties": {
1390 "enableTabs": false,
1391 "tabWidth": 65,
1392 "tabXOffset": 10,
1393 "hasSecondTab": false,
1394 "secondTabText": "Send Back",
1395 "secondTabOffset": 80,
1396 "secondTabWidth": 65,
1397 "cnr_id": "comfy-core",
1398 "ver": "0.22.0",
1399 "Node name for S&R": "MaskToImage"
1400 },
1401 "widgets_values": []
1402 },
1403 {
1404 "id": 327,
1405 "type": "InvertMask",
1406 "pos": [
1407 -2540,
1408 5290
1409 ],
1410 "size": [
1411 230,
1412 80
1413 ],
1414 "flags": [],
1415 "order": 18,
1416 "mode": 0,
1417 "inputs": [
1418 {
1419 "name": "mask",
1420 "type": "MASK",
1421 "link": 635
1422 }
1423 ],
1424 "outputs": [
1425 {
1426 "name": "MASK",
1427 "type": "MASK",
1428 "links": [
1429 636,
1430 742
1431 ]
1432 }
1433 ],
1434 "properties": {
1435 "enableTabs": false,
1436 "tabWidth": 65,
1437 "tabXOffset": 10,
1438 "hasSecondTab": false,
1439 "secondTabText": "Send Back",
1440 "secondTabOffset": 80,
1441 "secondTabWidth": 65,
1442 "cnr_id": "comfy-core",
1443 "ver": "0.22.0",
1444 "Node name for S&R": "InvertMask"
1445 },
1446 "widgets_values": []
1447 },
1448 {
1449 "id": 342,
1450 "type": "FeatherMask",
1451 "pos": [
1452 -1750,
1453 4850
1454 ],
1455 "size": [
1456 270,
1457 200
1458 ],
1459 "flags": [],
1460 "order": 30,
1461 "mode": 0,
1462 "inputs": [
1463 {
1464 "name": "mask",
1465 "type": "MASK",
1466 "link": 742
1467 }
1468 ],
1469 "outputs": [
1470 {
1471 "name": "MASK",
1472 "type": "MASK",
1473 "links": [
1474 655
1475 ]
1476 }
1477 ],
1478 "properties": {
1479 "enableTabs": false,
1480 "tabWidth": 65,
1481 "tabXOffset": 10,
1482 "hasSecondTab": false,
1483 "secondTabText": "Send Back",
1484 "secondTabOffset": 80,
1485 "secondTabWidth": 65,
1486 "cnr_id": "comfy-core",
1487 "ver": "0.22.0",
1488 "Node name for S&R": "FeatherMask"
1489 },
1490 "widgets_values": [
1491 200,
1492 0,
1493 0,
1494 0
1495 ]
1496 },
1497 {
1498 "id": 343,
1499 "type": "MaskPreview",
1500 "pos": [
1501 -1330,
1502 4840
1503 ],
1504 "size": [
1505 230,
1506 310
1507 ],
1508 "flags": [],
1509 "order": 39,
1510 "mode": 0,
1511 "inputs": [
1512 {
1513 "name": "mask",
1514 "type": "MASK",
1515 "link": 655
1516 }
1517 ],
1518 "outputs": [],
1519 "properties": {
1520 "enableTabs": false,
1521 "tabWidth": 65,
1522 "tabXOffset": 10,
1523 "hasSecondTab": false,
1524 "secondTabText": "Send Back",
1525 "secondTabOffset": 80,
1526 "secondTabWidth": 65,
1527 "cnr_id": "comfy-core",
1528 "ver": "0.22.0",
1529 "Node name for S&R": "MaskPreview"
1530 },
1531 "widgets_values": []
1532 },
1533 {
1534 "id": 359,
1535 "type": "ImageCompositeMasked",
1536 "pos": [
1537 -2240,
1538 5760
1539 ],
1540 "size": [
1541 270,
1542 220
1543 ],
1544 "flags": [],
1545 "order": 32,
1546 "mode": 0,
1547 "inputs": [
1548 {
1549 "name": "destination",
1550 "type": "IMAGE",
1551 "link": 679
1552 },
1553 {
1554 "name": "source",
1555 "type": "IMAGE",
1556 "link": 669
1557 },
1558 {
1559 "name": "mask",
1560 "shape": 7,
1561 "type": "MASK",
1562 "link": 718
1563 }
1564 ],
1565 "outputs": [
1566 {
1567 "name": "IMAGE",
1568 "type": "IMAGE",
1569 "links": [
1570 682
1571 ]
1572 }
1573 ],
1574 "properties": {
1575 "enableTabs": false,
1576 "tabWidth": 65,
1577 "tabXOffset": 10,
1578 "hasSecondTab": false,
1579 "secondTabText": "Send Back",
1580 "secondTabOffset": 80,
1581 "secondTabWidth": 65,
1582 "cnr_id": "comfy-core",
1583 "ver": "0.22.0",
1584 "Node name for S&R": "ImageCompositeMasked"
1585 },
1586 "widgets_values": [
1587 0,
1588 0,
1589 false
1590 ]
1591 },
1592 {
1593 "id": 360,
1594 "type": "EmptyImage",
1595 "pos": [
1596 -2730,
1597 6200
1598 ],
1599 "size": [
1600 270,
1601 200
1602 ],
1603 "flags": [],
1604 "order": 7,
1605 "mode": 0,
1606 "inputs": [],
1607 "outputs": [
1608 {
1609 "name": "IMAGE",
1610 "type": "IMAGE",
1611 "links": [
1612 669,
1613 681
1614 ]
1615 }
1616 ],
1617 "properties": {
1618 "enableTabs": false,
1619 "tabWidth": 65,
1620 "tabXOffset": 10,
1621 "hasSecondTab": false,
1622 "secondTabText": "Send Back",
1623 "secondTabOffset": 80,
1624 "secondTabWidth": 65,
1625 "cnr_id": "comfy-core",
1626 "ver": "0.22.0",
1627 "Node name for S&R": "EmptyImage"
1628 },
1629 "widgets_values": [
1630 1024,
1631 1024,
1632 1,
1633 16711680
1634 ]
1635 },
1636 {
1637 "id": 368,
1638 "type": "PreviewImage",
1639 "pos": [
1640 -1600,
1641 5760
1642 ],
1643 "size": [
1644 440,
1645 630
1646 ],
1647 "flags": [],
1648 "order": 40,
1649 "mode": 0,
1650 "inputs": [
1651 {
1652 "name": "images",
1653 "type": "IMAGE",
1654 "link": 682
1655 }
1656 ],
1657 "outputs": [],
1658 "properties": {
1659 "enableTabs": false,
1660 "tabWidth": 65,
1661 "tabXOffset": 10,
1662 "hasSecondTab": false,
1663 "secondTabText": "Send Back",
1664 "secondTabOffset": 80,
1665 "secondTabWidth": 65,
1666 "cnr_id": "comfy-core",
1667 "ver": "0.22.0",
1668 "Node name for S&R": "PreviewImage"
1669 },
1670 "widgets_values": []
1671 },
1672 {
1673 "id": 373,
1674 "type": "MarkdownNote",
1675 "pos": [
1676 -4100,
1677 7090
1678 ],
1679 "size": [
1680 570,
1681 360
1682 ],
1683 "flags": [],
1684 "order": 8,
1685 "mode": 0,
1686 "inputs": [],
1687 "outputs": [],
1688 "properties": [],
1689 "widgets_values": [
1690 "## Try It Yourself\n\nReplace **Empty Image** with **Load Image** to use your own file. Open the **[Mask Editor](https://docs.comfy.org/interface/maskeditor)** on the Load Image node to draw a mask directly on your image.\n\nConnect the image and mask outputs into any section above to see how the nodes respond to real data — this is the fastest way to learn."
1691 ],
1692 "color": "#222",
1693 "bgcolor": "#000"
1694 }
1695 ],
1696 "links": [
1697 [
1698 632,
1699 5,
1700 0,
1701 4,
1702 0,
1703 "MASK"
1704 ],
1705 [
1706 633,
1707 5,
1708 0,
1709 3,
1710 0,
1711 "MASK"
1712 ],
1713 [
1714 634,
1715 3,
1716 0,
1717 326,
1718 0,
1719 "IMAGE"
1720 ],
1721 [
1722 635,
1723 5,
1724 0,
1725 327,
1726 0,
1727 "MASK"
1728 ],
1729 [
1730 636,
1731 327,
1732 0,
1733 328,
1734 0,
1735 "MASK"
1736 ],
1737 [
1738 651,
1739 5,
1740 0,
1741 338,
1742 0,
1743 "MASK"
1744 ],
1745 [
1746 652,
1747 338,
1748 0,
1749 340,
1750 0,
1751 "MASK"
1752 ],
1753 [
1754 655,
1755 342,
1756 0,
1757 343,
1758 0,
1759 "MASK"
1760 ],
1761 [
1762 669,
1763 360,
1764 0,
1765 359,
1766 1,
1767 "IMAGE"
1768 ],
1769 [
1770 676,
1771 1,
1772 0,
1773 2,
1774 0,
1775 "IMAGE"
1776 ],
1777 [
1778 677,
1779 1,
1780 0,
1781 5,
1782 0,
1783 "IMAGE"
1784 ],
1785 [
1786 679,
1787 1,
1788 0,
1789 359,
1790 0,
1791 "IMAGE"
1792 ],
1793 [
1794 681,
1795 360,
1796 0,
1797 367,
1798 0,
1799 "IMAGE"
1800 ],
1801 [
1802 682,
1803 359,
1804 0,
1805 368,
1806 0,
1807 "IMAGE"
1808 ],
1809 [
1810 694,
1811 376,
1812 0,
1813 378,
1814 0,
1815 "MASK"
1816 ],
1817 [
1818 703,
1819 377,
1820 0,
1821 383,
1822 0,
1823 "MASK"
1824 ],
1825 [
1826 705,
1827 383,
1828 0,
1829 384,
1830 0,
1831 "MASK"
1832 ],
1833 [
1834 709,
1835 387,
1836 0,
1837 388,
1838 0,
1839 "MASK"
1840 ],
1841 [
1842 712,
1843 389,
1844 0,
1845 390,
1846 0,
1847 "MASK"
1848 ],
1849 [
1850 715,
1851 391,
1852 0,
1853 392,
1854 0,
1855 "MASK"
1856 ],
1857 [
1858 717,
1859 383,
1860 0,
1861 394,
1862 0,
1863 "MASK"
1864 ],
1865 [
1866 718,
1867 394,
1868 0,
1869 359,
1870 2,
1871 "MASK"
1872 ],
1873 [
1874 720,
1875 383,
1876 0,
1877 376,
1878 0,
1879 "MASK"
1880 ],
1881 [
1882 721,
1883 383,
1884 0,
1885 387,
1886 0,
1887 "MASK"
1888 ],
1889 [
1890 722,
1891 383,
1892 0,
1893 389,
1894 0,
1895 "MASK"
1896 ],
1897 [
1898 723,
1899 383,
1900 0,
1901 391,
1902 0,
1903 "MASK"
1904 ],
1905 [
1906 724,
1907 377,
1908 0,
1909 369,
1910 0,
1911 "MASK"
1912 ],
1913 [
1914 727,
1915 398,
1916 0,
1917 376,
1918 1,
1919 "MASK"
1920 ],
1921 [
1922 729,
1923 398,
1924 0,
1925 387,
1926 1,
1927 "MASK"
1928 ],
1929 [
1930 730,
1931 398,
1932 0,
1933 389,
1934 1,
1935 "MASK"
1936 ],
1937 [
1938 731,
1939 398,
1940 0,
1941 391,
1942 1,
1943 "MASK"
1944 ],
1945 [
1946 732,
1947 380,
1948 0,
1949 381,
1950 0,
1951 "MASK"
1952 ],
1953 [
1954 733,
1955 377,
1956 0,
1957 398,
1958 0,
1959 "MASK"
1960 ],
1961 [
1962 734,
1963 380,
1964 0,
1965 398,
1966 1,
1967 "MASK"
1968 ],
1969 [
1970 735,
1971 398,
1972 0,
1973 399,
1974 0,
1975 "MASK"
1976 ],
1977 [
1978 736,
1979 380,
1980 0,
1981 383,
1982 1,
1983 "MASK"
1984 ],
1985 [
1986 737,
1987 383,
1988 0,
1989 400,
1990 0,
1991 "MASK"
1992 ],
1993 [
1994 738,
1995 398,
1996 0,
1997 400,
1998 1,
1999 "MASK"
2000 ],
2001 [
2002 739,
2003 400,
2004 0,
2005 401,
2006 0,
2007 "MASK"
2008 ],
2009 [
2010 740,
2011 394,
2012 0,
2013 402,
2014 0,
2015 "MASK"
2016 ],
2017 [
2018 742,
2019 327,
2020 0,
2021 342,
2022 0,
2023 "MASK"
2024 ]
2025 ],
2026 "groups": [
2027 {
2028 "id": 1,
2029 "title": "Mask Operations",
2030 "bounding": [
2031 -3320,
2032 4210,
2033 2270,
2034 1420
2035 ],
2036 "color": "#3f789e",
2037 "flags": []
2038 },
2039 {
2040 "id": 3,
2041 "title": "Image & Mask Compositing",
2042 "bounding": [
2043 -3320,
2044 5650,
2045 2270,
2046 1540
2047 ],
2048 "color": "#3f789e",
2049 "flags": []
2050 },
2051 {
2052 "id": 4,
2053 "title": "Example Input",
2054 "bounding": [
2055 -4100,
2056 5670,
2057 540,
2058 730
2059 ],
2060 "color": "#3f789e",
2061 "flags": []
2062 },
2063 {
2064 "id": 5,
2065 "title": "Try It Yourself",
2066 "bounding": [
2067 -4100,
2068 6440,
2069 540,
2070 580
2071 ],
2072 "color": "#3f789e",
2073 "flags": []
2074 },
2075 {
2076 "id": 6,
2077 "title": "Combine Masks",
2078 "bounding": [
2079 -3320,
2080 7220,
2081 2250,
2082 2030
2083 ],
2084 "color": "#3f789e",
2085 "flags": []
2086 }
2087 ],
2088 "config": [],
2089 "extra": {
2090 "ds": {
2091 "scale": 0.10451831122505054,
2092 "offset": [
2093 10727.07219644071,
2094 -1198.359907925089
2095 ]
2096 },
2097 "frontendVersion": "1.43.18",
2098 "VHS_latentpreview": false,
2099 "VHS_latentpreviewrate": 0,
2100 "VHS_MetadataImage": true,
2101 "VHS_KeepIntermediate": true
2102 },
2103 "version": 0.4
2104}