首页 > 其他分享 >ComfyUI抠图--输入关键词

ComfyUI抠图--输入关键词

时间:2024-05-30 16:46:01浏览次数:32  
标签:name -- ComfyUI IMAGE 关键词 MASK label type id

上篇写了自动扣图 https://www.cnblogs.com/qcy-blog/p/18207984 这个适合把所有的东西扣出来

如果是只扣个头发之类的就不行了,推荐使用ComfyUI Segment Anything

地址 https://github.com/storyicon/comfyui_segment_anything

下载模型GroundingDino到models/grounding-dino

下载模型SAM到models/sams

工作流

{
  "last_node_id": 10,
  "last_link_id": 10,
  "nodes": [
    {
      "id": 4,
      "type": "LoadImage",
      "pos": [
        -168,
        -259
      ],
      "size": {
        "0": 315,
        "1": 314
      },
      "flags": {},
      "order": 0,
      "mode": 0,
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            3
          ],
          "shape": 3,
          "label": "图像"
        },
        {
          "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/029137374291becd5fa3c352b77a9e4f22b47d81.png@1536w_1536h_0e",
        "image"
      ],
      "serialize_values": [
        null,
        null
      ]
    },
    {
      "id": 5,
      "type": "InvertMask",
      "pos": [
        625,
        -342
      ],
      "size": {
        "0": 210,
        "1": 26
      },
      "flags": {},
      "order": 4,
      "mode": 0,
      "inputs": [
        {
          "name": "mask",
          "type": "MASK",
          "link": 4,
          "label": "遮罩"
        }
      ],
      "outputs": [
        {
          "name": "MASK",
          "type": "MASK",
          "links": [
            5
          ],
          "shape": 3,
          "slot_index": 0,
          "label": "遮罩"
        }
      ],
      "properties": {
        "Node name for S&R": "InvertMask"
      }
    },
    {
      "id": 7,
      "type": "PreviewImage",
      "pos": [
        1207,
        -440
      ],
      "size": {
        "0": 210,
        "1": 246
      },
      "flags": {},
      "order": 8,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 7,
          "label": "图像"
        }
      ],
      "properties": {
        "Node name for S&R": "PreviewImage"
      }
    },
    {
      "id": 1,
      "type": "SAMModelLoader (segment anything)",
      "pos": [
        -171,
        -512
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 1,
      "mode": 0,
      "outputs": [
        {
          "name": "SAM_MODEL",
          "type": "SAM_MODEL",
          "links": [
            1
          ],
          "shape": 3,
          "slot_index": 0,
          "label": "SAM模型"
        }
      ],
      "properties": {
        "Node name for S&R": "SAMModelLoader (segment anything)"
      },
      "widgets_values": [
        "sam_vit_h (2.56GB)"
      ],
      "serialize_values": [
        null
      ]
    },
    {
      "id": 6,
      "type": "JoinImageWithAlpha",
      "pos": [
        912,
        -429
      ],
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 6,
      "mode": 0,
      "inputs": [
        {
          "name": "image",
          "type": "IMAGE",
          "link": 6,
          "label": "图像"
        },
        {
          "name": "alpha",
          "type": "MASK",
          "link": 5,
          "label": "透明遮罩"
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            7,
            8
          ],
          "shape": 3,
          "slot_index": 0,
          "label": "图像"
        }
      ],
      "properties": {
        "Node name for S&R": "JoinImageWithAlpha"
      }
    },
    {
      "id": 8,
      "type": "SaveImage",
      "pos": [
        1168.6743016763673,
        -144.17045632614804
      ],
      "size": [
        315,
        270
      ],
      "flags": {},
      "order": 9,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 8,
          "label": "图像"
        }
      ],
      "properties": {
        "Node name for S&R": "SaveImage"
      },
      "widgets_values": [
        "ComfyUI"
      ],
      "serialize_values": [
        "ComfyUI"
      ]
    },
    {
      "id": 3,
      "type": "GroundingDinoModelLoader (segment anything)",
      "pos": [
        -274,
        -394
      ],
      "size": {
        "0": 422.666259765625,
        "1": 69.10985565185547
      },
      "flags": {},
      "order": 2,
      "mode": 0,
      "outputs": [
        {
          "name": "GROUNDING_DINO_MODEL",
          "type": "GROUNDING_DINO_MODEL",
          "links": [
            2
          ],
          "shape": 3,
          "label": "G-Dino模型"
        }
      ],
      "properties": {
        "Node name for S&R": "GroundingDinoModelLoader (segment anything)"
      },
      "widgets_values": [
        "GroundingDINO_SwinB (938MB)"
      ],
      "serialize_values": [
        null
      ]
    },
    {
      "id": 2,
      "type": "GroundingDinoSAMSegment (segment anything)",
      "pos": [
        212,
        -429
      ],
      "size": {
        "0": 352.79998779296875,
        "1": 122
      },
      "flags": {},
      "order": 3,
      "mode": 0,
      "inputs": [
        {
          "name": "sam_model",
          "type": "SAM_MODEL",
          "link": 1,
          "label": "SAM模型"
        },
        {
          "name": "grounding_dino_model",
          "type": "GROUNDING_DINO_MODEL",
          "link": 2,
          "slot_index": 1,
          "label": "G-Dino模型"
        },
        {
          "name": "image",
          "type": "IMAGE",
          "link": 3,
          "slot_index": 2,
          "label": "图像"
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            6
          ],
          "shape": 3,
          "slot_index": 0,
          "label": " 图像"
        },
        {
          "name": "MASK",
          "type": "MASK",
          "links": [
            4,
            9
          ],
          "shape": 3,
          "slot_index": 1,
          "label": "遮罩"
        }
      ],
      "properties": {
        "Node name for S&R": "GroundingDinoSAMSegment (segment anything)"
      },
      "widgets_values": [
        "girl,chair",
        0.3
      ],
      "serialize_values": [
        null,
        null
      ]
    },
    {
      "id": 9,
      "type": "MaskToImage",
      "pos": [
        630.6957407472134,
        -160.98402692865238
      ],
      "size": {
        "0": 210,
        "1": 26
      },
      "flags": {},
      "order": 5,
      "mode": 0,
      "inputs": [
        {
          "name": "mask",
          "type": "MASK",
          "link": 9,
          "label": "遮罩"
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            10
          ],
          "shape": 3,
          "label": "图像",
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "MaskToImage"
      }
    },
    {
      "id": 10,
      "type": "PreviewImage",
      "pos": [
        891.6081350831817,
        -50.598013940358214
      ],
      "size": [
        210,
        246
      ],
      "flags": {},
      "order": 7,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 10,
          "label": "图像"
        }
      ],
      "properties": {
        "Node name for S&R": "PreviewImage"
      }
    }
  ],
  "links": [
    [
      1,
      1,
      0,
      2,
      0,
      "SAM_MODEL"
    ],
    [
      2,
      3,
      0,
      2,
      1,
      "GROUNDING_DINO_MODEL"
    ],
    [
      3,
      4,
      0,
      2,
      2,
      "IMAGE"
    ],
    [
      4,
      2,
      1,
      5,
      0,
      "MASK"
    ],
    [
      5,
      5,
      0,
      6,
      1,
      "MASK"
    ],
    [
      6,
      2,
      0,
      6,
      0,
      "IMAGE"
    ],
    [
      7,
      6,
      0,
      7,
      0,
      "IMAGE"
    ],
    [
      8,
      6,
      0,
      8,
      0,
      "IMAGE"
    ],
    [
      9,
      2,
      1,
      9,
      0,
      "MASK"
    ],
    [
      10,
      9,
      0,
      10,
      0,
      "IMAGE"
    ]
  ],
  "groups": [],
  "config": {},
  "extra": {
    "ds": {
      "scale": 0.7972024500000005,
      "offset": {
        "0": 476.9276123046875,
        "1": 548.5894165039062
      }
    }
  },
  "version": 0.4
}

