首页 > 其他分享 >ComfyUI给人物换背景--两张图合成

ComfyUI给人物换背景--两张图合成

时间:2024-05-23 15:40:42浏览次数:30  
标签:name -- ComfyUI 两张 label link values null type

上一篇写了人物抠图 https://www.cnblogs.com/qcy-blog/p/18207984

抠图模型上一篇已经安装了

工作流,导入并安装缺失节点,基础大模型选择一个自己喜欢的就好了

{
  "last_node_id": 41,
  "last_link_id": 65,
  "nodes": [
    {
      "id": 39,
      "type": "Image Rembg (Remove Background)",
      "pos": [
        796,
        1542
      ],
      "size": {
        "0": 315,
        "1": 250
      },
      "flags": {},
      "order": 9,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 61,
          "label": "图像"
        }
      ],
      "outputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "links": [
            62,
            65
          ],
          "shape": 3,
          "label": "images",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "Image Rembg (Remove Background)"
      },
      "widgets_values": [
        true,
        "u2net",
        false,
        true,
        false,
        240,
        10,
        10,
        "none"
      ],
      "serialize_values": [
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null
      ]
    },
    {
      "id": 40,
      "type": "ImageToMask",
      "pos": [
        1260,
        1367
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 13,
      "mode": 0,
      "inputs": [
        {
          "name": "image",
          "type": "IMAGE",
          "link": 62,
          "label": "图像"
        }
      ],
      "outputs": [
        {
          "name": "MASK",
          "type": "MASK",
          "links": [
            63
          ],
          "shape": 3,
          "label": "遮罩",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "ImageToMask"
      },
      "widgets_values": [
        "red"
      ],
      "serialize_values": [
        null
      ]
    },
    {
      "id": 38,
      "type": "VAEEncode",
      "pos": [
        845,
        1235
      ],
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 8,
      "mode": 0,
      "inputs": [
        {
          "name": "pixels",
          "type": "IMAGE",
          "link": 57,
          "label": "图像"
        },
        {
          "name": "vae",
          "type": "VAE",
          "link": 64,
          "label": "VAE",
          "slot_index": 1
        }
      ],
      "outputs": [
        {
          "name": "LATENT",
          "type": "LATENT",
          "links": [
            58
          ],
          "shape": 3,
          "label": "Latent",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAEEncode"
      }
    },
    {
      "id": 26,
      "type": "VAEEncode",
      "pos": [
        1571,
        933
      ],
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 7,
      "mode": 0,
      "inputs": [
        {
          "name": "pixels",
          "type": "IMAGE",
          "link": 54,
          "label": "图像"
        },
        {
          "name": "vae",
          "type": "VAE",
          "link": 29,
          "label": "VAE",
          "slot_index": 1
        }
      ],
      "outputs": [
        {
          "name": "LATENT",
          "type": "LATENT",
          "links": [],
          "shape": 3,
          "label": "Latent",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAEEncode"
      }
    },
    {
      "id": 28,
      "type": "VAEEncode",
      "pos": [
        1202,
        1008
      ],
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 12,
      "mode": 0,
      "inputs": [
        {
          "name": "pixels",
          "type": "IMAGE",
          "link": 39,
          "label": "图像"
        },
        {
          "name": "vae",
          "type": "VAE",
          "link": 34,
          "label": "VAE",
          "slot_index": 1
        }
      ],
      "outputs": [
        {
          "name": "LATENT",
          "type": "LATENT",
          "links": [
            59
          ],
          "shape": 3,
          "label": "Latent",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAEEncode"
      }
    },
    {
      "id": 37,
      "type": "LatentCompositeMasked",
      "pos": [
        1711,
        1170
      ],
      "size": {
        "0": 315,
        "1": 146
      },
      "flags": {},
      "order": 15,
      "mode": 0,
      "inputs": [
        {
          "name": "destination",
          "type": "LATENT",
          "link": 59,
          "label": "目标Latent"
        },
        {
          "name": "source",
          "type": "LATENT",
          "link": 58,
          "label": "源Latent"
        },
        {
          "name": "mask",
          "type": "MASK",
          "link": 63,
          "label": "遮罩"
        }
      ],
      "outputs": [
        {
          "name": "LATENT",
          "type": "LATENT",
          "links": [
            60
          ],
          "shape": 3,
          "label": "Latent",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "LatentCompositeMasked"
      },
      "widgets_values": [
        0,
        0,
        false
      ],
      "serialize_values": [
        null,
        null,
        null
      ]
    },
    {
      "id": 5,
      "type": "CLIPSetLastLayer",
      "pos": [
        306,
        575
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 5,
      "mode": 0,
      "inputs": [
        {
          "name": "clip",
          "type": "CLIP",
          "link": 5,
          "label": "CLIP"
        }
      ],
      "outputs": [
        {
          "name": "CLIP",
          "type": "CLIP",
          "links": [
            6,
            7
          ],
          "shape": 3,
          "label": "CLIP",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPSetLastLayer"
      },
      "widgets_values": [
        -2
      ],
      "serialize_values": [
        null
      ]
    },
    {
      "id": 3,
      "type": "CLIPTextEncode",
      "pos": [
        796,
        474
      ],
      "size": {
        "0": 400,
        "1": 200
      },
      "flags": {},
      "order": 10,
      "mode": 0,
      "inputs": [
        {
          "name": "clip",
          "type": "CLIP",
          "link": 6,
          "label": "CLIP"
        },
        {
          "name": "text",
          "type": "STRING",
          "link": 16,
          "widget": {
            "name": "text"
          },
          "label": "文本"
        }
      ],
      "outputs": [
        {
          "name": "CONDITIONING",
          "type": "CONDITIONING",
          "links": [
            25
          ],
          "shape": 3,
          "label": "条件",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        "1girl,"
      ],
      "color": "#232",
      "bgcolor": "#353",
      "serialize_values": [
        "1girl,"
      ]
    },
    {
      "id": 4,
      "type": "CLIPTextEncode",
      "pos": [
        789,
        723
      ],
      "size": {
        "0": 400,
        "1": 200
      },
      "flags": {},
      "order": 11,
      "mode": 0,
      "inputs": [
        {
          "name": "clip",
          "type": "CLIP",
          "link": 7,
          "label": "CLIP"
        },
        {
          "name": "text",
          "type": "STRING",
          "link": 17,
          "widget": {
            "name": "text"
          },
          "label": "文本"
        }
      ],
      "outputs": [
        {
          "name": "CONDITIONING",
          "type": "CONDITIONING",
          "links": [
            4
          ],
          "shape": 3,
          "label": "条件"
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        ""
      ],
      "color": "#322",
      "bgcolor": "#533",
      "serialize_values": [
        ""
      ]
    },
    {
      "id": 12,
      "type": "VAEDecode",
      "pos": [
        2184,
        627
      ],
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 17,
      "mode": 0,
      "inputs": [
        {
          "name": "samples",
          "type": "LATENT",
          "link": 13,
          "label": "Latent"
        },
        {
          "name": "vae",
          "type": "VAE",
          "link": 14,
          "label": "VAE"
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            15
          ],
          "shape": 3,
          "label": "图像",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAEDecode"
      }
    },
    {
      "id": 13,
      "type": "PreviewImage",
      "pos": [
        2504,
        624
      ],
      "size": {
        "0": 383.6465148925781,
        "1": 414.4710388183594
      },
      "flags": {},
      "order": 18,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 15,
          "label": "图像"
        }
      ],
      "properties": {
        "Node name for S&R": "PreviewImage"
      }
    },
    {
      "id": 1,
      "type": "KSampler",
      "pos": [
        1727,
        575
      ],
      "size": {
        "0": 315,
        "1": 262
      },
      "flags": {},
      "order": 16,
      "mode": 0,
      "inputs": [
        {
          "name": "model",
          "type": "MODEL",
          "link": 2,
          "label": "模型",
          "slot_index": 0
        },
        {
          "name": "positive",
          "type": "CONDITIONING",
          "link": 25,
          "label": "正面条件",
          "slot_index": 1
        },
        {
          "name": "negative",
          "type": "CONDITIONING",
          "link": 4,
          "label": "负面条件",
          "slot_index": 2
        },
        {
          "name": "latent_image",
          "type": "LATENT",
          "link": 60,
          "label": "Latent",
          "slot_index": 3
        }
      ],
      "outputs": [
        {
          "name": "LATENT",
          "type": "LATENT",
          "links": [
            13
          ],
          "shape": 3,
          "label": "Latent",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "KSampler"
      },
      "widgets_values": [
        1025954431145377,
        "randomize",
        25,
        3,
        "dpmpp_2m_sde_gpu",
        "karras",
        0.1
      ],
      "serialize_values": [
        null,
        null,
        null,
        null,
        null,
        null,
        null
      ]
    },
    {
      "id": 41,
      "type": "PreviewImage",
      "pos": [
        2310,
        1457
      ],
      "size": {
        "0": 279.9791259765625,
        "1": 246
      },
      "flags": {},
      "order": 14,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 65,
          "label": "图像"
        }
      ],
      "properties": {
        "Node name for S&R": "PreviewImage"
      }
    },
    {
      "id": 2,
      "type": "CheckpointLoaderSimple",
      "pos": [
        -126,
        564
      ],
      "size": {
        "0": 315,
        "1": 98
      },
      "flags": {},
      "order": 0,
      "mode": 0,
      "outputs": [
        {
          "name": "MODEL",
          "type": "MODEL",
          "links": [
            2
          ],
          "shape": 3,
          "label": "模型"
        },
        {
          "name": "CLIP",
          "type": "CLIP",
          "links": [
            5
          ],
          "shape": 3,
          "label": "CLIP",
          "slot_index": 1
        },
        {
          "name": "VAE",
          "type": "VAE",
          "links": null,
          "shape": 3,
          "label": "VAE",
          "slot_index": 2
        }
      ],
      "properties": {
        "Node name for S&R": "CheckpointLoaderSimple"
      },
      "widgets_values": [
        "majicMIX realistic(v7)"
      ],
      "serialize_values": [
        "[email protected]"
      ]
    },
    {
      "id": 14,
      "type": "SDXLPromptStyler",
      "pos": [
        224,
        706
      ],
      "size": {
        "0": 400,
        "1": 242
      },
      "flags": {},
      "order": 1,
      "mode": 0,
      "outputs": [
        {
          "name": "text_positive",
          "type": "STRING",
          "links": [
            16
          ],
          "shape": 3,
          "label": "正面条件",
          "slot_index": 0
        },
        {
          "name": "text_negative",
          "type": "STRING",
          "links": [
            17
          ],
          "shape": 3,
          "label": "负面条件",
          "slot_index": 1
        }
      ],
      "properties": {
        "Node name for S&R": "SDXLPromptStyler"
      },
      "widgets_values": [
        "1 girl",
        "",
        "base",
        true,
        true,
        true
      ],
      "serialize_values": [
        null,
        null,
        null,
        null,
        null,
        null
      ]
    },
    {
      "id": 10,
      "type": "VAELoader",
      "pos": [
        2071,
        949
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 2,
      "mode": 0,
      "outputs": [
        {
          "name": "VAE",
          "type": "VAE",
          "links": [
            14,
            29,
            34,
            64
          ],
          "shape": 3,
          "label": "VAE",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAELoader"
      },
      "widgets_values": [
        "vae-ft-mse-840000-ema-pruned.ckpt"
      ],
      "serialize_values": [
        null
      ]
    },
    {
      "id": 30,
      "type": "ImageScale",
      "pos": [
        825,
        1051
      ],
      "size": {
        "0": 315,
        "1": 130
      },
      "flags": {},
      "order": 6,
      "mode": 0,
      "inputs": [
        {
          "name": "image",
          "type": "IMAGE",
          "link": 38,
          "label": "图像"
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            39
          ],
          "shape": 3,
          "label": "图像",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "ImageScale"
      },
      "widgets_values": [
        "nearest-exact",
        1024,
        1024,
        "disabled"
      ],
      "serialize_values": [
        null,
        null,
        null,
        null
      ]
    },
    {
      "id": 27,
      "type": "LoadImage",
      "pos": [
        -165,
        1066
      ],
      "size": {
        "0": 315,
        "1": 314
      },
      "flags": {},
      "order": 3,
      "mode": 0,
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            38
          ],
          "shape": 3,
          "label": "图像",
          "slot_index": 0
        },
        {
          "name": "MASK",
          "type": "MASK",
          "links": null,
          "shape": 3,
          "label": "遮罩"
        }
      ],
      "properties": {
        "Node name for S&R": "LoadImage"
      },
      "widgets_values": [
        "https://bfs.esheep.com/bfs/aikobo-bfs/app/comfy/6c547074e19b644b7c0bb078dff1c80d72ac3d44.png@1536w_1536h_0e",
        "image"
      ],
      "serialize_values": [
        null,
        null
      ]
    },
    {
      "id": 24,
      "type": "LoadImage",
      "pos": [
        365,
        1109
      ],
      "size": {
        "0": 315,
        "1": 314.00006103515625
      },
      "flags": {},
      "order": 4,
      "mode": 0,
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            54,
            57,
            61
          ],
          "shape": 3,
          "label": "图像",
          "slot_index": 0
        },
        {
          "name": "MASK",
          "type": "MASK",
          "links": null,
          "shape": 3,
          "label": "遮罩"
        }
      ],
      "properties": {
        "Node name for S&R": "LoadImage"
      },
      "widgets_values": [
        "https://bfs.esheep.com/bfs/aikobo-bfs/app/comfy/67ef4940037a6dd7d3eb442105f8afbc5cc9dee1.webp",
        "image"
      ],
      "serialize_values": [
        null,
        null
      ]
    }
  ],
  "links": [
    [
      2,
      2,
      0,
      1,
      0,
      "MODEL"
    ],
    [
      4,
      4,
      0,
      1,
      2,
      "CONDITIONING"
    ],
    [
      5,
      2,
      1,
      5,
      0,
      "CLIP"
    ],
    [
      6,
      5,
      0,
      3,
      0,
      "CLIP"
    ],
    [
      7,
      5,
      0,
      4,
      0,
      "CLIP"
    ],
    [
      13,
      1,
      0,
      12,
      0,
      "LATENT"
    ],
    [
      14,
      10,
      0,
      12,
      1,
      "VAE"
    ],
    [
      15,
      12,
      0,
      13,
      0,
      "IMAGE"
    ],
    [
      16,
      14,
      0,
      3,
      1,
      "STRING"
    ],
    [
      17,
      14,
      1,
      4,
      1,
      "STRING"
    ],
    [
      25,
      3,
      0,
      1,
      1,
      "CONDITIONING"
    ],
    [
      29,
      10,
      0,
      26,
      1,
      "VAE"
    ],
    [
      34,
      10,
      0,
      28,
      1,
      "VAE"
    ],
    [
      38,
      27,
      0,
      30,
      0,
      "IMAGE"
    ],
    [
      39,
      30,
      0,
      28,
      0,
      "IMAGE"
    ],
    [
      54,
      24,
      0,
      26,
      0,
      "IMAGE"
    ],
    [
      57,
      24,
      0,
      38,
      0,
      "IMAGE"
    ],
    [
      58,
      38,
      0,
      37,
      1,
      "LATENT"
    ],
    [
      59,
      28,
      0,
      37,
      0,
      "LATENT"
    ],
    [
      60,
      37,
      0,
      1,
      3,
      "LATENT"
    ],
    [
      61,
      24,
      0,
      39,
      0,
      "IMAGE"
    ],
    [
      62,
      39,
      0,
      40,
      0,
      "IMAGE"
    ],
    [
      63,
      40,
      0,
      37,
      2,
      "MASK"
    ],
    [
      64,
      10,
      0,
      38,
      1,
      "VAE"
    ],
    [
      65,
      39,
      0,
      41,
      0,
      "IMAGE"
    ]
  ],
  "groups": [],
  "config": {},
  "extra": {
    "ds": {
      "scale": 0.9646149645000006,
      "offset": [
        -1212.7758448938648,
        -97.35939963069306
      ]
    }
  },
  "version": 0.4
}

效果

标签:name,--,ComfyUI,两张,label,link,values,null,type
From: https://www.cnblogs.com/qcy-blog/p/18208599

相关文章

  • BUUCTF-Misc(6-10)
    乌镇峰会种图010editor翻到后面就有了,就看到flag了flag{97314e7864a8f62627b26f3f998c37f1}N种方法解决记事本打开,发现说是base64,拖到网站解密Base64解码Base64编码UTF8GB2312UTF16GBK二进制十六进制解密-TheX在线工具(the-x.cn)然后存为png,然后是一张二维码......
  • Linux 开启定时任务执行脚本
    接到领导一个需求,要把压缩包放到当天日期的目录下,所以需要每天生成一个当前日期的文件夹1、创建sh文件,我这边命名为zip.sh#!/bin/bashtime=$(date"+%Y-%m-%d")##获取当前时间并且格式化时间##切换到这个目录下cd/root/app/bankcard/zip/mkdir"${time}"##创建以时......
  • 背包dp
    P1064[NOIP2006提高组]金明的预算方案思路:有依赖的背包。主要的问题和解决方案,见代码注释.#include<bits/stdc++.h>usingnamespacestd;#defineintlonglong#defineendl"\n"constintN=2e5+10;typedefstructnode{intp,w,typ;}node;boolcmp(nodea,n......
  • Win11 24H2已在路上!微软发布最新RP预览版:支持创建7-zip文件、Wi-Fi 7等
    微软正紧锣密鼓地准备Windows11的下一个重大更新,即24H2版本。在正式发布前夕,微软向ReleasePreview的WindowsInsider项目成员发布了Windows11Version24H2(Build26100.712)预览版更新,邀请用户参与测试并反馈问题。这一预览版带来了一系列新功能和改进,其中包括对Wi-Fi7的支持......
  • nohup命令
    后台运行命令:nohupnohup命令:nohup是不挂断的意思(nohangup)。如果你正在运行一个进程,而且你觉得在退出帐户时该进程还不会结束,那么可以使用nohup命令。该命令忽略所有挂(SIGHUP)信号,可以在你退出帐户/关闭终端之后继续运行相应的进程。该命令的一般格式为:nohupyourcommand&......
  • 详解MVCC以及尽可能解决幻读的两种方案
    MVCC通过「版本链」来控制并发事务访问同一个记录时的行为并行事务问题+隔离级别幻读:在一个事务内多次查询某个符合查询条件的「记录数量」,如果出现前后两次查询到的记录数量不一样的情况,就意味着发生了「幻读」现象。脏读:读到其他事务未提交的数据;不可重复读:前后读取......
  • 原始配置字符串进行解析并转换为字典
    varconfigPairs=mqttConfig.Split(';').Select(pair=>pair.Split('=')).Where(parts=>parts.Length==2).ToDictionary(parts=>parts[0].Trim(),parts=&g......
  • 苹果iOS 18将于6月10日登场:Apple Music支持智能歌曲过渡功能
    据AppleInsider报道,苹果将会在iOS18和macOS15上带来AppleMusic的改进,支持“智能歌曲过渡”。据悉,目前的切歌功能是“交叉渐入渐出歌曲”,带来一些平滑效果,用户可以在1-12秒之间调节。而未来iOS18和macOS15系统上将支持智能调节,利用算法来调整最佳的切歌时间。此外,苹果还在......
  • 3SRB2516-ASEMI整流桥3SRB2516参数、封装、尺寸
    编辑:ll3SRB2516-ASEMI整流桥3SRB2516参数、封装、尺寸型号:3SRB2516品牌:ASEMI封装:SGBJ-5最大重复峰值反向电压:1600V最大正向平均整流电流(Vdss):25A功率(Pd):大功率芯片个数:5引脚数量:5类型:整流扁桥、整流桥正向浪涌电流:400A正向电压:1.05V最大输出电压(RMS):封装尺寸:如图......
  • Mybatis框架 <insert> 标签内 useGeneratedKeys="true" 和 keyProperty="xxx" 属性
    useGeneratedKeys="true" 和 keyProperty="secondIndex" 这两个属性经常与MyBatis(Java持久层框架)的 <insert> 标签一起使用。这两个属性主要用于在插入记录后,从数据库返回的自动生成的主键或其他键值中,获取该键值并将其设置到Java对象的某个属性中。useGeneratedK......