├── .github └── workflows │ └── publish.yml ├── .gitignore ├── README.md ├── __init__.py ├── example ├── add_text.json ├── add_text2.json ├── image.png └── image2.png ├── font ├── arial.ttf └── 庞门正道粗书体6.0.ttf ├── nodes.py └── pyproject.toml /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish to Comfy registry 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | paths: 9 | - "pyproject.toml" 10 | 11 | jobs: 12 | publish-node: 13 | name: Publish Custom Node to registry 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Check out code 17 | uses: actions/checkout@v4 18 | - name: Publish Custom Node 19 | uses: Comfy-Org/publish-node-action@main 20 | with: 21 | ## Add your own personal access token to your Github Repository secrets and reference it here. 22 | personal_access_token: e714a92d-9b21-4c15-b1a8-b6df10672a6e 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | /venv 3 | .vscode 4 | *.ckpt 5 | *.safetensors 6 | *.pth 7 | types 8 | *.pyc 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ComfyUI-Text 2 | 3 | ## Install 4 | ``` 5 | cd /custom_nodes 6 | git clone https://github.com/LZpenguin/ComfyUI-Text.git 7 | ``` 8 | 9 | ## Add Font Files 10 | There are 2 font files (en & cn) in this repo, u can test with them 11 | ``` 12 | cd ComfyUI-Text 13 | mv ./font ../../models 14 | ``` 15 | 16 | ## Example 17 | [Add Wordart Workflow](./example/add_text.json) 18 | 19 | ![image](./example/image.png) 20 | 21 | [Add Normal Text Workflow](./example/add_text2.json) 22 | 23 | ![image](./example/image2.png) -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | from .nodes import * 2 | 3 | NODE_CLASS_MAPPINGS = { 4 | "Add_text_by_mask": AddTextByMask, 5 | } 6 | NODE_DISPLAY_NAME_MAPPINGS = { 7 | "Add_text_by_mask": "Add Text By Mask", 8 | } 9 | __all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] -------------------------------------------------------------------------------- /example/add_text.json: -------------------------------------------------------------------------------- 1 | { 2 | "last_node_id": 856, 3 | "last_link_id": 1843, 4 | "nodes": [ 5 | { 6 | "id": 591, 7 | "type": "Image Blend by Mask", 8 | "pos": [ 9 | -2614, 10 | 530 11 | ], 12 | "size": { 13 | "0": 315, 14 | "1": 98 15 | }, 16 | "flags": {}, 17 | "order": 36, 18 | "mode": 0, 19 | "inputs": [ 20 | { 21 | "name": "image_a", 22 | "type": "IMAGE", 23 | "link": 1482 24 | }, 25 | { 26 | "name": "image_b", 27 | "type": "IMAGE", 28 | "link": 1622 29 | }, 30 | { 31 | "name": "mask", 32 | "type": "IMAGE", 33 | "link": 1475 34 | } 35 | ], 36 | "outputs": [ 37 | { 38 | "name": "IMAGE", 39 | "type": "IMAGE", 40 | "links": [ 41 | 1516, 42 | 1621 43 | ], 44 | "shape": 3, 45 | "slot_index": 0 46 | } 47 | ], 48 | "properties": { 49 | "Node name for S&R": "Image Blend by Mask" 50 | }, 51 | "widgets_values": [ 52 | 1 53 | ] 54 | }, 55 | { 56 | "id": 708, 57 | "type": "VAEDecode", 58 | "pos": [ 59 | -2900, 60 | 556 61 | ], 62 | "size": { 63 | "0": 210, 64 | "1": 46 65 | }, 66 | "flags": {}, 67 | "order": 33, 68 | "mode": 0, 69 | "inputs": [ 70 | { 71 | "name": "samples", 72 | "type": "LATENT", 73 | "link": 1591 74 | }, 75 | { 76 | "name": "vae", 77 | "type": "VAE", 78 | "link": 1592 79 | } 80 | ], 81 | "outputs": [ 82 | { 83 | "name": "IMAGE", 84 | "type": "IMAGE", 85 | "links": [ 86 | 1622, 87 | 1623 88 | ], 89 | "shape": 3, 90 | "slot_index": 0 91 | } 92 | ], 93 | "properties": { 94 | "Node name for S&R": "VAEDecode" 95 | } 96 | }, 97 | { 98 | "id": 325, 99 | "type": "IPAdapterUnifiedLoader", 100 | "pos": [ 101 | -3284, 102 | -35 103 | ], 104 | "size": { 105 | "0": 315, 106 | "1": 78 107 | }, 108 | "flags": {}, 109 | "order": 10, 110 | "mode": 0, 111 | "inputs": [ 112 | { 113 | "name": "model", 114 | "type": "MODEL", 115 | "link": 1223 116 | }, 117 | { 118 | "name": "ipadapter", 119 | "type": "IPADAPTER", 120 | "link": null 121 | } 122 | ], 123 | "outputs": [ 124 | { 125 | "name": "model", 126 | "type": "MODEL", 127 | "links": [ 128 | 797 129 | ], 130 | "shape": 3, 131 | "slot_index": 0 132 | }, 133 | { 134 | "name": "ipadapter", 135 | "type": "IPADAPTER", 136 | "links": [ 137 | 798 138 | ], 139 | "shape": 3, 140 | "slot_index": 1 141 | } 142 | ], 143 | "properties": { 144 | "Node name for S&R": "IPAdapterUnifiedLoader" 145 | }, 146 | "widgets_values": [ 147 | "PLUS (high strength)" 148 | ] 149 | }, 150 | { 151 | "id": 671, 152 | "type": "VAEEncode", 153 | "pos": [ 154 | -2205, 155 | 545 156 | ], 157 | "size": { 158 | "0": 210, 159 | "1": 46 160 | }, 161 | "flags": {}, 162 | "order": 40, 163 | "mode": 0, 164 | "inputs": [ 165 | { 166 | "name": "pixels", 167 | "type": "IMAGE", 168 | "link": 1621 169 | }, 170 | { 171 | "name": "vae", 172 | "type": "VAE", 173 | "link": 1527 174 | } 175 | ], 176 | "outputs": [ 177 | { 178 | "name": "LATENT", 179 | "type": "LATENT", 180 | "links": [ 181 | 1525 182 | ], 183 | "shape": 3, 184 | "slot_index": 0 185 | } 186 | ], 187 | "properties": { 188 | "Node name for S&R": "VAEEncode" 189 | } 190 | }, 191 | { 192 | "id": 592, 193 | "type": "PreviewBridge", 194 | "pos": [ 195 | -2234, 196 | 714 197 | ], 198 | "size": { 199 | "0": 312.4906311035156, 200 | "1": 298.99847412109375 201 | }, 202 | "flags": {}, 203 | "order": 39, 204 | "mode": 0, 205 | "inputs": [ 206 | { 207 | "name": "images", 208 | "type": "IMAGE", 209 | "link": 1516 210 | } 211 | ], 212 | "outputs": [ 213 | { 214 | "name": "IMAGE", 215 | "type": "IMAGE", 216 | "links": [], 217 | "shape": 3, 218 | "slot_index": 0 219 | }, 220 | { 221 | "name": "MASK", 222 | "type": "MASK", 223 | "links": [], 224 | "shape": 3, 225 | "slot_index": 1 226 | } 227 | ], 228 | "properties": { 229 | "Node name for S&R": "PreviewBridge" 230 | }, 231 | "widgets_values": [ 232 | "$592-0" 233 | ] 234 | }, 235 | { 236 | "id": 705, 237 | "type": "KSampler", 238 | "pos": [ 239 | -3305, 240 | 501 241 | ], 242 | "size": { 243 | "0": 315, 244 | "1": 262 245 | }, 246 | "flags": { 247 | "collapsed": false 248 | }, 249 | "order": 26, 250 | "mode": 0, 251 | "inputs": [ 252 | { 253 | "name": "model", 254 | "type": "MODEL", 255 | "link": 1789 256 | }, 257 | { 258 | "name": "positive", 259 | "type": "CONDITIONING", 260 | "link": 1656 261 | }, 262 | { 263 | "name": "negative", 264 | "type": "CONDITIONING", 265 | "link": 1587 266 | }, 267 | { 268 | "name": "latent_image", 269 | "type": "LATENT", 270 | "link": 1760 271 | } 272 | ], 273 | "outputs": [ 274 | { 275 | "name": "LATENT", 276 | "type": "LATENT", 277 | "links": [ 278 | 1591 279 | ], 280 | "shape": 3, 281 | "slot_index": 0 282 | } 283 | ], 284 | "properties": { 285 | "Node name for S&R": "KSampler" 286 | }, 287 | "widgets_values": [ 288 | 2, 289 | "fixed", 290 | 30, 291 | 3.6, 292 | "dpmpp_2m_sde", 293 | "karras", 294 | 1 295 | ] 296 | }, 297 | { 298 | "id": 709, 299 | "type": "PreviewBridge", 300 | "pos": [ 301 | -2610, 302 | 715 303 | ], 304 | "size": { 305 | "0": 315, 306 | "1": 290 307 | }, 308 | "flags": {}, 309 | "order": 37, 310 | "mode": 0, 311 | "inputs": [ 312 | { 313 | "name": "images", 314 | "type": "IMAGE", 315 | "link": 1623 316 | } 317 | ], 318 | "outputs": [ 319 | { 320 | "name": "IMAGE", 321 | "type": "IMAGE", 322 | "links": [], 323 | "shape": 3, 324 | "slot_index": 0 325 | }, 326 | { 327 | "name": "MASK", 328 | "type": "MASK", 329 | "links": null, 330 | "shape": 3 331 | } 332 | ], 333 | "properties": { 334 | "Node name for S&R": "PreviewBridge" 335 | }, 336 | "widgets_values": [ 337 | "$709-0" 338 | ] 339 | }, 340 | { 341 | "id": 805, 342 | "type": "DepthAnythingPreprocessor", 343 | "pos": [ 344 | -4892, 345 | 965 346 | ], 347 | "size": { 348 | "0": 315, 349 | "1": 82 350 | }, 351 | "flags": {}, 352 | "order": 7, 353 | "mode": 0, 354 | "inputs": [ 355 | { 356 | "name": "image", 357 | "type": "IMAGE", 358 | "link": 1744 359 | } 360 | ], 361 | "outputs": [ 362 | { 363 | "name": "IMAGE", 364 | "type": "IMAGE", 365 | "links": [ 366 | 1750 367 | ], 368 | "shape": 3, 369 | "slot_index": 0 370 | } 371 | ], 372 | "properties": { 373 | "Node name for S&R": "DepthAnythingPreprocessor" 374 | }, 375 | "widgets_values": [ 376 | "depth_anything_vitl14.pth", 377 | 512 378 | ] 379 | }, 380 | { 381 | "id": 806, 382 | "type": "PreviewBridge", 383 | "pos": [ 384 | -4189, 385 | 1013 386 | ], 387 | "size": { 388 | "0": 315, 389 | "1": 290 390 | }, 391 | "flags": {}, 392 | "order": 19, 393 | "mode": 0, 394 | "inputs": [ 395 | { 396 | "name": "images", 397 | "type": "IMAGE", 398 | "link": 1751 399 | } 400 | ], 401 | "outputs": [ 402 | { 403 | "name": "IMAGE", 404 | "type": "IMAGE", 405 | "links": [ 406 | 1746 407 | ], 408 | "shape": 3, 409 | "slot_index": 0 410 | }, 411 | { 412 | "name": "MASK", 413 | "type": "MASK", 414 | "links": null, 415 | "shape": 3 416 | } 417 | ], 418 | "properties": { 419 | "Node name for S&R": "PreviewBridge" 420 | }, 421 | "widgets_values": [ 422 | "$806-0" 423 | ] 424 | }, 425 | { 426 | "id": 721, 427 | "type": "VAEEncode", 428 | "pos": [ 429 | -4209, 430 | 797 431 | ], 432 | "size": { 433 | "0": 210, 434 | "1": 46 435 | }, 436 | "flags": {}, 437 | "order": 12, 438 | "mode": 0, 439 | "inputs": [ 440 | { 441 | "name": "pixels", 442 | "type": "IMAGE", 443 | "link": 1630 444 | }, 445 | { 446 | "name": "vae", 447 | "type": "VAE", 448 | "link": 1631 449 | } 450 | ], 451 | "outputs": [ 452 | { 453 | "name": "LATENT", 454 | "type": "LATENT", 455 | "links": [], 456 | "shape": 3, 457 | "slot_index": 0 458 | } 459 | ], 460 | "properties": { 461 | "Node name for S&R": "VAEEncode" 462 | } 463 | }, 464 | { 465 | "id": 813, 466 | "type": "EmptyLatentImage", 467 | "pos": [ 468 | -3803, 469 | 825 470 | ], 471 | "size": { 472 | "0": 315, 473 | "1": 106 474 | }, 475 | "flags": {}, 476 | "order": 15, 477 | "mode": 0, 478 | "inputs": [ 479 | { 480 | "name": "width", 481 | "type": "INT", 482 | "link": 1761, 483 | "widget": { 484 | "name": "width" 485 | } 486 | }, 487 | { 488 | "name": "height", 489 | "type": "INT", 490 | "link": 1762, 491 | "widget": { 492 | "name": "height" 493 | } 494 | } 495 | ], 496 | "outputs": [ 497 | { 498 | "name": "LATENT", 499 | "type": "LATENT", 500 | "links": [ 501 | 1760 502 | ], 503 | "shape": 3, 504 | "slot_index": 0 505 | } 506 | ], 507 | "properties": { 508 | "Node name for S&R": "EmptyLatentImage" 509 | }, 510 | "widgets_values": [ 511 | 512, 512 | 512, 513 | 1 514 | ] 515 | }, 516 | { 517 | "id": 704, 518 | "type": "ControlNetLoader", 519 | "pos": [ 520 | -3796, 521 | 527 522 | ], 523 | "size": { 524 | "0": 315, 525 | "1": 58 526 | }, 527 | "flags": {}, 528 | "order": 0, 529 | "mode": 0, 530 | "outputs": [ 531 | { 532 | "name": "CONTROL_NET", 533 | "type": "CONTROL_NET", 534 | "links": [ 535 | 1583, 536 | 1770 537 | ], 538 | "shape": 3, 539 | "slot_index": 0 540 | } 541 | ], 542 | "properties": { 543 | "Node name for S&R": "ControlNetLoader" 544 | }, 545 | "widgets_values": [ 546 | "control_v11f1p_sd15_depth.pth" 547 | ] 548 | }, 549 | { 550 | "id": 810, 551 | "type": "GetImageSize+", 552 | "pos": [ 553 | -4856, 554 | 1155 555 | ], 556 | "size": { 557 | "0": 210, 558 | "1": 66 559 | }, 560 | "flags": {}, 561 | "order": 8, 562 | "mode": 0, 563 | "inputs": [ 564 | { 565 | "name": "image", 566 | "type": "IMAGE", 567 | "link": 1749 568 | } 569 | ], 570 | "outputs": [ 571 | { 572 | "name": "width", 573 | "type": "INT", 574 | "links": [ 575 | 1752, 576 | 1761, 577 | 1779 578 | ], 579 | "shape": 3, 580 | "slot_index": 0 581 | }, 582 | { 583 | "name": "height", 584 | "type": "INT", 585 | "links": [ 586 | 1754, 587 | 1762, 588 | 1780 589 | ], 590 | "shape": 3, 591 | "slot_index": 1 592 | }, 593 | { 594 | "name": "count", 595 | "type": "INT", 596 | "links": null, 597 | "shape": 3 598 | } 599 | ], 600 | "properties": { 601 | "Node name for S&R": "GetImageSize+" 602 | } 603 | }, 604 | { 605 | "id": 703, 606 | "type": "ControlNetApply", 607 | "pos": [ 608 | -3793, 609 | 661 610 | ], 611 | "size": { 612 | "0": 317.4000244140625, 613 | "1": 98 614 | }, 615 | "flags": {}, 616 | "order": 21, 617 | "mode": 0, 618 | "inputs": [ 619 | { 620 | "name": "conditioning", 621 | "type": "CONDITIONING", 622 | "link": 1584 623 | }, 624 | { 625 | "name": "control_net", 626 | "type": "CONTROL_NET", 627 | "link": 1583, 628 | "slot_index": 1 629 | }, 630 | { 631 | "name": "image", 632 | "type": "IMAGE", 633 | "link": 1788 634 | } 635 | ], 636 | "outputs": [ 637 | { 638 | "name": "CONDITIONING", 639 | "type": "CONDITIONING", 640 | "links": [ 641 | 1656 642 | ], 643 | "shape": 3, 644 | "slot_index": 0 645 | } 646 | ], 647 | "properties": { 648 | "Node name for S&R": "ControlNetApply" 649 | }, 650 | "widgets_values": [ 651 | 0.6 652 | ] 653 | }, 654 | { 655 | "id": 324, 656 | "type": "IPAdapterAdvanced", 657 | "pos": [ 658 | -3313, 659 | 140 660 | ], 661 | "size": { 662 | "0": 315, 663 | "1": 278 664 | }, 665 | "flags": {}, 666 | "order": 18, 667 | "mode": 0, 668 | "inputs": [ 669 | { 670 | "name": "model", 671 | "type": "MODEL", 672 | "link": 797 673 | }, 674 | { 675 | "name": "ipadapter", 676 | "type": "IPADAPTER", 677 | "link": 798 678 | }, 679 | { 680 | "name": "image", 681 | "type": "IMAGE", 682 | "link": 1608, 683 | "slot_index": 2 684 | }, 685 | { 686 | "name": "image_negative", 687 | "type": "IMAGE", 688 | "link": null 689 | }, 690 | { 691 | "name": "attn_mask", 692 | "type": "MASK", 693 | "link": null 694 | }, 695 | { 696 | "name": "clip_vision", 697 | "type": "CLIP_VISION", 698 | "link": null 699 | } 700 | ], 701 | "outputs": [ 702 | { 703 | "name": "MODEL", 704 | "type": "MODEL", 705 | "links": [ 706 | 1524, 707 | 1789 708 | ], 709 | "shape": 3, 710 | "slot_index": 0 711 | } 712 | ], 713 | "properties": { 714 | "Node name for S&R": "IPAdapterAdvanced" 715 | }, 716 | "widgets_values": [ 717 | 1, 718 | "linear", 719 | "concat", 720 | 0, 721 | 1, 722 | "K+V w/ C penalty" 723 | ] 724 | }, 725 | { 726 | "id": 209, 727 | "type": "CLIPTextEncode", 728 | "pos": [ 729 | -3851, 730 | 274 731 | ], 732 | "size": { 733 | "0": 400, 734 | "1": 200 735 | }, 736 | "flags": {}, 737 | "order": 11, 738 | "mode": 0, 739 | "inputs": [ 740 | { 741 | "name": "clip", 742 | "type": "CLIP", 743 | "link": 605 744 | } 745 | ], 746 | "outputs": [ 747 | { 748 | "name": "CONDITIONING", 749 | "type": "CONDITIONING", 750 | "links": [ 751 | 1587, 752 | 1625, 753 | 1794 754 | ], 755 | "shape": 3, 756 | "slot_index": 0 757 | } 758 | ], 759 | "properties": { 760 | "Node name for S&R": "CLIPTextEncode" 761 | }, 762 | "widgets_values": [ 763 | "dark, deep, blur" 764 | ] 765 | }, 766 | { 767 | "id": 827, 768 | "type": "ImageToMask", 769 | "pos": [ 770 | -2618, 771 | -670 772 | ], 773 | "size": { 774 | "0": 315, 775 | "1": 58 776 | }, 777 | "flags": {}, 778 | "order": 32, 779 | "mode": 0, 780 | "inputs": [ 781 | { 782 | "name": "image", 783 | "type": "IMAGE", 784 | "link": 1798 785 | } 786 | ], 787 | "outputs": [ 788 | { 789 | "name": "MASK", 790 | "type": "MASK", 791 | "links": [ 792 | 1799 793 | ], 794 | "shape": 3, 795 | "slot_index": 0 796 | } 797 | ], 798 | "properties": { 799 | "Node name for S&R": "ImageToMask" 800 | }, 801 | "widgets_values": [ 802 | "red" 803 | ] 804 | }, 805 | { 806 | "id": 649, 807 | "type": "LineartStandardPreprocessor", 808 | "pos": [ 809 | -3449, 810 | -510 811 | ], 812 | "size": { 813 | "0": 315, 814 | "1": 106 815 | }, 816 | "flags": {}, 817 | "order": 20, 818 | "mode": 0, 819 | "inputs": [ 820 | { 821 | "name": "image", 822 | "type": "IMAGE", 823 | "link": 1455 824 | } 825 | ], 826 | "outputs": [ 827 | { 828 | "name": "IMAGE", 829 | "type": "IMAGE", 830 | "links": [ 831 | 1842 832 | ], 833 | "shape": 3, 834 | "slot_index": 0 835 | } 836 | ], 837 | "properties": { 838 | "Node name for S&R": "LineartStandardPreprocessor" 839 | }, 840 | "widgets_values": [ 841 | 1, 842 | 1, 843 | 512 844 | ] 845 | }, 846 | { 847 | "id": 673, 848 | "type": "PreviewBridge", 849 | "pos": [ 850 | -1878, 851 | 710 852 | ], 853 | "size": { 854 | "0": 315, 855 | "1": 290 856 | }, 857 | "flags": {}, 858 | "order": 45, 859 | "mode": 0, 860 | "inputs": [ 861 | { 862 | "name": "images", 863 | "type": "IMAGE", 864 | "link": 1702 865 | } 866 | ], 867 | "outputs": [ 868 | { 869 | "name": "IMAGE", 870 | "type": "IMAGE", 871 | "links": [], 872 | "shape": 3, 873 | "slot_index": 0 874 | }, 875 | { 876 | "name": "MASK", 877 | "type": "MASK", 878 | "links": null, 879 | "shape": 3 880 | } 881 | ], 882 | "properties": { 883 | "Node name for S&R": "PreviewBridge" 884 | }, 885 | "widgets_values": [ 886 | "$673-0" 887 | ] 888 | }, 889 | { 890 | "id": 809, 891 | "type": "PreviewBridge", 892 | "pos": [ 893 | -3322, 894 | 1031 895 | ], 896 | "size": { 897 | "0": 315, 898 | "1": 290 899 | }, 900 | "flags": {}, 901 | "order": 29, 902 | "mode": 0, 903 | "inputs": [ 904 | { 905 | "name": "images", 906 | "type": "IMAGE", 907 | "link": 1748 908 | } 909 | ], 910 | "outputs": [ 911 | { 912 | "name": "IMAGE", 913 | "type": "IMAGE", 914 | "links": [], 915 | "shape": 3, 916 | "slot_index": 0 917 | }, 918 | { 919 | "name": "MASK", 920 | "type": "MASK", 921 | "links": null, 922 | "shape": 3 923 | } 924 | ], 925 | "properties": { 926 | "Node name for S&R": "PreviewBridge" 927 | }, 928 | "widgets_values": [ 929 | "$809-0" 930 | ] 931 | }, 932 | { 933 | "id": 814, 934 | "type": "ControlNetApply", 935 | "pos": [ 936 | -3329, 937 | 857 938 | ], 939 | "size": { 940 | "0": 317.4000244140625, 941 | "1": 98 942 | }, 943 | "flags": {}, 944 | "order": 30, 945 | "mode": 0, 946 | "inputs": [ 947 | { 948 | "name": "conditioning", 949 | "type": "CONDITIONING", 950 | "link": 1771 951 | }, 952 | { 953 | "name": "control_net", 954 | "type": "CONTROL_NET", 955 | "link": 1770, 956 | "slot_index": 1 957 | }, 958 | { 959 | "name": "image", 960 | "type": "IMAGE", 961 | "link": 1772 962 | } 963 | ], 964 | "outputs": [ 965 | { 966 | "name": "CONDITIONING", 967 | "type": "CONDITIONING", 968 | "links": [ 969 | 1775 970 | ], 971 | "shape": 3, 972 | "slot_index": 0 973 | } 974 | ], 975 | "properties": { 976 | "Node name for S&R": "ControlNetApply" 977 | }, 978 | "widgets_values": [ 979 | 1 980 | ] 981 | }, 982 | { 983 | "id": 811, 984 | "type": "JWImageResize", 985 | "pos": [ 986 | -4541, 987 | 1128 988 | ], 989 | "size": { 990 | "0": 315, 991 | "1": 106 992 | }, 993 | "flags": {}, 994 | "order": 14, 995 | "mode": 0, 996 | "inputs": [ 997 | { 998 | "name": "image", 999 | "type": "IMAGE", 1000 | "link": 1750 1001 | }, 1002 | { 1003 | "name": "width", 1004 | "type": "INT", 1005 | "link": 1752, 1006 | "widget": { 1007 | "name": "width" 1008 | } 1009 | }, 1010 | { 1011 | "name": "height", 1012 | "type": "INT", 1013 | "link": 1754, 1014 | "widget": { 1015 | "name": "height" 1016 | } 1017 | } 1018 | ], 1019 | "outputs": [ 1020 | { 1021 | "name": "IMAGE", 1022 | "type": "IMAGE", 1023 | "links": [ 1024 | 1751 1025 | ], 1026 | "shape": 3, 1027 | "slot_index": 0 1028 | } 1029 | ], 1030 | "properties": { 1031 | "Node name for S&R": "JWImageResize" 1032 | }, 1033 | "widgets_values": [ 1034 | 512, 1035 | 512, 1036 | "bicubic" 1037 | ] 1038 | }, 1039 | { 1040 | "id": 807, 1041 | "type": "Image Blending Mode", 1042 | "pos": [ 1043 | -3764, 1044 | 1019 1045 | ], 1046 | "size": { 1047 | "0": 315, 1048 | "1": 102 1049 | }, 1050 | "flags": {}, 1051 | "order": 24, 1052 | "mode": 0, 1053 | "inputs": [ 1054 | { 1055 | "name": "image_a", 1056 | "type": "IMAGE", 1057 | "link": 1746 1058 | }, 1059 | { 1060 | "name": "image_b", 1061 | "type": "IMAGE", 1062 | "link": 1747 1063 | } 1064 | ], 1065 | "outputs": [ 1066 | { 1067 | "name": "image", 1068 | "type": "IMAGE", 1069 | "links": [ 1070 | 1748, 1071 | 1772 1072 | ], 1073 | "shape": 3, 1074 | "slot_index": 0 1075 | } 1076 | ], 1077 | "properties": { 1078 | "Node name for S&R": "Image Blending Mode" 1079 | }, 1080 | "widgets_values": [ 1081 | "screen", 1082 | 1 1083 | ] 1084 | }, 1085 | { 1086 | "id": 825, 1087 | "type": "BrushNetLoader", 1088 | "pos": [ 1089 | -1118, 1090 | -76 1091 | ], 1092 | "size": { 1093 | "0": 315, 1094 | "1": 82 1095 | }, 1096 | "flags": {}, 1097 | "order": 1, 1098 | "mode": 0, 1099 | "outputs": [ 1100 | { 1101 | "name": "brushnet", 1102 | "type": "BRMODEL", 1103 | "links": [ 1104 | 1791 1105 | ], 1106 | "shape": 3, 1107 | "slot_index": 0 1108 | } 1109 | ], 1110 | "properties": { 1111 | "Node name for S&R": "BrushNetLoader" 1112 | }, 1113 | "widgets_values": [ 1114 | "powerpaint/powerpaint_v2.safetensors", 1115 | "float16" 1116 | ] 1117 | }, 1118 | { 1119 | "id": 823, 1120 | "type": "PowerPaintCLIPLoader", 1121 | "pos": [ 1122 | -708, 1123 | -51 1124 | ], 1125 | "size": { 1126 | "0": 315, 1127 | "1": 82 1128 | }, 1129 | "flags": {}, 1130 | "order": 2, 1131 | "mode": 0, 1132 | "outputs": [ 1133 | { 1134 | "name": "clip", 1135 | "type": "CLIP", 1136 | "links": [ 1137 | 1792 1138 | ], 1139 | "shape": 3, 1140 | "slot_index": 0 1141 | } 1142 | ], 1143 | "properties": { 1144 | "Node name for S&R": "PowerPaintCLIPLoader" 1145 | }, 1146 | "widgets_values": [ 1147 | "sd15_text_encoder.safetensors", 1148 | "powerpaint/pytorch_model.bin" 1149 | ] 1150 | }, 1151 | { 1152 | "id": 824, 1153 | "type": "PowerPaint", 1154 | "pos": [ 1155 | -699, 1156 | 117 1157 | ], 1158 | "size": { 1159 | "0": 315, 1160 | "1": 318 1161 | }, 1162 | "flags": {}, 1163 | "order": 50, 1164 | "mode": 0, 1165 | "inputs": [ 1166 | { 1167 | "name": "model", 1168 | "type": "MODEL", 1169 | "link": 1796 1170 | }, 1171 | { 1172 | "name": "vae", 1173 | "type": "VAE", 1174 | "link": 1795 1175 | }, 1176 | { 1177 | "name": "image", 1178 | "type": "IMAGE", 1179 | "link": 1817 1180 | }, 1181 | { 1182 | "name": "mask", 1183 | "type": "MASK", 1184 | "link": 1800 1185 | }, 1186 | { 1187 | "name": "powerpaint", 1188 | "type": "BRMODEL", 1189 | "link": 1791 1190 | }, 1191 | { 1192 | "name": "clip", 1193 | "type": "CLIP", 1194 | "link": 1792 1195 | }, 1196 | { 1197 | "name": "positive", 1198 | "type": "CONDITIONING", 1199 | "link": 1793 1200 | }, 1201 | { 1202 | "name": "negative", 1203 | "type": "CONDITIONING", 1204 | "link": 1794 1205 | } 1206 | ], 1207 | "outputs": [ 1208 | { 1209 | "name": "model", 1210 | "type": "MODEL", 1211 | "links": [ 1212 | 1801 1213 | ], 1214 | "shape": 3, 1215 | "slot_index": 0 1216 | }, 1217 | { 1218 | "name": "positive", 1219 | "type": "CONDITIONING", 1220 | "links": [ 1221 | 1802 1222 | ], 1223 | "shape": 3, 1224 | "slot_index": 1 1225 | }, 1226 | { 1227 | "name": "negative", 1228 | "type": "CONDITIONING", 1229 | "links": [ 1230 | 1803 1231 | ], 1232 | "shape": 3, 1233 | "slot_index": 2 1234 | }, 1235 | { 1236 | "name": "latent", 1237 | "type": "LATENT", 1238 | "links": [ 1239 | 1804 1240 | ], 1241 | "shape": 3, 1242 | "slot_index": 3 1243 | } 1244 | ], 1245 | "properties": { 1246 | "Node name for S&R": "PowerPaint" 1247 | }, 1248 | "widgets_values": [ 1249 | 1, 1250 | "text guided", 1251 | 1, 1252 | 0, 1253 | 10000, 1254 | "none" 1255 | ] 1256 | }, 1257 | { 1258 | "id": 828, 1259 | "type": "KSampler", 1260 | "pos": [ 1261 | -336, 1262 | 140 1263 | ], 1264 | "size": { 1265 | "0": 315, 1266 | "1": 262 1267 | }, 1268 | "flags": {}, 1269 | "order": 52, 1270 | "mode": 0, 1271 | "inputs": [ 1272 | { 1273 | "name": "model", 1274 | "type": "MODEL", 1275 | "link": 1801 1276 | }, 1277 | { 1278 | "name": "positive", 1279 | "type": "CONDITIONING", 1280 | "link": 1802 1281 | }, 1282 | { 1283 | "name": "negative", 1284 | "type": "CONDITIONING", 1285 | "link": 1803 1286 | }, 1287 | { 1288 | "name": "latent_image", 1289 | "type": "LATENT", 1290 | "link": 1804 1291 | } 1292 | ], 1293 | "outputs": [ 1294 | { 1295 | "name": "LATENT", 1296 | "type": "LATENT", 1297 | "links": [ 1298 | 1805 1299 | ], 1300 | "shape": 3, 1301 | "slot_index": 0 1302 | } 1303 | ], 1304 | "properties": { 1305 | "Node name for S&R": "KSampler" 1306 | }, 1307 | "widgets_values": [ 1308 | 892517855741225, 1309 | "fixed", 1310 | 20, 1311 | 3.6, 1312 | "dpmpp_2m_sde", 1313 | "karras", 1314 | 1 1315 | ] 1316 | }, 1317 | { 1318 | "id": 829, 1319 | "type": "VAEDecode", 1320 | "pos": [ 1321 | -321, 1322 | 472 1323 | ], 1324 | "size": { 1325 | "0": 210, 1326 | "1": 46 1327 | }, 1328 | "flags": {}, 1329 | "order": 53, 1330 | "mode": 0, 1331 | "inputs": [ 1332 | { 1333 | "name": "samples", 1334 | "type": "LATENT", 1335 | "link": 1805 1336 | }, 1337 | { 1338 | "name": "vae", 1339 | "type": "VAE", 1340 | "link": 1806 1341 | } 1342 | ], 1343 | "outputs": [ 1344 | { 1345 | "name": "IMAGE", 1346 | "type": "IMAGE", 1347 | "links": [ 1348 | 1807 1349 | ], 1350 | "shape": 3, 1351 | "slot_index": 0 1352 | } 1353 | ], 1354 | "properties": { 1355 | "Node name for S&R": "VAEDecode" 1356 | } 1357 | }, 1358 | { 1359 | "id": 767, 1360 | "type": "DeepDanbooruCaption", 1361 | "pos": [ 1362 | -4329, 1363 | -241 1364 | ], 1365 | "size": { 1366 | "0": 400, 1367 | "1": 268 1368 | }, 1369 | "flags": {}, 1370 | "order": 6, 1371 | "mode": 0, 1372 | "inputs": [ 1373 | { 1374 | "name": "image", 1375 | "type": "IMAGE", 1376 | "link": 1651 1377 | } 1378 | ], 1379 | "outputs": [ 1380 | { 1381 | "name": "caption", 1382 | "type": "STRING", 1383 | "links": [ 1384 | 1652 1385 | ], 1386 | "shape": 6, 1387 | "slot_index": 0 1388 | } 1389 | ], 1390 | "properties": { 1391 | "Node name for S&R": "DeepDanbooruCaption" 1392 | }, 1393 | "widgets_values": [ 1394 | 0.6, 1395 | true, 1396 | true, 1397 | true, 1398 | "", 1399 | "AUTO", 1400 | "", 1401 | "", 1402 | true 1403 | ] 1404 | }, 1405 | { 1406 | "id": 826, 1407 | "type": "GrowMask", 1408 | "pos": [ 1409 | -2227, 1410 | -653 1411 | ], 1412 | "size": { 1413 | "0": 315, 1414 | "1": 82 1415 | }, 1416 | "flags": {}, 1417 | "order": 35, 1418 | "mode": 0, 1419 | "inputs": [ 1420 | { 1421 | "name": "mask", 1422 | "type": "MASK", 1423 | "link": 1799 1424 | } 1425 | ], 1426 | "outputs": [ 1427 | { 1428 | "name": "MASK", 1429 | "type": "MASK", 1430 | "links": [ 1431 | 1800, 1432 | 1808 1433 | ], 1434 | "shape": 3, 1435 | "slot_index": 0 1436 | } 1437 | ], 1438 | "properties": { 1439 | "Node name for S&R": "GrowMask" 1440 | }, 1441 | "widgets_values": [ 1442 | 5, 1443 | true 1444 | ] 1445 | }, 1446 | { 1447 | "id": 831, 1448 | "type": "MaskToImage", 1449 | "pos": [ 1450 | -2227, 1451 | -490 1452 | ], 1453 | "size": { 1454 | "0": 210, 1455 | "1": 26 1456 | }, 1457 | "flags": {}, 1458 | "order": 38, 1459 | "mode": 0, 1460 | "inputs": [ 1461 | { 1462 | "name": "mask", 1463 | "type": "MASK", 1464 | "link": 1808 1465 | } 1466 | ], 1467 | "outputs": [ 1468 | { 1469 | "name": "IMAGE", 1470 | "type": "IMAGE", 1471 | "links": [ 1472 | 1809 1473 | ], 1474 | "shape": 3, 1475 | "slot_index": 0 1476 | } 1477 | ], 1478 | "properties": { 1479 | "Node name for S&R": "MaskToImage" 1480 | } 1481 | }, 1482 | { 1483 | "id": 832, 1484 | "type": "PreviewImage", 1485 | "pos": [ 1486 | -1969, 1487 | -490 1488 | ], 1489 | "size": { 1490 | "0": 210, 1491 | "1": 246 1492 | }, 1493 | "flags": {}, 1494 | "order": 41, 1495 | "mode": 0, 1496 | "inputs": [ 1497 | { 1498 | "name": "images", 1499 | "type": "IMAGE", 1500 | "link": 1809 1501 | } 1502 | ], 1503 | "properties": { 1504 | "Node name for S&R": "PreviewImage" 1505 | } 1506 | }, 1507 | { 1508 | "id": 653, 1509 | "type": "PreviewImage", 1510 | "pos": [ 1511 | -2611, 1512 | -555 1513 | ], 1514 | "size": { 1515 | "0": 210, 1516 | "1": 246 1517 | }, 1518 | "flags": {}, 1519 | "order": 31, 1520 | "mode": 0, 1521 | "inputs": [ 1522 | { 1523 | "name": "images", 1524 | "type": "IMAGE", 1525 | "link": 1778 1526 | } 1527 | ], 1528 | "properties": { 1529 | "Node name for S&R": "PreviewImage" 1530 | } 1531 | }, 1532 | { 1533 | "id": 670, 1534 | "type": "KSampler", 1535 | "pos": [ 1536 | -1837, 1537 | 373 1538 | ], 1539 | "size": { 1540 | "0": 315, 1541 | "1": 262 1542 | }, 1543 | "flags": { 1544 | "collapsed": false 1545 | }, 1546 | "order": 42, 1547 | "mode": 0, 1548 | "inputs": [ 1549 | { 1550 | "name": "model", 1551 | "type": "MODEL", 1552 | "link": 1524 1553 | }, 1554 | { 1555 | "name": "positive", 1556 | "type": "CONDITIONING", 1557 | "link": 1775 1558 | }, 1559 | { 1560 | "name": "negative", 1561 | "type": "CONDITIONING", 1562 | "link": 1625 1563 | }, 1564 | { 1565 | "name": "latent_image", 1566 | "type": "LATENT", 1567 | "link": 1525 1568 | } 1569 | ], 1570 | "outputs": [ 1571 | { 1572 | "name": "LATENT", 1573 | "type": "LATENT", 1574 | "links": [ 1575 | 1528 1576 | ], 1577 | "shape": 3, 1578 | "slot_index": 0 1579 | } 1580 | ], 1581 | "properties": { 1582 | "Node name for S&R": "KSampler" 1583 | }, 1584 | "widgets_values": [ 1585 | 3, 1586 | "fixed", 1587 | 10, 1588 | 3.6, 1589 | "dpmpp_2m_sde", 1590 | "karras", 1591 | 0.5 1592 | ] 1593 | }, 1594 | { 1595 | "id": 815, 1596 | "type": "Image Blend by Mask", 1597 | "pos": [ 1598 | -1454, 1599 | 1059 1600 | ], 1601 | "size": { 1602 | "0": 315, 1603 | "1": 98 1604 | }, 1605 | "flags": {}, 1606 | "order": 49, 1607 | "mode": 0, 1608 | "inputs": [ 1609 | { 1610 | "name": "image_a", 1611 | "type": "IMAGE", 1612 | "link": 1776 1613 | }, 1614 | { 1615 | "name": "image_b", 1616 | "type": "IMAGE", 1617 | "link": 1781 1618 | }, 1619 | { 1620 | "name": "mask", 1621 | "type": "IMAGE", 1622 | "link": 1825 1623 | } 1624 | ], 1625 | "outputs": [ 1626 | { 1627 | "name": "IMAGE", 1628 | "type": "IMAGE", 1629 | "links": [ 1630 | 1783 1631 | ], 1632 | "shape": 3, 1633 | "slot_index": 0 1634 | } 1635 | ], 1636 | "properties": { 1637 | "Node name for S&R": "Image Blend by Mask" 1638 | }, 1639 | "widgets_values": [ 1640 | 0.5 1641 | ] 1642 | }, 1643 | { 1644 | "id": 820, 1645 | "type": "PreviewBridge", 1646 | "pos": [ 1647 | -1458, 1648 | 1226 1649 | ], 1650 | "size": { 1651 | "0": 315, 1652 | "1": 290 1653 | }, 1654 | "flags": {}, 1655 | "order": 51, 1656 | "mode": 0, 1657 | "inputs": [ 1658 | { 1659 | "name": "images", 1660 | "type": "IMAGE", 1661 | "link": 1783 1662 | } 1663 | ], 1664 | "outputs": [ 1665 | { 1666 | "name": "IMAGE", 1667 | "type": "IMAGE", 1668 | "links": [], 1669 | "shape": 3, 1670 | "slot_index": 0 1671 | }, 1672 | { 1673 | "name": "MASK", 1674 | "type": "MASK", 1675 | "links": null, 1676 | "shape": 3 1677 | } 1678 | ], 1679 | "properties": { 1680 | "Node name for S&R": "PreviewBridge" 1681 | }, 1682 | "widgets_values": [ 1683 | "$820-0" 1684 | ] 1685 | }, 1686 | { 1687 | "id": 714, 1688 | "type": "Image Blend by Mask", 1689 | "pos": [ 1690 | -1455, 1691 | 542 1692 | ], 1693 | "size": { 1694 | "0": 315, 1695 | "1": 98 1696 | }, 1697 | "flags": {}, 1698 | "order": 44, 1699 | "mode": 0, 1700 | "inputs": [ 1701 | { 1702 | "name": "image_a", 1703 | "type": "IMAGE", 1704 | "link": 1828 1705 | }, 1706 | { 1707 | "name": "image_b", 1708 | "type": "IMAGE", 1709 | "link": 1628 1710 | }, 1711 | { 1712 | "name": "mask", 1713 | "type": "IMAGE", 1714 | "link": 1837 1715 | } 1716 | ], 1717 | "outputs": [ 1718 | { 1719 | "name": "IMAGE", 1720 | "type": "IMAGE", 1721 | "links": [ 1722 | 1599 1723 | ], 1724 | "shape": 3, 1725 | "slot_index": 0 1726 | } 1727 | ], 1728 | "properties": { 1729 | "Node name for S&R": "Image Blend by Mask" 1730 | }, 1731 | "widgets_values": [ 1732 | 1 1733 | ] 1734 | }, 1735 | { 1736 | "id": 672, 1737 | "type": "VAEDecode", 1738 | "pos": [ 1739 | -1361, 1740 | 371 1741 | ], 1742 | "size": { 1743 | "0": 210, 1744 | "1": 46 1745 | }, 1746 | "flags": {}, 1747 | "order": 43, 1748 | "mode": 0, 1749 | "inputs": [ 1750 | { 1751 | "name": "samples", 1752 | "type": "LATENT", 1753 | "link": 1528 1754 | }, 1755 | { 1756 | "name": "vae", 1757 | "type": "VAE", 1758 | "link": 1529 1759 | } 1760 | ], 1761 | "outputs": [ 1762 | { 1763 | "name": "IMAGE", 1764 | "type": "IMAGE", 1765 | "links": [ 1766 | 1628, 1767 | 1702, 1768 | 1829 1769 | ], 1770 | "shape": 3, 1771 | "slot_index": 0 1772 | } 1773 | ], 1774 | "properties": { 1775 | "Node name for S&R": "VAEDecode" 1776 | } 1777 | }, 1778 | { 1779 | "id": 715, 1780 | "type": "PreviewBridge", 1781 | "pos": [ 1782 | -1456, 1783 | 714 1784 | ], 1785 | "size": { 1786 | "0": 315, 1787 | "1": 290 1788 | }, 1789 | "flags": {}, 1790 | "order": 47, 1791 | "mode": 0, 1792 | "inputs": [ 1793 | { 1794 | "name": "images", 1795 | "type": "IMAGE", 1796 | "link": 1599 1797 | } 1798 | ], 1799 | "outputs": [ 1800 | { 1801 | "name": "IMAGE", 1802 | "type": "IMAGE", 1803 | "links": [ 1804 | 1776, 1805 | 1817 1806 | ], 1807 | "shape": 3, 1808 | "slot_index": 0 1809 | }, 1810 | { 1811 | "name": "MASK", 1812 | "type": "MASK", 1813 | "links": null, 1814 | "shape": 3 1815 | } 1816 | ], 1817 | "properties": { 1818 | "Node name for S&R": "PreviewBridge" 1819 | }, 1820 | "widgets_values": [ 1821 | "$715-0" 1822 | ] 1823 | }, 1824 | { 1825 | "id": 851, 1826 | "type": "PreviewBridge", 1827 | "pos": [ 1828 | -1077, 1829 | 709 1830 | ], 1831 | "size": { 1832 | "0": 315, 1833 | "1": 290 1834 | }, 1835 | "flags": {}, 1836 | "order": 48, 1837 | "mode": 0, 1838 | "inputs": [ 1839 | { 1840 | "name": "images", 1841 | "type": "IMAGE", 1842 | "link": 1832 1843 | } 1844 | ], 1845 | "outputs": [ 1846 | { 1847 | "name": "IMAGE", 1848 | "type": "IMAGE", 1849 | "links": [], 1850 | "shape": 3, 1851 | "slot_index": 0 1852 | }, 1853 | { 1854 | "name": "MASK", 1855 | "type": "MASK", 1856 | "links": null, 1857 | "shape": 3 1858 | } 1859 | ], 1860 | "properties": { 1861 | "Node name for S&R": "PreviewBridge" 1862 | }, 1863 | "widgets_values": [ 1864 | "$851-0" 1865 | ] 1866 | }, 1867 | { 1868 | "id": 850, 1869 | "type": "Image Blend by Mask", 1870 | "pos": [ 1871 | -1089, 1872 | 519 1873 | ], 1874 | "size": { 1875 | "0": 315, 1876 | "1": 98 1877 | }, 1878 | "flags": {}, 1879 | "order": 46, 1880 | "mode": 0, 1881 | "inputs": [ 1882 | { 1883 | "name": "image_a", 1884 | "type": "IMAGE", 1885 | "link": 1830 1886 | }, 1887 | { 1888 | "name": "image_b", 1889 | "type": "IMAGE", 1890 | "link": 1829 1891 | }, 1892 | { 1893 | "name": "mask", 1894 | "type": "IMAGE", 1895 | "link": 1836 1896 | } 1897 | ], 1898 | "outputs": [ 1899 | { 1900 | "name": "IMAGE", 1901 | "type": "IMAGE", 1902 | "links": [ 1903 | 1832 1904 | ], 1905 | "shape": 3, 1906 | "slot_index": 0 1907 | } 1908 | ], 1909 | "properties": { 1910 | "Node name for S&R": "Image Blend by Mask" 1911 | }, 1912 | "widgets_values": [ 1913 | 1 1914 | ] 1915 | }, 1916 | { 1917 | "id": 847, 1918 | "type": "MaskToImage", 1919 | "pos": [ 1920 | -3865, 1921 | -244 1922 | ], 1923 | "size": { 1924 | "0": 220.39073181152344, 1925 | "1": 51.86518859863281 1926 | }, 1927 | "flags": {}, 1928 | "order": 23, 1929 | "mode": 0, 1930 | "inputs": [ 1931 | { 1932 | "name": "mask", 1933 | "type": "MASK", 1934 | "link": 1822 1935 | } 1936 | ], 1937 | "outputs": [ 1938 | { 1939 | "name": "IMAGE", 1940 | "type": "IMAGE", 1941 | "links": [ 1942 | 1823, 1943 | 1834 1944 | ], 1945 | "shape": 3, 1946 | "slot_index": 0 1947 | } 1948 | ], 1949 | "properties": { 1950 | "Node name for S&R": "MaskToImage" 1951 | } 1952 | }, 1953 | { 1954 | "id": 849, 1955 | "type": "PreviewImage", 1956 | "pos": [ 1957 | -4023, 1958 | -834 1959 | ], 1960 | "size": { 1961 | "0": 210, 1962 | "1": 246 1963 | }, 1964 | "flags": {}, 1965 | "order": 22, 1966 | "mode": 0, 1967 | "inputs": [ 1968 | { 1969 | "name": "images", 1970 | "type": "IMAGE", 1971 | "link": 1827 1972 | } 1973 | ], 1974 | "properties": { 1975 | "Node name for S&R": "PreviewImage" 1976 | } 1977 | }, 1978 | { 1979 | "id": 848, 1980 | "type": "PreviewImage", 1981 | "pos": [ 1982 | -3749, 1983 | -827 1984 | ], 1985 | "size": { 1986 | "0": 210, 1987 | "1": 246 1988 | }, 1989 | "flags": {}, 1990 | "order": 27, 1991 | "mode": 0, 1992 | "inputs": [ 1993 | { 1994 | "name": "images", 1995 | "type": "IMAGE", 1996 | "link": 1823 1997 | } 1998 | ], 1999 | "properties": { 2000 | "Node name for S&R": "PreviewImage" 2001 | } 2002 | }, 2003 | { 2004 | "id": 855, 2005 | "type": "PreviewImage", 2006 | "pos": [ 2007 | -3106, 2008 | -822 2009 | ], 2010 | "size": { 2011 | "0": 210, 2012 | "1": 246 2013 | }, 2014 | "flags": {}, 2015 | "order": 34, 2016 | "mode": 0, 2017 | "inputs": [ 2018 | { 2019 | "name": "images", 2020 | "type": "IMAGE", 2021 | "link": 1835 2022 | } 2023 | ], 2024 | "properties": { 2025 | "Node name for S&R": "PreviewImage" 2026 | } 2027 | }, 2028 | { 2029 | "id": 854, 2030 | "type": "Image Blending Mode", 2031 | "pos": [ 2032 | -3492, 2033 | -813 2034 | ], 2035 | "size": { 2036 | "0": 315, 2037 | "1": 102 2038 | }, 2039 | "flags": {}, 2040 | "order": 28, 2041 | "mode": 0, 2042 | "inputs": [ 2043 | { 2044 | "name": "image_a", 2045 | "type": "IMAGE", 2046 | "link": 1834 2047 | }, 2048 | { 2049 | "name": "image_b", 2050 | "type": "IMAGE", 2051 | "link": 1833 2052 | } 2053 | ], 2054 | "outputs": [ 2055 | { 2056 | "name": "image", 2057 | "type": "IMAGE", 2058 | "links": [ 2059 | 1835, 2060 | 1836 2061 | ], 2062 | "shape": 3, 2063 | "slot_index": 0 2064 | } 2065 | ], 2066 | "properties": { 2067 | "Node name for S&R": "Image Blending Mode" 2068 | }, 2069 | "widgets_values": [ 2070 | "multiply", 2071 | 1 2072 | ] 2073 | }, 2074 | { 2075 | "id": 846, 2076 | "type": "ImpactGaussianBlurMask", 2077 | "pos": [ 2078 | -3883, 2079 | -401 2080 | ], 2081 | "size": { 2082 | "0": 315, 2083 | "1": 82 2084 | }, 2085 | "flags": {}, 2086 | "order": 17, 2087 | "mode": 0, 2088 | "inputs": [ 2089 | { 2090 | "name": "mask", 2091 | "type": "MASK", 2092 | "link": 1840 2093 | } 2094 | ], 2095 | "outputs": [ 2096 | { 2097 | "name": "MASK", 2098 | "type": "MASK", 2099 | "links": [ 2100 | 1822 2101 | ], 2102 | "shape": 3, 2103 | "slot_index": 0 2104 | } 2105 | ], 2106 | "properties": { 2107 | "Node name for S&R": "ImpactGaussianBlurMask" 2108 | }, 2109 | "widgets_values": [ 2110 | 5, 2111 | 10 2112 | ] 2113 | }, 2114 | { 2115 | "id": 830, 2116 | "type": "PreviewBridge", 2117 | "pos": [ 2118 | -719, 2119 | 713 2120 | ], 2121 | "size": { 2122 | "0": 315, 2123 | "1": 290 2124 | }, 2125 | "flags": {}, 2126 | "order": 54, 2127 | "mode": 0, 2128 | "inputs": [ 2129 | { 2130 | "name": "images", 2131 | "type": "IMAGE", 2132 | "link": 1807 2133 | } 2134 | ], 2135 | "outputs": [ 2136 | { 2137 | "name": "IMAGE", 2138 | "type": "IMAGE", 2139 | "links": [], 2140 | "shape": 3, 2141 | "slot_index": 0 2142 | }, 2143 | { 2144 | "name": "MASK", 2145 | "type": "MASK", 2146 | "links": null, 2147 | "shape": 3 2148 | } 2149 | ], 2150 | "properties": { 2151 | "Node name for S&R": "PreviewBridge" 2152 | }, 2153 | "widgets_values": [ 2154 | "$830-0" 2155 | ] 2156 | }, 2157 | { 2158 | "id": 700, 2159 | "type": "PreviewBridge", 2160 | "pos": [ 2161 | -371, 2162 | 713 2163 | ], 2164 | "size": { 2165 | "0": 315, 2166 | "1": 290 2167 | }, 2168 | "flags": {}, 2169 | "order": 5, 2170 | "mode": 0, 2171 | "inputs": [ 2172 | { 2173 | "name": "images", 2174 | "type": "IMAGE", 2175 | "link": 1577 2176 | } 2177 | ], 2178 | "outputs": [ 2179 | { 2180 | "name": "IMAGE", 2181 | "type": "IMAGE", 2182 | "links": [], 2183 | "shape": 3, 2184 | "slot_index": 0 2185 | }, 2186 | { 2187 | "name": "MASK", 2188 | "type": "MASK", 2189 | "links": null, 2190 | "shape": 3 2191 | } 2192 | ], 2193 | "properties": { 2194 | "Node name for S&R": "PreviewBridge" 2195 | }, 2196 | "widgets_values": [ 2197 | "$700-0" 2198 | ] 2199 | }, 2200 | { 2201 | "id": 645, 2202 | "type": "MaskToImage", 2203 | "pos": [ 2204 | -3851, 2205 | -517 2206 | ], 2207 | "size": { 2208 | "0": 220.39073181152344, 2209 | "1": 51.86518859863281 2210 | }, 2211 | "flags": {}, 2212 | "order": 16, 2213 | "mode": 0, 2214 | "inputs": [ 2215 | { 2216 | "name": "mask", 2217 | "type": "MASK", 2218 | "link": 1839 2219 | } 2220 | ], 2221 | "outputs": [ 2222 | { 2223 | "name": "IMAGE", 2224 | "type": "IMAGE", 2225 | "links": [ 2226 | 1455, 2227 | 1475, 2228 | 1747, 2229 | 1788, 2230 | 1827, 2231 | 1833, 2232 | 1837 2233 | ], 2234 | "shape": 3, 2235 | "slot_index": 0 2236 | } 2237 | ], 2238 | "properties": { 2239 | "Node name for S&R": "MaskToImage" 2240 | } 2241 | }, 2242 | { 2243 | "id": 856, 2244 | "type": "Add_text_by_mask", 2245 | "pos": [ 2246 | -4291, 2247 | -521 2248 | ], 2249 | "size": { 2250 | "0": 315, 2251 | "1": 150 2252 | }, 2253 | "flags": {}, 2254 | "order": 9, 2255 | "mode": 0, 2256 | "inputs": [ 2257 | { 2258 | "name": "image", 2259 | "type": "IMAGE", 2260 | "link": 1841 2261 | }, 2262 | { 2263 | "name": "mask", 2264 | "type": "MASK", 2265 | "link": 1838 2266 | } 2267 | ], 2268 | "outputs": [ 2269 | { 2270 | "name": "image", 2271 | "type": "IMAGE", 2272 | "links": null, 2273 | "shape": 3 2274 | }, 2275 | { 2276 | "name": "mask", 2277 | "type": "MASK", 2278 | "links": [ 2279 | 1839, 2280 | 1840 2281 | ], 2282 | "shape": 3, 2283 | "slot_index": 1 2284 | } 2285 | ], 2286 | "properties": { 2287 | "Node name for S&R": "Add_text_by_mask" 2288 | }, 2289 | "widgets_values": [ 2290 | "庞门正道粗书体6.0.ttf", 2291 | "#000", 2292 | 1, 2293 | "兔展" 2294 | ] 2295 | }, 2296 | { 2297 | "id": 326, 2298 | "type": "LoadImage", 2299 | "pos": [ 2300 | -4822, 2301 | 192 2302 | ], 2303 | "size": { 2304 | "0": 315, 2305 | "1": 314.0000305175781 2306 | }, 2307 | "flags": {}, 2308 | "order": 3, 2309 | "mode": 0, 2310 | "outputs": [ 2311 | { 2312 | "name": "IMAGE", 2313 | "type": "IMAGE", 2314 | "links": [ 2315 | 1482, 2316 | 1577, 2317 | 1608, 2318 | 1630, 2319 | 1651, 2320 | 1744, 2321 | 1749, 2322 | 1828, 2323 | 1830, 2324 | 1841 2325 | ], 2326 | "shape": 3, 2327 | "slot_index": 0 2328 | }, 2329 | { 2330 | "name": "MASK", 2331 | "type": "MASK", 2332 | "links": [ 2333 | 1838 2334 | ], 2335 | "shape": 3, 2336 | "slot_index": 1 2337 | } 2338 | ], 2339 | "properties": { 2340 | "Node name for S&R": "LoadImage" 2341 | }, 2342 | "widgets_values": [ 2343 | "clipspace/clipspace-mask-454863.1999999881.png [input]", 2344 | "image" 2345 | ] 2346 | }, 2347 | { 2348 | "id": 819, 2349 | "type": "JWImageResize", 2350 | "pos": [ 2351 | -3063, 2352 | -512 2353 | ], 2354 | "size": { 2355 | "0": 315, 2356 | "1": 106 2357 | }, 2358 | "flags": {}, 2359 | "order": 25, 2360 | "mode": 0, 2361 | "inputs": [ 2362 | { 2363 | "name": "image", 2364 | "type": "IMAGE", 2365 | "link": 1842 2366 | }, 2367 | { 2368 | "name": "width", 2369 | "type": "INT", 2370 | "link": 1779, 2371 | "widget": { 2372 | "name": "width" 2373 | } 2374 | }, 2375 | { 2376 | "name": "height", 2377 | "type": "INT", 2378 | "link": 1780, 2379 | "widget": { 2380 | "name": "height" 2381 | } 2382 | } 2383 | ], 2384 | "outputs": [ 2385 | { 2386 | "name": "IMAGE", 2387 | "type": "IMAGE", 2388 | "links": [ 2389 | 1778, 2390 | 1781, 2391 | 1798, 2392 | 1825 2393 | ], 2394 | "shape": 3, 2395 | "slot_index": 0 2396 | } 2397 | ], 2398 | "properties": { 2399 | "Node name for S&R": "JWImageResize" 2400 | }, 2401 | "widgets_values": [ 2402 | 512, 2403 | 512, 2404 | "bicubic" 2405 | ] 2406 | }, 2407 | { 2408 | "id": 208, 2409 | "type": "CLIPTextEncode", 2410 | "pos": [ 2411 | -3849, 2412 | -7 2413 | ], 2414 | "size": { 2415 | "0": 400, 2416 | "1": 200 2417 | }, 2418 | "flags": {}, 2419 | "order": 13, 2420 | "mode": 0, 2421 | "inputs": [ 2422 | { 2423 | "name": "clip", 2424 | "type": "CLIP", 2425 | "link": 1843 2426 | }, 2427 | { 2428 | "name": "text", 2429 | "type": "STRING", 2430 | "link": 1652, 2431 | "widget": { 2432 | "name": "text" 2433 | } 2434 | } 2435 | ], 2436 | "outputs": [ 2437 | { 2438 | "name": "CONDITIONING", 2439 | "type": "CONDITIONING", 2440 | "links": [ 2441 | 1584, 2442 | 1771, 2443 | 1793 2444 | ], 2445 | "shape": 3, 2446 | "slot_index": 0 2447 | } 2448 | ], 2449 | "properties": { 2450 | "Node name for S&R": "CLIPTextEncode" 2451 | }, 2452 | "widgets_values": [ 2453 | "green tree" 2454 | ] 2455 | }, 2456 | { 2457 | "id": 82, 2458 | "type": "CheckpointLoaderSimple", 2459 | "pos": [ 2460 | -4844, 2461 | 590 2462 | ], 2463 | "size": { 2464 | "0": 315, 2465 | "1": 98 2466 | }, 2467 | "flags": {}, 2468 | "order": 4, 2469 | "mode": 0, 2470 | "outputs": [ 2471 | { 2472 | "name": "MODEL", 2473 | "type": "MODEL", 2474 | "links": [ 2475 | 1223, 2476 | 1796 2477 | ], 2478 | "shape": 3, 2479 | "slot_index": 0 2480 | }, 2481 | { 2482 | "name": "CLIP", 2483 | "type": "CLIP", 2484 | "links": [ 2485 | 605, 2486 | 1843 2487 | ], 2488 | "shape": 3, 2489 | "slot_index": 1 2490 | }, 2491 | { 2492 | "name": "VAE", 2493 | "type": "VAE", 2494 | "links": [ 2495 | 1527, 2496 | 1529, 2497 | 1592, 2498 | 1631, 2499 | 1795, 2500 | 1806 2501 | ], 2502 | "shape": 3, 2503 | "slot_index": 2 2504 | } 2505 | ], 2506 | "properties": { 2507 | "Node name for S&R": "CheckpointLoaderSimple" 2508 | }, 2509 | "widgets_values": [ 2510 | "SD1.5/Juggernaut_sd1.5.safetensors" 2511 | ] 2512 | } 2513 | ], 2514 | "links": [ 2515 | [ 2516 | 605, 2517 | 82, 2518 | 1, 2519 | 209, 2520 | 0, 2521 | "CLIP" 2522 | ], 2523 | [ 2524 | 797, 2525 | 325, 2526 | 0, 2527 | 324, 2528 | 0, 2529 | "MODEL" 2530 | ], 2531 | [ 2532 | 798, 2533 | 325, 2534 | 1, 2535 | 324, 2536 | 1, 2537 | "IPADAPTER" 2538 | ], 2539 | [ 2540 | 1223, 2541 | 82, 2542 | 0, 2543 | 325, 2544 | 0, 2545 | "MODEL" 2546 | ], 2547 | [ 2548 | 1455, 2549 | 645, 2550 | 0, 2551 | 649, 2552 | 0, 2553 | "IMAGE" 2554 | ], 2555 | [ 2556 | 1475, 2557 | 645, 2558 | 0, 2559 | 591, 2560 | 2, 2561 | "IMAGE" 2562 | ], 2563 | [ 2564 | 1482, 2565 | 326, 2566 | 0, 2567 | 591, 2568 | 0, 2569 | "IMAGE" 2570 | ], 2571 | [ 2572 | 1516, 2573 | 591, 2574 | 0, 2575 | 592, 2576 | 0, 2577 | "IMAGE" 2578 | ], 2579 | [ 2580 | 1524, 2581 | 324, 2582 | 0, 2583 | 670, 2584 | 0, 2585 | "MODEL" 2586 | ], 2587 | [ 2588 | 1525, 2589 | 671, 2590 | 0, 2591 | 670, 2592 | 3, 2593 | "LATENT" 2594 | ], 2595 | [ 2596 | 1527, 2597 | 82, 2598 | 2, 2599 | 671, 2600 | 1, 2601 | "VAE" 2602 | ], 2603 | [ 2604 | 1528, 2605 | 670, 2606 | 0, 2607 | 672, 2608 | 0, 2609 | "LATENT" 2610 | ], 2611 | [ 2612 | 1529, 2613 | 82, 2614 | 2, 2615 | 672, 2616 | 1, 2617 | "VAE" 2618 | ], 2619 | [ 2620 | 1577, 2621 | 326, 2622 | 0, 2623 | 700, 2624 | 0, 2625 | "IMAGE" 2626 | ], 2627 | [ 2628 | 1583, 2629 | 704, 2630 | 0, 2631 | 703, 2632 | 1, 2633 | "CONTROL_NET" 2634 | ], 2635 | [ 2636 | 1584, 2637 | 208, 2638 | 0, 2639 | 703, 2640 | 0, 2641 | "CONDITIONING" 2642 | ], 2643 | [ 2644 | 1587, 2645 | 209, 2646 | 0, 2647 | 705, 2648 | 2, 2649 | "CONDITIONING" 2650 | ], 2651 | [ 2652 | 1591, 2653 | 705, 2654 | 0, 2655 | 708, 2656 | 0, 2657 | "LATENT" 2658 | ], 2659 | [ 2660 | 1592, 2661 | 82, 2662 | 2, 2663 | 708, 2664 | 1, 2665 | "VAE" 2666 | ], 2667 | [ 2668 | 1599, 2669 | 714, 2670 | 0, 2671 | 715, 2672 | 0, 2673 | "IMAGE" 2674 | ], 2675 | [ 2676 | 1608, 2677 | 326, 2678 | 0, 2679 | 324, 2680 | 2, 2681 | "IMAGE" 2682 | ], 2683 | [ 2684 | 1621, 2685 | 591, 2686 | 0, 2687 | 671, 2688 | 0, 2689 | "IMAGE" 2690 | ], 2691 | [ 2692 | 1622, 2693 | 708, 2694 | 0, 2695 | 591, 2696 | 1, 2697 | "IMAGE" 2698 | ], 2699 | [ 2700 | 1623, 2701 | 708, 2702 | 0, 2703 | 709, 2704 | 0, 2705 | "IMAGE" 2706 | ], 2707 | [ 2708 | 1625, 2709 | 209, 2710 | 0, 2711 | 670, 2712 | 2, 2713 | "CONDITIONING" 2714 | ], 2715 | [ 2716 | 1628, 2717 | 672, 2718 | 0, 2719 | 714, 2720 | 1, 2721 | "IMAGE" 2722 | ], 2723 | [ 2724 | 1630, 2725 | 326, 2726 | 0, 2727 | 721, 2728 | 0, 2729 | "IMAGE" 2730 | ], 2731 | [ 2732 | 1631, 2733 | 82, 2734 | 2, 2735 | 721, 2736 | 1, 2737 | "VAE" 2738 | ], 2739 | [ 2740 | 1651, 2741 | 326, 2742 | 0, 2743 | 767, 2744 | 0, 2745 | "IMAGE" 2746 | ], 2747 | [ 2748 | 1652, 2749 | 767, 2750 | 0, 2751 | 208, 2752 | 1, 2753 | "STRING" 2754 | ], 2755 | [ 2756 | 1656, 2757 | 703, 2758 | 0, 2759 | 705, 2760 | 1, 2761 | "CONDITIONING" 2762 | ], 2763 | [ 2764 | 1702, 2765 | 672, 2766 | 0, 2767 | 673, 2768 | 0, 2769 | "IMAGE" 2770 | ], 2771 | [ 2772 | 1744, 2773 | 326, 2774 | 0, 2775 | 805, 2776 | 0, 2777 | "IMAGE" 2778 | ], 2779 | [ 2780 | 1746, 2781 | 806, 2782 | 0, 2783 | 807, 2784 | 0, 2785 | "IMAGE" 2786 | ], 2787 | [ 2788 | 1747, 2789 | 645, 2790 | 0, 2791 | 807, 2792 | 1, 2793 | "IMAGE" 2794 | ], 2795 | [ 2796 | 1748, 2797 | 807, 2798 | 0, 2799 | 809, 2800 | 0, 2801 | "IMAGE" 2802 | ], 2803 | [ 2804 | 1749, 2805 | 326, 2806 | 0, 2807 | 810, 2808 | 0, 2809 | "IMAGE" 2810 | ], 2811 | [ 2812 | 1750, 2813 | 805, 2814 | 0, 2815 | 811, 2816 | 0, 2817 | "IMAGE" 2818 | ], 2819 | [ 2820 | 1751, 2821 | 811, 2822 | 0, 2823 | 806, 2824 | 0, 2825 | "IMAGE" 2826 | ], 2827 | [ 2828 | 1752, 2829 | 810, 2830 | 0, 2831 | 811, 2832 | 1, 2833 | "INT" 2834 | ], 2835 | [ 2836 | 1754, 2837 | 810, 2838 | 1, 2839 | 811, 2840 | 2, 2841 | "INT" 2842 | ], 2843 | [ 2844 | 1760, 2845 | 813, 2846 | 0, 2847 | 705, 2848 | 3, 2849 | "LATENT" 2850 | ], 2851 | [ 2852 | 1761, 2853 | 810, 2854 | 0, 2855 | 813, 2856 | 0, 2857 | "INT" 2858 | ], 2859 | [ 2860 | 1762, 2861 | 810, 2862 | 1, 2863 | 813, 2864 | 1, 2865 | "INT" 2866 | ], 2867 | [ 2868 | 1770, 2869 | 704, 2870 | 0, 2871 | 814, 2872 | 1, 2873 | "CONTROL_NET" 2874 | ], 2875 | [ 2876 | 1771, 2877 | 208, 2878 | 0, 2879 | 814, 2880 | 0, 2881 | "CONDITIONING" 2882 | ], 2883 | [ 2884 | 1772, 2885 | 807, 2886 | 0, 2887 | 814, 2888 | 2, 2889 | "IMAGE" 2890 | ], 2891 | [ 2892 | 1775, 2893 | 814, 2894 | 0, 2895 | 670, 2896 | 1, 2897 | "CONDITIONING" 2898 | ], 2899 | [ 2900 | 1776, 2901 | 715, 2902 | 0, 2903 | 815, 2904 | 0, 2905 | "IMAGE" 2906 | ], 2907 | [ 2908 | 1778, 2909 | 819, 2910 | 0, 2911 | 653, 2912 | 0, 2913 | "IMAGE" 2914 | ], 2915 | [ 2916 | 1779, 2917 | 810, 2918 | 0, 2919 | 819, 2920 | 1, 2921 | "INT" 2922 | ], 2923 | [ 2924 | 1780, 2925 | 810, 2926 | 1, 2927 | 819, 2928 | 2, 2929 | "INT" 2930 | ], 2931 | [ 2932 | 1781, 2933 | 819, 2934 | 0, 2935 | 815, 2936 | 1, 2937 | "IMAGE" 2938 | ], 2939 | [ 2940 | 1783, 2941 | 815, 2942 | 0, 2943 | 820, 2944 | 0, 2945 | "IMAGE" 2946 | ], 2947 | [ 2948 | 1788, 2949 | 645, 2950 | 0, 2951 | 703, 2952 | 2, 2953 | "IMAGE" 2954 | ], 2955 | [ 2956 | 1789, 2957 | 324, 2958 | 0, 2959 | 705, 2960 | 0, 2961 | "MODEL" 2962 | ], 2963 | [ 2964 | 1791, 2965 | 825, 2966 | 0, 2967 | 824, 2968 | 4, 2969 | "BRMODEL" 2970 | ], 2971 | [ 2972 | 1792, 2973 | 823, 2974 | 0, 2975 | 824, 2976 | 5, 2977 | "CLIP" 2978 | ], 2979 | [ 2980 | 1793, 2981 | 208, 2982 | 0, 2983 | 824, 2984 | 6, 2985 | "CONDITIONING" 2986 | ], 2987 | [ 2988 | 1794, 2989 | 209, 2990 | 0, 2991 | 824, 2992 | 7, 2993 | "CONDITIONING" 2994 | ], 2995 | [ 2996 | 1795, 2997 | 82, 2998 | 2, 2999 | 824, 3000 | 1, 3001 | "VAE" 3002 | ], 3003 | [ 3004 | 1796, 3005 | 82, 3006 | 0, 3007 | 824, 3008 | 0, 3009 | "MODEL" 3010 | ], 3011 | [ 3012 | 1798, 3013 | 819, 3014 | 0, 3015 | 827, 3016 | 0, 3017 | "IMAGE" 3018 | ], 3019 | [ 3020 | 1799, 3021 | 827, 3022 | 0, 3023 | 826, 3024 | 0, 3025 | "MASK" 3026 | ], 3027 | [ 3028 | 1800, 3029 | 826, 3030 | 0, 3031 | 824, 3032 | 3, 3033 | "MASK" 3034 | ], 3035 | [ 3036 | 1801, 3037 | 824, 3038 | 0, 3039 | 828, 3040 | 0, 3041 | "MODEL" 3042 | ], 3043 | [ 3044 | 1802, 3045 | 824, 3046 | 1, 3047 | 828, 3048 | 1, 3049 | "CONDITIONING" 3050 | ], 3051 | [ 3052 | 1803, 3053 | 824, 3054 | 2, 3055 | 828, 3056 | 2, 3057 | "CONDITIONING" 3058 | ], 3059 | [ 3060 | 1804, 3061 | 824, 3062 | 3, 3063 | 828, 3064 | 3, 3065 | "LATENT" 3066 | ], 3067 | [ 3068 | 1805, 3069 | 828, 3070 | 0, 3071 | 829, 3072 | 0, 3073 | "LATENT" 3074 | ], 3075 | [ 3076 | 1806, 3077 | 82, 3078 | 2, 3079 | 829, 3080 | 1, 3081 | "VAE" 3082 | ], 3083 | [ 3084 | 1807, 3085 | 829, 3086 | 0, 3087 | 830, 3088 | 0, 3089 | "IMAGE" 3090 | ], 3091 | [ 3092 | 1808, 3093 | 826, 3094 | 0, 3095 | 831, 3096 | 0, 3097 | "MASK" 3098 | ], 3099 | [ 3100 | 1809, 3101 | 831, 3102 | 0, 3103 | 832, 3104 | 0, 3105 | "IMAGE" 3106 | ], 3107 | [ 3108 | 1817, 3109 | 715, 3110 | 0, 3111 | 824, 3112 | 2, 3113 | "IMAGE" 3114 | ], 3115 | [ 3116 | 1822, 3117 | 846, 3118 | 0, 3119 | 847, 3120 | 0, 3121 | "MASK" 3122 | ], 3123 | [ 3124 | 1823, 3125 | 847, 3126 | 0, 3127 | 848, 3128 | 0, 3129 | "IMAGE" 3130 | ], 3131 | [ 3132 | 1825, 3133 | 819, 3134 | 0, 3135 | 815, 3136 | 2, 3137 | "IMAGE" 3138 | ], 3139 | [ 3140 | 1827, 3141 | 645, 3142 | 0, 3143 | 849, 3144 | 0, 3145 | "IMAGE" 3146 | ], 3147 | [ 3148 | 1828, 3149 | 326, 3150 | 0, 3151 | 714, 3152 | 0, 3153 | "IMAGE" 3154 | ], 3155 | [ 3156 | 1829, 3157 | 672, 3158 | 0, 3159 | 850, 3160 | 1, 3161 | "IMAGE" 3162 | ], 3163 | [ 3164 | 1830, 3165 | 326, 3166 | 0, 3167 | 850, 3168 | 0, 3169 | "IMAGE" 3170 | ], 3171 | [ 3172 | 1832, 3173 | 850, 3174 | 0, 3175 | 851, 3176 | 0, 3177 | "IMAGE" 3178 | ], 3179 | [ 3180 | 1833, 3181 | 645, 3182 | 0, 3183 | 854, 3184 | 1, 3185 | "IMAGE" 3186 | ], 3187 | [ 3188 | 1834, 3189 | 847, 3190 | 0, 3191 | 854, 3192 | 0, 3193 | "IMAGE" 3194 | ], 3195 | [ 3196 | 1835, 3197 | 854, 3198 | 0, 3199 | 855, 3200 | 0, 3201 | "IMAGE" 3202 | ], 3203 | [ 3204 | 1836, 3205 | 854, 3206 | 0, 3207 | 850, 3208 | 2, 3209 | "IMAGE" 3210 | ], 3211 | [ 3212 | 1837, 3213 | 645, 3214 | 0, 3215 | 714, 3216 | 2, 3217 | "IMAGE" 3218 | ], 3219 | [ 3220 | 1838, 3221 | 326, 3222 | 1, 3223 | 856, 3224 | 1, 3225 | "MASK" 3226 | ], 3227 | [ 3228 | 1839, 3229 | 856, 3230 | 1, 3231 | 645, 3232 | 0, 3233 | "MASK" 3234 | ], 3235 | [ 3236 | 1840, 3237 | 856, 3238 | 1, 3239 | 846, 3240 | 0, 3241 | "MASK" 3242 | ], 3243 | [ 3244 | 1841, 3245 | 326, 3246 | 0, 3247 | 856, 3248 | 0, 3249 | "IMAGE" 3250 | ], 3251 | [ 3252 | 1842, 3253 | 649, 3254 | 0, 3255 | 819, 3256 | 0, 3257 | "IMAGE" 3258 | ], 3259 | [ 3260 | 1843, 3261 | 82, 3262 | 1, 3263 | 208, 3264 | 0, 3265 | "CLIP" 3266 | ] 3267 | ], 3268 | "groups": [], 3269 | "config": {}, 3270 | "extra": { 3271 | "ds": { 3272 | "scale": 0.740024994425824, 3273 | "offset": { 3274 | "0": 4963.130499817508, 3275 | "1": 578.762064489684 3276 | } 3277 | } 3278 | }, 3279 | "version": 0.4 3280 | } -------------------------------------------------------------------------------- /example/add_text2.json: -------------------------------------------------------------------------------- 1 | { 2 | "last_node_id": 9, 3 | "last_link_id": 10, 4 | "nodes": [ 5 | { 6 | "id": 7, 7 | "type": "MaskToImage", 8 | "pos": [ 9 | 1334, 10 | 646 11 | ], 12 | "size": { 13 | "0": 210, 14 | "1": 26 15 | }, 16 | "flags": {}, 17 | "order": 3, 18 | "mode": 0, 19 | "inputs": [ 20 | { 21 | "name": "mask", 22 | "type": "MASK", 23 | "link": 10 24 | } 25 | ], 26 | "outputs": [ 27 | { 28 | "name": "IMAGE", 29 | "type": "IMAGE", 30 | "links": [ 31 | 5 32 | ], 33 | "shape": 3, 34 | "slot_index": 0 35 | } 36 | ], 37 | "properties": { 38 | "Node name for S&R": "MaskToImage" 39 | } 40 | }, 41 | { 42 | "id": 8, 43 | "type": "PreviewBridge", 44 | "pos": [ 45 | 1681, 46 | 713 47 | ], 48 | "size": { 49 | "0": 315, 50 | "1": 290 51 | }, 52 | "flags": {}, 53 | "order": 4, 54 | "mode": 0, 55 | "inputs": [ 56 | { 57 | "name": "images", 58 | "type": "IMAGE", 59 | "link": 5 60 | } 61 | ], 62 | "outputs": [ 63 | { 64 | "name": "IMAGE", 65 | "type": "IMAGE", 66 | "links": null, 67 | "shape": 3 68 | }, 69 | { 70 | "name": "MASK", 71 | "type": "MASK", 72 | "links": null, 73 | "shape": 3 74 | } 75 | ], 76 | "properties": { 77 | "Node name for S&R": "PreviewBridge" 78 | }, 79 | "widgets_values": [ 80 | "$8-0" 81 | ] 82 | }, 83 | { 84 | "id": 6, 85 | "type": "PreviewBridge", 86 | "pos": [ 87 | 1686, 88 | 352 89 | ], 90 | "size": { 91 | "0": 315, 92 | "1": 290 93 | }, 94 | "flags": {}, 95 | "order": 2, 96 | "mode": 0, 97 | "inputs": [ 98 | { 99 | "name": "images", 100 | "type": "IMAGE", 101 | "link": 9 102 | } 103 | ], 104 | "outputs": [ 105 | { 106 | "name": "IMAGE", 107 | "type": "IMAGE", 108 | "links": null, 109 | "shape": 3 110 | }, 111 | { 112 | "name": "MASK", 113 | "type": "MASK", 114 | "links": null, 115 | "shape": 3 116 | } 117 | ], 118 | "properties": { 119 | "Node name for S&R": "PreviewBridge" 120 | }, 121 | "widgets_values": [ 122 | "$6-0" 123 | ] 124 | }, 125 | { 126 | "id": 5, 127 | "type": "LoadImage", 128 | "pos": [ 129 | 798, 130 | 394 131 | ], 132 | "size": { 133 | "0": 315, 134 | "1": 314 135 | }, 136 | "flags": {}, 137 | "order": 0, 138 | "mode": 0, 139 | "outputs": [ 140 | { 141 | "name": "IMAGE", 142 | "type": "IMAGE", 143 | "links": [ 144 | 7 145 | ], 146 | "shape": 3, 147 | "slot_index": 0 148 | }, 149 | { 150 | "name": "MASK", 151 | "type": "MASK", 152 | "links": [ 153 | 8 154 | ], 155 | "shape": 3, 156 | "slot_index": 1 157 | } 158 | ], 159 | "properties": { 160 | "Node name for S&R": "LoadImage" 161 | }, 162 | "widgets_values": [ 163 | "clipspace/clipspace-mask-16429.899999976158.png [input]", 164 | "image" 165 | ] 166 | }, 167 | { 168 | "id": 9, 169 | "type": "Add_text_by_mask", 170 | "pos": [ 171 | 1294, 172 | 408 173 | ], 174 | "size": { 175 | "0": 315, 176 | "1": 150 177 | }, 178 | "flags": {}, 179 | "order": 1, 180 | "mode": 0, 181 | "inputs": [ 182 | { 183 | "name": "image", 184 | "type": "IMAGE", 185 | "link": 7 186 | }, 187 | { 188 | "name": "mask", 189 | "type": "MASK", 190 | "link": 8 191 | } 192 | ], 193 | "outputs": [ 194 | { 195 | "name": "image", 196 | "type": "IMAGE", 197 | "links": [ 198 | 9 199 | ], 200 | "shape": 3, 201 | "slot_index": 0 202 | }, 203 | { 204 | "name": "mask", 205 | "type": "MASK", 206 | "links": [ 207 | 10 208 | ], 209 | "shape": 3, 210 | "slot_index": 1 211 | } 212 | ], 213 | "properties": { 214 | "Node name for S&R": "Add_text_by_mask" 215 | }, 216 | "widgets_values": [ 217 | "庞门正道粗书体6.0.ttf", 218 | "#e32530", 219 | 0.5, 220 | "不过是些许风霜罢了" 221 | ] 222 | } 223 | ], 224 | "links": [ 225 | [ 226 | 5, 227 | 7, 228 | 0, 229 | 8, 230 | 0, 231 | "IMAGE" 232 | ], 233 | [ 234 | 7, 235 | 5, 236 | 0, 237 | 9, 238 | 0, 239 | "IMAGE" 240 | ], 241 | [ 242 | 8, 243 | 5, 244 | 1, 245 | 9, 246 | 1, 247 | "MASK" 248 | ], 249 | [ 250 | 9, 251 | 9, 252 | 0, 253 | 6, 254 | 0, 255 | "IMAGE" 256 | ], 257 | [ 258 | 10, 259 | 9, 260 | 1, 261 | 7, 262 | 0, 263 | "MASK" 264 | ] 265 | ], 266 | "groups": [], 267 | "config": {}, 268 | "extra": { 269 | "ds": { 270 | "scale": 1, 271 | "offset": [ 272 | -710.3773835270106, 273 | -172.4307712766131 274 | ] 275 | } 276 | }, 277 | "version": 0.4 278 | } -------------------------------------------------------------------------------- /example/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LZpenguin/ComfyUI-Text/dabdfbaff4fdf49c825e3ba3a47bb85a8a670160/example/image.png -------------------------------------------------------------------------------- /example/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LZpenguin/ComfyUI-Text/dabdfbaff4fdf49c825e3ba3a47bb85a8a670160/example/image2.png -------------------------------------------------------------------------------- /font/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LZpenguin/ComfyUI-Text/dabdfbaff4fdf49c825e3ba3a47bb85a8a670160/font/arial.ttf -------------------------------------------------------------------------------- /font/庞门正道粗书体6.0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LZpenguin/ComfyUI-Text/dabdfbaff4fdf49c825e3ba3a47bb85a8a670160/font/庞门正道粗书体6.0.ttf -------------------------------------------------------------------------------- /nodes.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | import math 4 | import torch 5 | from PIL import Image, ImageDraw, ImageFont 6 | import os 7 | from folder_paths import folder_names_and_paths, models_dir 8 | import folder_paths 9 | folder_names_and_paths["font"] = ([os.path.join(models_dir, "font")], [".ttf"]) 10 | 11 | class AddTextByMask: 12 | @classmethod 13 | def INPUT_TYPES(s): 14 | return { 15 | "required": { 16 | "image": ("IMAGE", ), 17 | "mask": ("MASK", ), 18 | "font_file": (folder_paths.get_filename_list("font"), ), 19 | "hex_color": ("STRING", {"multiline": False, "default": "#000"}), 20 | "opacity": ("FLOAT", {"default": 1, "min": 0.0, "max": 1.0, "step": 0.01}), 21 | "text": ("STRING", {"multiline": False, "default": "Hello"}, ), 22 | }, 23 | } 24 | 25 | CATEGORY = "Text" 26 | RETURN_TYPES = ("IMAGE", "MASK",) 27 | RETURN_NAMES = ("image", "mask",) 28 | FUNCTION = "add_text_by_image" 29 | DESCRIPTION = "" 30 | 31 | def hex_to_rgb(self, hex_color): 32 | hex_color = hex_color[1:] if hex_color[0]=='#' else hex_color 33 | if len(hex_color) == 3: 34 | hex_color = hex_color[0]*2 + hex_color[1]*2 + hex_color[2]*2 35 | hex_color = hex_color.ljust(6, '0') 36 | return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) 37 | 38 | def add_text_by_image(self, image, mask, font_file, hex_color, opacity, text): 39 | 40 | if len(mask.shape)>2: 41 | mask = mask[0] 42 | mask = (mask.numpy()*255).astype('uint8') 43 | 44 | contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) 45 | if contours: 46 | largest_contour = max(contours, key=cv2.contourArea) 47 | x, y, w, h = cv2.boundingRect(largest_contour) 48 | 49 | tmp = np.zeros_like(mask) 50 | 51 | rows = min(max(round(h/w*2.5),1),3) 52 | row_num = math.ceil(len(text)/rows) 53 | font_size = math.floor(w/row_num) 54 | dx = round(w-font_size*row_num,1) 55 | dy = round((h-font_size*rows)/2/rows,1) 56 | 57 | font = ImageFont.truetype(folder_paths.get_full_path("font", font_file), font_size) 58 | 59 | image = (image.numpy()*255).astype('uint8')[0] 60 | image = Image.fromarray(image).convert("RGBA") 61 | text_overlay = Image.new('RGBA', image.size, (255, 255, 255, 0)) 62 | draw = ImageDraw.Draw(text_overlay) 63 | 64 | image2 = Image.fromarray(tmp) 65 | draw2 = ImageDraw.Draw(image2) 66 | 67 | rgb = self.hex_to_rgb(hex_color) 68 | for row in range(rows): 69 | draw.text((x+dx,y+(font_size+dy*2)*row+dy-font_size/5), text[row_num*row:row_num*(row+1)], font=font, fill=(*rgb, int(opacity*255))) 70 | draw2.text((x+dx,y+(font_size+dy*2)*row+dy-font_size/5), text[row_num*row:row_num*(row+1)], font=font, fill='white') 71 | 72 | image = Image.alpha_composite(image, text_overlay) 73 | 74 | return torch.from_numpy((np.array([image]).astype('float32')/255)), torch.from_numpy((np.array(image2).astype('float32')/255)), 75 | 76 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "comfyui-text" 3 | description = "" 4 | version = "1.0.0" 5 | license = "LICENSE" 6 | 7 | [project.urls] 8 | Repository = "https://github.com/LZpenguin/ComfyUI-Text" 9 | # Used by Comfy Registry https://comfyregistry.org 10 | 11 | [tool.comfy] 12 | PublisherId = "lzpenguin" 13 | DisplayName = "ComfyUI-Text" 14 | Icon = "" 15 | --------------------------------------------------------------------------------