效果---扣头发

标签:name,--,ComfyUI,IMAGE,关键词,MASK,label,type,id
From: https://www.cnblogs.com/qcy-blog/p/18222657

相关文章

  • malloc()函数
    malloc()函数malloc是动态内存分配函数,用于申请一块连续的指定大小的内存块区域,以void*类型返回分配的内存区域地址。函数原型void*malloc(unsignedintnum_bytes);分配长度为num_bytes字节的内存块。使用时要包含头文件stdlib.h,也可以使用#include<malloc.h>,但并不建议,......
  • 【RS】哨兵系列新网站无法下载的问题及解决办法(Sentinel-2)
    ​    最近有些小伙伴留言说哨兵数据无法下载,网站打开后会有一层蒙版,无法选取研究区等信息,今天就跟大家分享一下如何解决这个问题。还知道如何下载的小伙伴可以移步到之前的文章:【RS】欧空局Sentinel-2卫星数据下载(哨兵1、2、3、5P、6系列)-CSDN博客1问题原因  ......
  • Altman 承诺将捐出大部分财富;苹果计划采用「机密计算」技术处理数据丨 RTE 开发者日报
      开发者朋友们大家好: 这里是「RTE开发者日报」,每天和大家一起看新闻、聊八卦。我们的社区编辑团队会整理分享RTE(Real-TimeEngagement)领域内「有话题的新闻」、「有态度的观点」、「有意思的数据」、「有思考的文章」、「有看点的会议」,但内容仅代表编辑的个人观点,......
  • 黄毛漂流记 修改金币 存档分享
    本人已游玩,并通关游戏《黄毛漂流记》,因为游戏比较新,相关内容并不完整,遂出帖说明,希望给大家一点参考steam链接:Steam上的黄毛漂流记(steampowered.com)一、修改方法。NPC好感度是可修改的,但不建议修改,有的地方会出bug导致坏档,所以根据本人的游玩体验来看,仅修改金币数量,然后去......
  • 一道题学uaf漏洞
    uaf写的还是有些简略,可参考好好说话之UseAfterFree-CSDN博客。十分的详细题目来自iscc2024-iscc——u查看保护代码分析菜单栏intmenu(){puts("----------------------");puts(aWelcomeToIscc);puts("----------------------");puts("1.Addnote......
  • flutter - [01] Dart概述
    题记部分 一、什么是dartdart是由谷歌开发的计算机编程语言,可以被用于web、服务器、移动应用和物联网等领域的开发dart诞生于2011年,号称要取代JavaScript。但是过去的几年中一直不温不火,直到Flutter出现后,被人们重新重视。要学习Flutter,必须首先得学习Dart。dart官网:htt......
  • Understanding and Mitigating the Label Noise in Pre-training on Downstream Tasks
    目录概符号说明经验性的结果NoisyModelLearning代码ChenH.,WangJ.,ShahA.,TaoR.,WeiH.,XieX.,SugiyamaM.andRajB.Understandingandmitigatingthelabelnoiseinpre-trainingondownstreamtasks.概本文讨论如果预训练模型在训练的时候存在噪声,会......
  • 利用腾讯云和drf框架去编写一个用户注册的验证码验证
    一、编写利用腾讯云文件在项目—>utils下创建一个文件tencentsms.py:classTengXun(object):defsend_sms(self,code,mobile):#短信应用SDKAppIDappid=APP_ID#SDKAppID是1400开头,你们申请的appid#短信应用SDKAppKey也是你们自己......
  • flutter - [02] 基本语法
    题记部分 一、注释///这是一个注释//这也是个注释/*这还是个注释*/voidmain(List<String>args){print('你好dart');} 二、声明变量varstr='thisisvar';Stringstr='thisisvar';  三、标题   —业精于勤荒于嬉,行成于思毁于随—......
  • asp.net web api 接口控制并发研究(临时性方法)
    有一个业务场景,接口的业务逻辑非常复杂,对数据库的压力比较大,希望限制下接口的并发数量,研究了下:usingMicrosoft.AspNetCore.Mvc;usingSystem.Collections.Concurrent;usingSystem.Threading.Tasks;namespaceTestBingFa.Controllers{[ApiController][Route("[c......