[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-1038lab--ComfyUI-RMBG":3,"tool-1038lab--ComfyUI-RMBG":64},[4,17,26,40,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,2,"2026-04-03T11:11:01",[13,14,15],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":23,"last_commit_at":32,"category_tags":33,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,34,35,36,15,37,38,13,39],"数据工具","视频","插件","其他","语言模型","音频",{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":10,"last_commit_at":46,"category_tags":47,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,38,37],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":10,"last_commit_at":54,"category_tags":55,"status":16},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74913,"2026-04-05T10:44:17",[38,14,13,37],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":23,"last_commit_at":62,"category_tags":63,"status":16},2471,"tesseract","tesseract-ocr\u002Ftesseract","Tesseract 是一款历史悠久且备受推崇的开源光学字符识别（OCR）引擎，最初由惠普实验室开发，后由 Google 维护，目前由全球社区共同贡献。它的核心功能是将图片中的文字转化为可编辑、可搜索的文本数据，有效解决了从扫描件、照片或 PDF 文档中提取文字信息的难题，是数字化归档和信息自动化的重要基础工具。\n\n在技术层面，Tesseract 展现了强大的适应能力。从版本 4 开始，它引入了基于长短期记忆网络（LSTM）的神经网络 OCR 引擎，显著提升了行识别的准确率；同时，为了兼顾旧有需求，它依然支持传统的字符模式识别引擎。Tesseract 原生支持 UTF-8 编码，开箱即用即可识别超过 100 种语言，并兼容 PNG、JPEG、TIFF 等多种常见图像格式。输出方面，它灵活支持纯文本、hOCR、PDF、TSV 等多种格式，方便后续数据处理。\n\nTesseract 主要面向开发者、研究人员以及需要构建文档处理流程的企业用户。由于它本身是一个命令行工具和库（libtesseract），不包含图形用户界面（GUI），因此最适合具备一定编程能力的技术人员集成到自动化脚本或应用程序中",73286,"2026-04-03T01:56:45",[13,14],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":78,"owner_location":78,"owner_email":78,"owner_twitter":78,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":10,"env_os":93,"env_gpu":94,"env_ram":95,"env_deps":96,"category_tags":109,"github_topics":110,"view_count":118,"oss_zip_url":78,"oss_zip_packed_at":78,"status":16,"created_at":119,"updated_at":120,"faqs":121,"releases":151},1289,"1038lab\u002FComfyUI-RMBG","ComfyUI-RMBG","A ComfyUI custom node designed for advanced image background removal and object, face, clothes, and fashion segmentation, utilizing multiple models including RMBG-2.0, INSPYRENET, BEN, BEN2, BiRefNet, SDMatte, SAM, SAM2, SAM3 and GroundingDINO.","ComfyUI-RMBG 是一个专为图像背景移除和精细分割设计的 ComfyUI 自定义节点工具，能够高效处理对象、人脸、服装及时尚元素的分割任务。它集成了多种先进模型，如 RMBG-2.0、SAM、SAM2、SAM3、GroundingDINO 等，支持实时背景替换与边缘检测优化，显著提升了分割精度和使用便捷性。\n\n这款工具解决了传统图像分割中背景去除不彻底、边缘模糊、处理速度慢等问题，尤其适用于需要高质量图像处理的场景。无论是设计师在进行图像编辑，还是研究人员在开展视觉分析项目，都能从中受益。同时，开发者也可以借助其丰富的模型支持和灵活的工作流配置，快速构建复杂的图像处理流程。\n\nComfyUI-RMBG 的独特之处在于其多样化的模型集成和持续更新的特性，使其能适应不同需求，并通过不断迭代提升性能。适合对图像处理有较高要求的设计师、研究人员以及 AI 开发者使用。","# ComfyUI-RMBG\r\n\r\nA sophisticated ComfyUI custom node engineered for advanced image background removal and precise segmentation of objects, faces, clothing, and fashion elements. This tool leverages a diverse array of models, including RMBG-2.0, INSPYRENET, BEN, BEN2, BiRefNet, SDMatte models, SAM, SAM2 and GroundingDINO, while also incorporating a new feature for real-time background replacement and enhanced edge detection for improved accuracy.\r\n\r\n## News & Updates\r\n- **2026\u002F01\u002F01**: Update ComfyUI-RMBG to **v3.0.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v300-20260101) )\r\n![V3 0 0_nodes](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_c72eb4687d1a.jpg)\r\n- **2025\u002F12\u002F09**: Update ComfyUI-RMBG to **v2.9.6** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v296-20251209) )  \r\n![v2.9.6_Image Compare](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_349318d919d0.png)\r\n- **2025\u002F11\u002F25**: Update ComfyUI-RMBG to **v2.9.5** SAM3 Segmentaion bug fixed( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v295-20251125) )  \r\n- **2025\u002F11\u002F24**: Update ComfyUI-RMBG to **v2.9.4** SAM3 Segmentaion ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v294-20251124) )\r\n![v2.9.4_sam3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_c4773028f523.png)\r\n- **2025\u002F10\u002F05**: Update ComfyUI-RMBG to **v2.9.3** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v293-20251005) )\r\n![v2.9._color](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_4f69171f5984.png)  \r\n- **2025\u002F09\u002F30**: Update ComfyUI-RMBG to **v2.9.2** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v292-20250930) )\r\n- Add new BiRefNet_toonOut Model \r\n![v2.9.2_BiRefNet_toonOut](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_9a639941e5a7.png)\r\n- Updated Imagestitch\r\n![v2.9.2_imagestitch](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_ff2554e0f011.png)\r\n\r\n- **2025\u002F09\u002F12**: Update ComfyUI-RMBG to **v2.9.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v291-20250912) )\r\n![v2.9.1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1f44c2803be4.png)\r\n- **2025\u002F08\u002F18**: Update ComfyUI-RMBG to **v2.9.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v290-20250818) )\r\n![v2 9 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_75914164cd83.png)\r\n  - Added `SDMatte Matting` node\r\n\r\n- **2025\u002F08\u002F11**: Update ComfyUI-RMBG to **v2.8.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v280-20250811) )\r\n![v2 8 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_6988846eb86f.png)\r\n\r\n  - Added `SAM2Segment` node for text-prompted segmentation with the latest Facebook Research SAM2 technology.\r\n  - Enhanced color widget support across all nodes\r\n  \r\n- **2025\u002F08\u002F06**: Update ComfyUI-RMBG to **v2.7.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v271-20250806) )\r\n![v2.7.0_ImageStitch](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_6ae233cc8038.png)\r\n\r\n  - Enhanced LoadImage into three distinct nodes to meet different needs, all supporting direct image loading from local paths or URLs\r\n  - Completely redesigned ImageStitch node compatible with ComfyUI's native functionality\r\n  - Fixed background color handling issues reported by users\r\n\r\n- **2025\u002F07\u002F15**: Update ComfyUI-RMBG to **v2.6.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v260-20250715) )\r\n\r\n![ReferenceLatentMaskr](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_74a0e1a20758.png)\r\n\r\n  - Added `Kontext Refence latent Mask` node, Which uses a reference latent and mask for precise region conditioning.\r\n\r\n- **2025\u002F07\u002F11**: Update ComfyUI-RMBG to **v2.5.2** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v252-20250711) )\r\n\r\n![V 2 5 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_ef36bbf2e71b.png)\r\n\r\n- **2025\u002F07\u002F07**: Update ComfyUI-RMBG to **v2.5.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v251-20250707) )\r\n\r\n- **2025\u002F07\u002F01**: Update ComfyUI-RMBG to **v2.5.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v250-20250701) )\r\n\r\n![mask_overlay](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_2e7ecb0d17bd.png)\r\n\r\n  - Added `MaskOverlay`, `ObjectRemover`, `ImageMaskResize` new nodes.\r\n  - Added 2 BiRefNet models: `BiRefNet_lite-matting` and `BiRefNet_dynamic`\r\n  - Added batch image support for `Segment_v1` and `Segment_V2` nodes\r\n    \r\n- **2025\u002F06\u002F01**: Update ComfyUI-RMBG to **v2.4.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v240-20250601) )\r\n![ComfyUI-RMBG_V2 4 0 new nodes](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_37ef33aa5f85.png)\r\n  - Added `CropObject`, `ImageCompare`, `ColorInput` nodes and new Segment V2 (see update.md for details)\r\n- **2025\u002F05\u002F15**: Update ComfyUI-RMBG to **v2.3.2** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v232-20250515) )\r\n![v 2 3 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_d8ad1d85ba12.png)\r\n- **2025\u002F05\u002F02**: Update ComfyUI-RMBG to **v2.3.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v231-20250502) )\r\n- **2025\u002F05\u002F01**: Update ComfyUI-RMBG to **v2.3.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v230-20250501) )\r\n![v2 3 0_node](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_0dcb593f4972.png)\r\n  - Added new nodes: IC-LoRA Concat, Image Crop\r\n  - Added resizing options for Load Image: Longest Side, Shortest Side, Width, and Height, enhancing flexibility.\r\n- **2025\u002F04\u002F05**: Update ComfyUI-RMBG to **v2.2.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v221-20250405) )\r\n- **2025\u002F04\u002F05**: Update ComfyUI-RMBG to **v2.2.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v220-20250405) )\r\n![Comfyu-rmbg_v2 2 1_node_sample](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_76cbafef4665.png)\r\n  - Added new nodes: Image Combiner, Image Stitch, Image\u002FMask Converter, Mask Enhancer, Mask Combiner, and Mask Extractor\r\n  - Fixed compatibility issues with transformers v4.49+\r\n  - Fixed i18n translation errors\r\n  - Added mask image output to segment nodes\r\n\r\n- **2025\u002F03\u002F21**: Update ComfyUI-RMBG to **v2.1.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v211-20250321) )\r\n  - Enhanced compatibility with Transformers\r\n\r\n- **2025\u002F03\u002F19**: Update ComfyUI-RMBG to **v2.1.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v210-20250319) )\r\n  - Integrated internationalization (i18n) support for multiple languages.\r\n  - Improved user interface for dynamic language switching.\r\n  - Enhanced accessibility for non-English speaking users with fully translatable features.\r\n\r\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F7faa00d3-bbe2-42b8-95ed-2c830a1ff04f\r\n\r\n- **2025\u002F03\u002F13**: Update ComfyUI-RMBG to **v2.0.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v200-20250313) )\r\n![image_mask_preview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_0a992e0f5e7c.png)\r\n\r\n  - Added Image and Mask Tools improved functionality.\r\n  - Enhanced code structure and documentation for better usability.\r\n  - Introduced a new category path: `🧪AILab\u002F🛠️UTIL\u002F🖼️IMAGE`.\r\n\r\n- **2025\u002F02\u002F24**: Update ComfyUI-RMBG to **v1.9.3** Clean up the code and fix the issue ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v193-20250224) )\r\n\r\n- **2025\u002F02\u002F21**: Update ComfyUI-RMBG to **v1.9.2** with Fast Foreground Color Estimation ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v192-20250221) )\r\n![RMBG_V1 9 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_e0a6f9eca7ad.png)\r\n  - Added new foreground refinement feature for better transparency handling\r\n  - Improved edge quality and detail preservation\r\n  - Enhanced memory optimization\r\n\r\n- **2025\u002F02\u002F20**: Update ComfyUI-RMBG to **v1.9.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v191-20250220) )\r\n  - Changed repository for model management to the new repository and Reorganized models files structure for better maintainability.\r\n\r\n- **2025\u002F02\u002F19**: Update ComfyUI-RMBG to **v1.9.0** with BiRefNet model improvements ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v190-20250219) )\r\n![rmbg_v1 9 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_3da9bc79aef2.png)\r\n  - Enhanced BiRefNet model performance and stability\r\n  - Improved memory management for large images\r\n\r\n- **2025\u002F02\u002F07**: Update ComfyUI-RMBG to **v1.8.0** with new BiRefNet-HR model ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v180-20250207) )\r\n![RMBG-v1 8 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_0dfba5ddf990.png)\r\n\r\n  - Added a new custom node for BiRefNet-HR model.\r\n  - Support high resolution image processing (up to 2048x2048)\r\n\r\n- **2025\u002F02\u002F04**: Update ComfyUI-RMBG to **v1.7.0** with new BEN2 model ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v170-20250204) )\r\n![rmbg_v1 7 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_76b5d467ed2b.png)\r\n\r\n  - Added a new custom node for BEN2 model.\r\n\r\n- **2025\u002F01\u002F22**: Update ComfyUI-RMBG to **v1.6.0** with new Face Segment custom node ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v160-20250122) )\r\n![RMBG_v1 6 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_f3a01014007b.png)\r\n\r\n  - Added a new custom node for face parsing and segmentation\r\n  - Support for 19 facial feature categories (Skin, Nose, Eyes, Eyebrows, etc.)\r\n  - Precise facial feature extraction and segmentation\r\n  - Multiple feature selection for combined segmentation\r\n  - Same parameter controls as other RMBG nodes\r\n    \r\n- **2025\u002F01\u002F05**: Update ComfyUI-RMBG to **v1.5.0** with new Fashion and accessories Segment custom node ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v150-20250105) )\r\n![RMBGv_1 5 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_2aa09497e9e7.png)\r\n\r\n  - Added a new custom node for fashion segmentation.\r\n\r\n- **2025\u002F01\u002F02**: Update ComfyUI-RMBG to **v1.4.0** with new Clothes Segment node ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v140-20250102) )\r\n![rmbg_v1 4 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_e6ed7121cee2.png)\r\n\r\n  - Added intelligent clothes segmentation with 18 different categories\r\n  - Support multiple item selection and combined segmentation\r\n  - Same parameter controls as other RMBG nodes\r\n  \r\n- **2024\u002F12\u002F29**: Update ComfyUI-RMBG to **v1.3.2** with background handling ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v132-20241229) )\r\n  - Enhanced background handling to support RGBA output when \"Alpha\" is selected.\r\n  - Ensured RGB output for all other background color selections.\r\n\r\n- **2024\u002F12\u002F25**: Update ComfyUI-RMBG to **v1.3.1** with bug fixes ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v131-20241225) )\r\n  - Fixed an issue with mask processing when the model returns a list of masks.\r\n  - Improved handling of image formats to prevent processing errors.\r\n\r\n- **2024\u002F12\u002F23**: Update ComfyUI-RMBG to **v1.3.0** with new Segment node ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v140-20241222) )\r\n![rmbg v1.3.0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_15bda11d7f5d.png)\r\n\r\n  - Added text-prompted object segmentation\r\n  - Support both tag-style (\"cat, dog\") and natural language (\"a person wearing red jacket\") prompts\r\n  - Multiple models: SAM (vit_h\u002Fl\u002Fb) and GroundingDINO (SwinT\u002FB) (as always model file will be downloaded automatically when first time using the specific model)\r\n  - This update requires install requirements.txt\r\n\r\n- **2024\u002F12\u002F12**: Update Comfyui-RMBG ComfyUI Custom Node to **v1.2.2** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v122-20241212) )\r\n![RMBG1 2 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_c703b68269d7.png)\r\n\r\n- **2024\u002F12\u002F02**: Update Comfyui-RMBG ComfyUI Custom Node to **v1.2.1** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.mdv121-20241202) )\r\n![GIF_TO_AWEBP](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_382e1b605cc3.png)\r\n\r\n- **2024\u002F11\u002F29**: Update Comfyui-RMBG ComfyUI Custom Node to **v1.2.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v120-20241129) )\r\n![RMBGv1 2 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_71afd8af3391.png)\r\n\r\n- **2024\u002F11\u002F21**: Update Comfyui-RMBG ComfyUI Custom Node to **v1.1.0** ( [update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v110-20241121) )\r\n![comfyui-rmbg version compare](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1276120f36e2.png)\r\n\r\n## Features\r\n- Background Removal (RMBG Node)\r\n  - Multiple models: RMBG-2.0, INSPYRENET, BEN, BEN2\r\n  - Various background options\r\n  - Batch processing support\r\n  \r\n- Object Segmentation (Segment Node)\r\n  - Text-prompted object detection\r\n  - Support both tag-style and natural language inputs\r\n  - High-precision segmentation with SAM\r\n  - Flexible parameter controls\r\n\r\n- SAM2 Segmentation\r\n  - Text-prompted segmentation with the latest SAM2 models (Tiny\u002FSmall\u002FBase+\u002FLarge)\r\n  - Automatic model download on first use, with manual download option\r\n\r\n![RMBG Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_5d3f20e61b09.png)\r\n\r\n## Installation\r\n\r\n### Method 1. install on ComfyUI-Manager, search `Comfyui-RMBG` and install\r\ninstall requirment.txt in the ComfyUI-RMBG folder\r\n  ```bash\r\n  .\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install -r requirements.txt\r\n  ```\r\n> [!NOTE]\r\n> Windows desktop app: if the app crashes after install, set `PYTHONUTF8=1` before installing requirements, then retry.\r\n\r\n> [!NOTE]\r\n> YOLO nodes require the optional `ultralytics` package. Install it only if you need YOLO to avoid dependency conflicts: `.\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install ultralytics --no-deps`.\r\n\r\n> [!TIP]\r\n> Note: If your environment cannot install dependencies with the system Python, you can use ComfyUI's embedded Python instead.\r\n> Example (embedded Python): `.\u002FComfyUI\u002Fpython_embeded\u002Fpython.exe -m pip install --no-user --no-cache-dir -r requirements.txt`\r\n\r\n### Method 2. Clone this repository to your ComfyUI custom_nodes folder:\r\n  ```bash\r\n  cd ComfyUI\u002Fcustom_nodes\r\n  git clone https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\r\n  ```\r\n  install requirment.txt in the ComfyUI-RMBG folder\r\n  ```bash\r\n  .\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install -r requirements.txt\r\n  ```\r\n\r\n### Method 3: Install via Comfy CLI\r\n  Ensure `pip install comfy-cli` is installed.\r\n  Installing ComfyUI `comfy install` (if you don't have ComfyUI Installed)\r\n  install the ComfyUI-RMBG, use the following command:\r\n  ```bash\r\n  comfy node install ComfyUI-RMBG\r\n  ```\r\n  install requirment.txt in the ComfyUI-RMBG folder\r\n  ```bash\r\n  .\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install -r requirements.txt\r\n  ```\r\n\r\n### 4. Manually download the models:\r\n- The model will be automatically downloaded to `ComfyUI\u002Fmodels\u002FRMBG\u002F` when first time using the custom node.\r\n- Manually download the RMBG-2.0 model by visiting this [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FRMBG-2.0), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002FRMBG-2.0` folder.\r\n- Manually download the INSPYRENET models by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Finspyrenet), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002FINSPYRENET` folder.\r\n- Manually download the BEN model by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBEN), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBEN` folder.\r\n- Manually download the BEN2 model by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBEN2), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBEN2` folder.\r\n- Manually download the BiRefNet-HR by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBiRefNet_HR), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBiRefNet-HR` folder.\r\n- Manually download the SAM models by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsam), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FSAM` folder.\r\n- Manually download the SAM2 models by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsam2), then download the files (e.g., `sam2.1_hiera_tiny.safetensors`, `sam2.1_hiera_small.safetensors`, `sam2.1_hiera_base_plus.safetensors`, `sam2.1_hiera_large.safetensors`) and place them in the `\u002FComfyUI\u002Fmodels\u002Fsam2` folder.\r\n- Manually download the GroundingDINO models by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FGroundingDINO), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002Fgrounding-dino` folder.\r\n- Manually download the Clothes Segment model by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsegformer_clothes), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002Fsegformer_clothes` folder.\r\n- Manually download the Fashion Segment model by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsegformer_fashion), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002Fsegformer_fashion` folder.\r\n- Manually download BiRefNet models by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBiRefNet), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBiRefNet` folder.\r\n- Manually download SDMatte safetensors models by visiting the [link](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FSDMatte), then download the files and place them in the `\u002FComfyUI\u002Fmodels\u002FRMBG\u002FSDMatte` folder.\r\n\r\n## Usage  \r\n### RMBG Node\r\n![RMBG](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_6fc833a48b5d.png)\r\n\r\n### Optional Settings :bulb: Tips\r\n| Optional Settings    | :memo: Description                                                           | :bulb: Tips                                                                                   |\r\n|----------------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|\r\n| **Sensitivity**      | Adjusts the strength of mask detection. Higher values result in stricter detection. | Default value is 0.5. Adjust based on image complexity; more complex images may require higher sensitivity. |\r\n| **Processing Resolution** | Controls the processing resolution of the input image, affecting detail and memory usage. | Choose a value between 256 and 2048, with a default of 1024. Higher resolutions provide better detail but increase memory consumption. |\r\n| **Mask Blur**        | Controls the amount of blur applied to the mask edges, reducing jaggedness. | Default value is 0. Try setting it between 1 and 5 for smoother edge effects.                    |\r\n| **Mask Offset**      | Allows for expanding or shrinking the mask boundary. Positive values expand the boundary, while negative values shrink it. | Default value is 0. Adjust based on the specific image, typically fine-tuning between -10 and 10. |\r\n| **Background**      | Choose output background color | Alpha (transparent background) Black, White, Green, Blue, Red |\r\n| **Invert Output**      | Flip mask and image output | Invert both image and mask output |\r\n| **Refine Foreground** | Use Fast Foreground Color Estimation to optimize transparent background | Enable for better edge quality and transparency handling |\r\n| **Performance Optimization** | Properly setting options can enhance performance when processing multiple images. | If memory allows, consider increasing `process_res` and `mask_blur` values for better results, but be mindful of memory usage. |\r\n\r\n### Basic Usage\r\n1. Load `RMBG (Remove Background)` node from the `🧪AILab\u002F🧽RMBG` category\r\n2. Connect an image to the input\r\n3. Select a model from the dropdown menu\r\n4. select the parameters as needed (optional)\r\n3. Get two outputs:\r\n   - IMAGE: Processed image with transparent, black, white, green, blue, or red background\r\n   - MASK: Binary mask of the foreground\r\n\r\n### Parameters\r\n- `sensitivity`: Controls the background removal sensitivity (0.0-1.0)\r\n- `process_res`: Processing resolution (512-2048, step 128)\r\n- `mask_blur`: Blur amount for the mask (0-64)\r\n- `mask_offset`: Adjust mask edges (-20 to 20)\r\n- `background`: Choose output background color\r\n- `invert_output`: Flip mask and image output\r\n- `optimize`: Toggle model optimization\r\n\r\n### Segment Node\r\n1. Load `Segment (RMBG)` node from the `🧪AILab\u002F🧽RMBG` category\r\n2. Connect an image to the input\r\n3. Enter text prompt (tag-style or natural language)\r\n4. Select SAM and GroundingDINO models\r\n5. Adjust parameters as needed:\r\n   - Threshold: 0.25-0.35 for broad detection, 0.45-0.55 for precision\r\n   - Mask blur and offset for edge refinement\r\n   - Background color options\r\n\r\n\u003Cdetails>\r\n\u003Csummary>\u003Ch2>About Models\u003C\u002Fh2>\u003C\u002Fsummary>\r\n\r\n## RMBG-2.0\r\nRMBG-2.0 is is developed by BRIA AI and uses the BiRefNet architecture which includes:\r\n- High accuracy in complex environments\r\n- Precise edge detection and preservation\r\n- Excellent handling of fine details\r\n- Support for multiple objects in a single image\r\n- Output Comparison\r\n- Output with background\r\n- Batch output for video\r\nThe model is trained on a diverse dataset of over 15,000 high-quality images, ensuring:\r\n- Balanced representation across different image types\r\n- High accuracy in various scenarios\r\n- Robust performance with complex backgrounds\r\n\r\n## INSPYRENET\r\nINSPYRENET is specialized in human portrait segmentation, offering:\r\n- Fast processing speed\r\n- Good edge detection capability\r\n- Ideal for portrait photos and human subjects\r\n\r\n## BEN\r\nBEN is robust on various image types, offering:\r\n- Good balance between speed and accuracy\r\n- Effective on both simple and complex scenes\r\n- Suitable for batch processing\r\n\r\n## BEN2\r\nBEN2 is a more advanced version of BEN, offering:\r\n- Improved accuracy and speed\r\n- Better handling of complex scenes\r\n- Support for more image types\r\n- Suitable for batch processing\r\n\r\n## BIREFNET MODELS\r\nBIREFNET is a powerful model for image segmentation, offering:\r\n- BiRefNet-general purpose model (balanced performance)\r\n- BiRefNet_512x512 model (optimized for 512x512 resolution)\r\n- BiRefNet-portrait model (optimized for portrait\u002Fhuman matting)\r\n- BiRefNet-matting model (general purpose matting)\r\n- BiRefNet-HR model (high resolution up to 2560x2560)\r\n- BiRefNet-HR-matting model (high resolution matting)\r\n- BiRefNet_lite model (lightweight version for faster processing)\r\n- BiRefNet_lite-2K model (lightweight version for 2K resolution)\r\n  \r\n## SAM\r\nSAM is a powerful model for object detection and segmentation, offering:\r\n- High accuracy in complex environments\r\n- Precise edge detection and preservation\r\n- Excellent handling of fine details\r\n- Support for multiple objects in a single image\r\n- Output Comparison\r\n- Output with background\r\n- Batch output for video\r\n\r\n## SAM2\r\nSAM2 is the latest segmentation model family designed for efficient, high-quality text-prompted segmentation:\r\n- Multiple sizes: Tiny, Small, Base+, Large\r\n- Optimized inference with strong accuracy\r\n- Automatic download on first use; manual placement supported in `ComfyUI\u002Fmodels\u002Fsam2`\r\n\r\n## GroundingDINO\r\nGroundingDINO is a model for text-prompted object detection and segmentation, offering:\r\n- High accuracy in complex environments\r\n- Precise edge detection and preservation\r\n- Excellent handling of fine details\r\n- Support for multiple objects in a single image\r\n- Output Comparison\r\n- Output with background\r\n- Batch output for video\r\n\r\n## BiRefNet Models\r\n- BiRefNet-general purpose model (balanced performance)\r\n- BiRefNet_512x512 model (optimized for 512x512 resolution)\r\n- BiRefNet-portrait model (optimized for portrait\u002Fhuman matting)\r\n- BiRefNet-matting model (general purpose matting)\r\n- BiRefNet-HR model (high resolution up to 2560x2560)\r\n- BiRefNet-HR-matting model (high resolution matting)\r\n- BiRefNet_lite model (lightweight version for faster processing)\r\n- BiRefNet_lite-2K model (lightweight version for 2K resolution)\r\n\u003C\u002Fdetails>\r\n\r\n\r\n## Requirements\r\n- ComfyUI\r\n- Python 3.10+\r\n- Required packages (automatically installed):\r\n  - huggingface-hub>=0.19.0\r\n  - transparent-background>=1.1.2\r\n  - segment-anything>=1.0\r\n  - groundingdino-py>=0.4.0\r\n  - opencv-python>=4.7.0\r\n  - onnxruntime>=1.15.0\r\n  - onnxruntime-gpu>=1.15.0\r\n  - protobuf>=3.20.2,\u003C6.0.0\r\n  - hydra-core>=1.3.0\r\n  - omegaconf>=2.3.0\r\n  - iopath>=0.1.9\r\n\r\n### SDMatte models (manual download)\r\n- Auto-download on first run to `models\u002FRMBG\u002FSDMatte\u002F`\r\n- If network restricted, place weights manually:\r\n  - `models\u002FRMBG\u002FSDMatte\u002FSDMatte.safetensors` (standard) or `SDMatte_plus.safetensors` (plus)\r\n  - Components (config files) are auto-downloaded; if needed, mirror the structure from the Hugging Face repo to `models\u002FRMBG\u002FSDMatte\u002F` (`scheduler\u002F`, `text_encoder\u002F`, `tokenizer\u002F`, `unet\u002F`, `vae\u002F`)\r\n\r\n## Troubleshooting (short)\r\n- 401 error when initializing GroundingDINO \u002F missing `models\u002Fsam2`:\r\n  - Delete `%USERPROFILE%\\.cache\\huggingface\\token` (and `%USERPROFILE%\\.huggingface\\token` if present)\r\n  - Ensure no `HF_TOKEN`\u002F`HUGGINGFACE_TOKEN` env vars are set\r\n  - Re-run; public repos download anonymously (no login required)\r\n- Preview shows \"Required input is missing: images\":\r\n  - Ensure image outputs are connected and upstream nodes ran successfully\r\n\r\n## Credits\r\n- RMBG-2.0: https:\u002F\u002Fhuggingface.co\u002Fbriaai\u002FRMBG-2.0\r\n- INSPYRENET: https:\u002F\u002Fgithub.com\u002Fplemeri\u002FInSPyReNet\r\n- BEN: https:\u002F\u002Fhuggingface.co\u002FPramaLLC\u002FBEN\r\n- BEN2: https:\u002F\u002Fhuggingface.co\u002FPramaLLC\u002FBEN2\r\n- BiRefNet: https:\u002F\u002Fhuggingface.co\u002FZhengPeng7\r\n- SAM: https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002Fsam-vit-base\r\n- GroundingDINO: https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FGroundingDINO\r\n- Clothes Segment: https:\u002F\u002Fhuggingface.co\u002Fmattmdjaga\u002Fsegformer_b2_clothes\r\n- SDMatte: https:\u002F\u002Fgithub.com\u002FvivoCameraResearch\u002FSDMatte\r\n\r\n- Created by: [AILab](https:\u002F\u002Fgithub.com\u002F1038lab)\r\n\r\n## Star History\r\n\r\n\u003Ca href=\"https:\u002F\u002Fwww.star-history.com\u002F#1038lab\u002Fcomfyui-rmbg&Date\">\r\n \u003Cpicture>\r\n   \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1d67b0908289.png&theme=dark\" \u002F>\r\n   \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1d67b0908289.png\" \u002F>\r\n   \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1d67b0908289.png\" \u002F>\r\n \u003C\u002Fpicture>\r\n\u003C\u002Fa>\r\n\r\nIf this custom node helps you or you like my work, please give me ⭐ on this repo! It's a great encouragement for my efforts!\r\n\r\n## License\r\nGPL-3.0 License\r\n\r\n\r\n\r\n","# ComfyUI-RMBG\n\n一款专为高级图像背景去除及对象、人脸、服饰与时尚元素的精准分割而打造的先进ComfyUI自定义节点。该工具整合了丰富多样的模型，包括RMBG-2.0、INSPYRENET、BEN、BEN2、BiRefNet、SDMatte模型、SAM、SAM2以及GroundingDINO，并新增实时背景替换功能与更优的边缘检测算法，以进一步提升处理精度。\n\n## 新闻与更新\n- **2026年1月1日**：将ComfyUI-RMBG更新至**v3.0.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v300-20260101)）\n![V3 0 0_nodes](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_c72eb4687d1a.jpg)\n- **2025年12月9日**：将ComfyUI-RMBG更新至**v2.9.6**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v296-20251209)）  \n![v2.9.6_Image Compare](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_349318d919d0.png)\n- **2025年11月25日**：将ComfyUI-RMBG更新至**v2.9.5**，修复SAM3分割中的Bug（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v295-20251125)）  \n- **2025年11月24日**：将ComfyUI-RMBG更新至**v2.9.4**，新增SAM3分割功能（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v294-20251124)）  \n![v2.9.4_sam3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_c4773028f523.png)\n- **2025年10月5日**：将ComfyUI-RMBG更新至**v2.9.3**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v293-20251005)）  \n![v2.9._color](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_4f69171f5984.png)  \n- **2025年9月30日**：将ComfyUI-RMBG更新至**v2.9.2**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v292-20250930)）  \n- 新增BiRefNet_toonOut模型  \n![v2.9.2_BiRefNet_toonOut](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_9a639941e5a7.png)\n- 更新Imagestitch  \n![v2.9.2_imagestitch](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_ff2554e0f011.png)\n\n- **2025年9月12日**：将ComfyUI-RMBG更新至**v2.9.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v291-20250912)）  \n![v2.9.1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1f44c2803be4.png)\n- **2025年8月18日**：将ComfyUI-RMBG更新至**v2.9.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v290-20250818)）  \n![v2 9 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_75914164cd83.png)  \n- 新增`SDMatte Matting`节点\n\n- **2025年8月11日**：将ComfyUI-RMBG更新至**v2.8.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v280-20250811)）  \n![v2 8 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_6988846eb86f.png)\n\n- 新增`SAM2Segment`节点，支持基于文本提示的分割，采用最新的Facebook Research SAM2技术。\n- 全面增强所有节点的颜色小部件支持。\n\n- **2025年8月6日**：将ComfyUI-RMBG更新至**v2.7.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v271-20250806)）  \n![v2.7.0_ImageStitch](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_6ae233cc8038.png)\n\n- 增强LoadImage功能，将其拆分为三个独立节点以满足不同需求，均支持从本地路径或URL直接加载图像。\n- 完全重新设计ImageStitch节点，使其兼容ComfyUI的原生功能。\n- 修复了用户反馈的背景颜色处理问题。\n\n- **2025年7月15日**：将ComfyUI-RMBG更新至**v2.6.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v260-20250715)）  \n![ReferenceLatentMaskr](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_74a0e1a20758.png)\n\n- 新增`Kontext Refence latent Mask`节点，利用参考潜伏和掩码实现精确的区域条件化。\n\n- **2025年7月11日**：将ComfyUI-RMBG更新至**v2.5.2**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v252-20250711)）  \n![V 2 5 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_ef36bbf2e71b.png)\n\n- **2025年7月7日**：将ComfyUI-RMBG更新至**v2.5.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v251-20250707)）\n\n- **2025年7月1日**：将ComfyUI-RMBG更新至**v2.5.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v250-20250701)）  \n![mask_overlay](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_2e7ecb0d17bd.png)\n\n- 新增`MaskOverlay`、`ObjectRemover`、`ImageMaskResize`等新节点。\n- 新增两款BiRefNet模型：`BiRefNet_lite-matting`和`BiRefNet_dynamic`。\n- 为`Segment_v1`和`Segment_V2`节点添加批量图像支持。\n\n- **2025年6月1日**：将ComfyUI-RMBG更新至**v2.4.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v240-20250601)）  \n![ComfyUI-RMBG_V2 4 0 new nodes](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_37ef33aa5f85.png)\n- 新增`CropObject`、`ImageCompare`、`ColorInput`节点，并推出新的Segment V2（详情见update.md）。\n- **2025年5月15日**：将ComfyUI-RMBG更新至**v2.3.2**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v232-20250515)）  \n![v 2 3 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_d8ad1d85ba12.png)\n\n- **2025年5月2日**：将ComfyUI-RMBG更新至**v2.3.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v231-20250502)）\n- **2025年5月1日**：将ComfyUI-RMBG更新至**v2.3.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v230-20250501)）  \n![v2 3 0_node](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_0dcb593f4972.png)\n- 新增IC-LoRA Concat、Image Crop等新节点。\n- 为Load Image增加长边、短边、宽度和高度四种缩放选项，提升灵活性。\n- **2025年4月5日**：将ComfyUI-RMBG更新至**v2.2.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v221-20250405)）\n- **2025年4月5日**：将ComfyUI-RMBG更新至**v2.2.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v220-20250405)）  \n![Comfyu-rmbg_v2 2 1_node_sample](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_76cbafef4665.png)\n- 新增Image Combiner、Image Stitch、Image\u002FMask Converter、Mask Enhancer、Mask Combiner和Mask Extractor等新节点。\n- 修复了与transformers v4.49+的兼容性问题。\n- 修复了i18n翻译错误。\n- 为分割节点新增了掩码图像输出。\n\n- **2025年3月21日**：将ComfyUI-RMBG更新至**v2.1.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v211-20250321)）  \n- 增强了与Transformers的兼容性。\n\n- **2025年3月19日**：将ComfyUI-RMBG更新至**v2.1.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v210-20250319)）  \n- 集成了多语言的国际化（i18n）支持。\n- 改进了用户界面，支持动态语言切换。\n- 提升了非英语用户的可访问性，实现了完全可翻译的功能。\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F7faa00d3-bbe2-42b8-95ed-2c830a1ff04f\n\n- **2025年3月13日**：将ComfyUI-RMBG更新至**v2.0.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v200-20250313)）  \n![image_mask_preview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_0a992e0f5e7c.png)\n\n- 新增了Image和Mask Tools，功能得到进一步提升。\n- 优化了代码结构和文档，提升了易用性。\n- 新增了一个新的分类路径：`🧪AILab\u002F🛠️UTIL\u002F🖼️IMAGE`。\n\n- **2025年2月24日**：将ComfyUI-RMBG更新至**v1.9.3**，清理代码并修复问题（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v193-20250224)）\n\n- **2025年2月21日**：将ComfyUI-RMBG更新至**v1.9.2**，新增快速前景颜色估计功能（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v192-20250221)）  \n![RMBG_V1 9 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_e0a6f9eca7ad.png)\n- 新增了前景细化功能，更好地处理透明度问题。\n- 提升了边缘质量和细节保留。\n- 加强了内存优化。\n\n- **2025年2月20日**：将ComfyUI-RMBG更新至**v1.9.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v191-20250220)）  \n- 将模型管理的仓库迁移到新仓库，并重新组织了模型文件结构，以提高可维护性。\n\n- **2025年2月19日**：将ComfyUI-RMBG更新至**v1.9.0**，改进了BiRefNet模型（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v190-20250219)）  \n![rmbg_v1 9 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_3da9bc79aef2.png)\n- 提升了BiRefNet模型的性能和稳定性。\n- 改进了大图像的内存管理。\n\n- **2025年2月7日**：将ComfyUI-RMBG更新至**v1.8.0**，新增BiRefNet-HR模型（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v180-20250207)）  \n![RMBG-v1 8 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_0dfba5ddf990.png)\n\n- 新增了一个用于BiRefNet-HR模型的自定义节点。\n- 支持高分辨率图像处理（最高可达2048x2048）。\n\n- **2025年2月4日**：将ComfyUI-RMBG更新至**v1.7.0**，新增BEN2模型（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v170-20250204)）  \n![rmbg_v1 7 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_76b5d467ed2b.png)\n\n- 新增了一个用于BEN2模型的自定义节点。\n\n- **2025年1月22日**：将ComfyUI-RMBG更新至**v1.6.0**，新增Face Segment自定义节点（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v160-20250122)）  \n![RMBG_v1 6 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_f3a01014007b.png)\n\n- 新增了一个用于人脸解析和分割的自定义节点。\n- 支持19种面部特征类别（皮肤、鼻子、眼睛、眉毛等）。\n- 精确提取和分割面部特征。\n- 多种特征选择以实现组合分割。\n- 参数控制与其他RMBG节点相同。\n\n- **2025年1月5日**：将ComfyUI-RMBG更新至**v1.5.0**，新增Fashion and accessories Segment自定义节点（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v150-20250105)）  \n![RMBGv_1 5 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_2aa09497e9e7.png)\n\n- 新增了一个用于时尚分割的自定义节点。\n\n- **2025年1月2日**：将ComfyUI-RMBG更新至**v1.4.0**，新增Clothes Segment节点（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v140-20250102)）  \n![rmbg_v1 4 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_e6ed7121cee2.png)\n\n- 新增了智能衣物分割功能，涵盖18个不同类别。\n- 支持多件物品选择和组合分割。\n- 参数控制与其他RMBG节点相同。\n\n- **2024年12月29日**：将ComfyUI-RMBG更新至**v1.3.2**，改进了背景处理（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v132-20241229)）  \n- 增强了背景处理功能，支持在选择“Alpha”时输出RGBA。\n- 确保在其他背景颜色选择下仍输出RGB。\n\n- **2024年12月25日**：将ComfyUI-RMBG更新至**v1.3.1**，修复了Bug（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v131-20241225)）  \n- 修复了当模型返回多个掩码时的掩码处理问题。\n- 改进了图像格式的处理，避免了处理错误。\n\n- **2024年12月23日**：将ComfyUI-RMBG更新至**v1.3.0**，新增Segment节点（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v140-20241222)）  \n![rmbg v1.3.0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_15bda11d7f5d.png)\n\n- 新增了基于文本提示的对象分割功能。\n- 同时支持标签式（“猫、狗”）和自然语言（“一个穿红夹克的人”）提示。\n- 多种模型：SAM（vit_h\u002Fl\u002Fb）和GroundingDINO（SwinT\u002FB）（每次使用特定模型时，模型文件会自动下载）。\n- 此次更新需要安装requirements.txt。\n\n- **2024年12月12日**：将Comfyui-RMBG ComfyUI自定义节点更新至**v1.2.2**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v122-20241212)）  \n![RMBG1 2 2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_c703b68269d7.png)\n\n- **2024年12月2日**：将Comfyui-RMBG ComfyUI自定义节点更新至**v1.2.1**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v121-20241202)）  \n![GIF_TO_AWEBP](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_382e1b605cc3.png)\n\n- **2024年11月29日**：将Comfyui-RMBG ComfyUI自定义节点更新至**v1.2.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v120-20241129)）  \n![RMBGv1 2 0](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_71afd8af3391.png)\n\n- **2024年11月21日**：将Comfyui-RMBG ComfyUI自定义节点更新至**v1.1.0**（[update.md](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fblob\u002Fmain\u002Fupdate.md#v110-20241121)）  \n![comfyui-rmbg version compare](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1276120f36e2.png)\n\n## 功能特性  \n- 背景去除（RMBG节点）  \n  - 多种模型：RMBG-2.0、INSPYRENET、BEN、BEN2  \n  - 丰富的背景选项  \n  - 支持批量处理  \n\n- 对象分割（Segment节点）  \n  - 文本提示式对象检测  \n  - 同时支持标签式与自然语言输入  \n  - 基于SAM的高精度分割  \n  - 灵活的参数控制  \n\n- SAM2 分割  \n  - 使用最新SAM2模型（Tiny\u002FSmall\u002FBase+\u002FLarge）进行文本提示式分割  \n  - 首次使用时自动下载模型，也可手动下载  \n\n![RMBG演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_5d3f20e61b09.png)\n\n## 安装方法  \n\n### 方法1：通过ComfyUI-Manager安装  \n在ComfyUI-RMBG文件夹中运行`install requirment.txt`：  \n```bash\n.\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install -r requirements.txt\n```  \n> [!注意]  \n> Windows桌面应用：若安装后程序崩溃，请在安装依赖前设置`PYTHONUTF8=1`，然后再重试。\n\n> [!注意]  \n> YOLO节点需要可选的`ultralytics`包。仅在确实需要YOLO时才安装，以避免依赖冲突：`.\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install ultralytics --no-deps`。\n\n> [!提示]  \n> 注意：如果您的环境无法使用系统Python安装依赖，可以改用ComfyUI自带的嵌入式Python。  \n> 示例（嵌入式Python）：`.\u002FComfyUI\u002Fpython_embeded\u002Fpython.exe -m pip install --no-user --no-cache-dir -r requirements.txt`\n\n### 方法2：将本仓库克隆到您的ComfyUI custom_nodes文件夹  \n```bash\ncd ComfyUI\u002Fcustom_nodes\ngit clone https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\n```  \n在ComfyUI-RMBG文件夹中运行`install requirment.txt`：  \n```bash\n.\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install -r requirements.txt\n```\n\n### 方法3：通过Comfy CLI安装  \n确保已安装`pip install comfy-cli`。  \n先安装ComfyUI（如果您尚未安装ComfyUI）：  \n```bash\ncomfy node install ComfyUI-RMBG\n```  \n然后在ComfyUI-RMBG文件夹中运行`install requirment.txt`：  \n```bash\n.\u002FComfyUI\u002Fpython_embeded\u002Fpython -m pip install -r requirements.txt\n```\n\n### 方法4：手动下载模型  \n- 首次使用自定义节点时，模型会自动下载到`ComfyUI\u002Fmodels\u002FRMBG\u002F`目录。  \n- 手动下载RMBG-2.0模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FRMBG-2.0)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002FRMBG-2.0`文件夹。  \n- 手动下载INSPYRENET模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Finspyrenet)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002FINSPYRENET`文件夹。  \n- 手动下载BEN模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBEN)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBEN`文件夹。  \n- 手动下载BEN2模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBEN2)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBEN2`文件夹。  \n- 手动下载BiRefNet-HR模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBiRefNet_HR)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBiRefNet-HR`文件夹。  \n- 手动下载SAM模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsam)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FSAM`文件夹。  \n- 手动下载SAM2模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsam2)，下载文件（如`sam2.1_hiera_tiny.safetensors`、`sam2.1_hiera_small.safetensors`、`sam2.1_hiera_base_plus.safetensors`、`sam2.1_hiera_large.safetensors`），并将它们放置于`\u002FComfyUI\u002Fmodels\u002Fsam2`文件夹。  \n- 手动下载GroundingDINO模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FGroundingDINO)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002Fgrounding-dino`文件夹。  \n- 手动下载Clothes Segment模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsegformer_clothes)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002Fsegformer_clothes`文件夹。  \n- 手动下载Fashion Segment模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002Fsegformer_fashion)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002Fsegformer_fashion`文件夹。  \n- 手动下载BiRefNet模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FBiRefNet)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002FBiRefNet`文件夹。  \n- 手动下载SDMatte safetensors模型：访问[此链接](https:\u002F\u002Fhuggingface.co\u002F1038lab\u002FSDMatte)，下载文件后将其放置于`\u002FComfyUI\u002Fmodels\u002FRMBG\u002FSDMatte`文件夹。\n\n## 使用方法  \n### RMBG节点  \n![RMBG](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_6fc833a48b5d.png)\n\n### 可选设置 :bulb: 小贴士  \n| 可选设置    | :memo: 描述                                                           | :bulb: 小贴士                                                                                   |\n|-------------|---------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|\n| **灵敏度**  | 调整掩膜检测的强度。数值越高，检测越严格。                         | 默认值为0.5。根据图像复杂程度调整；复杂图像可能需要更高的灵敏度。                             |\n| **处理分辨率** | 控制输入图像的处理分辨率，影响细节表现与内存占用。                 | 选择256至2048之间的值，默认为1024。分辨率越高，细节越清晰，但内存消耗也越大。                     |\n| **掩膜模糊** | 控制掩膜边缘的模糊程度，减少锯齿效应。                             | 默认值为0。尝试将该值设为1至5，以获得更平滑的边缘效果。                                    |\n| **掩膜偏移** | 允许扩大或缩小掩膜边界。正值扩大边界，负值缩小边界。               | 默认值为0。根据具体图像调整，通常在-10至10之间微调。                                       |\n| **背景**    | 选择输出背景颜色 | Alpha（透明背景）、黑色、白色、绿色、蓝色、红色 |\n| **反向输出** | 翻转掩膜与图像输出 | 同时反转图像与掩膜输出 |\n| **优化前景** | 使用快速前景颜色估计优化透明背景 | 开启后可提升边缘质量与透明度处理效果 |\n| **性能优化** | 合理设置各项参数可在处理多张图像时提升性能。                     | 若内存充足，可适当提高`process_res`与`mask_blur`值以获得更好效果，但需注意内存占用。             |\n\n### 基本使用\n1. 从 `🧪AILab\u002F🧽RMBG` 类别中加载 `RMBG（移除背景）` 节点  \n2. 将一张图像连接到输入端  \n3. 从下拉菜单中选择一个模型  \n4. 根据需要选择参数（可选）  \n5. 获取两个输出：  \n   - IMAGE：处理后的图像，背景可为透明、黑色、白色、绿色、蓝色或红色  \n   - MASK：前景的二值掩码  \n\n### 参数\n- `sensitivity`：控制背景移除的灵敏度（0.0–1.0）  \n- `process_res`：处理分辨率（512–2048，步长128）  \n- `mask_blur`：掩码的模糊程度（0–64）  \n- `mask_offset`：调整掩码边缘（-20至20）  \n- `background`：选择输出背景颜色  \n- `invert_output`：反转掩码与图像的输出  \n- `optimize`：切换模型优化  \n\n### 分段节点\n1. 从 `🧪AILab\u002F🧽RMBG` 类别中加载 `分段（RMBG）` 节点  \n2. 将一张图像连接到输入端  \n3. 输入文本提示（标签式或自然语言）  \n4. 选择 SAM 和 GroundingDINO 模型  \n5. 根据需要调整参数：  \n   - 阈值：0.25–0.35 用于宽泛检测，0.45–0.55 用于精确检测  \n   - 掩码模糊与偏移用于边缘细化  \n   - 背景颜色选项  \n\n\u003Cdetails>\n\u003Csummary>\u003Ch2>关于模型\u003C\u002Fh2>\u003C\u002Fsummary>\n\n## RMBG-2.0\nRMBG-2.0 由 BRIA AI 开发，采用 BiRefNet 架构，具备以下特点：\n- 在复杂环境下具有高精度  \n- 精确的边缘检测与保留  \n- 对细节的出色处理能力  \n- 支持单张图像中的多对象分割  \n- 输出对比  \n- 带背景的输出  \n- 视频批量输出  \n\n该模型在超过 15,000 张高质量图像的多样化数据集上进行训练，确保：\n- 不同图像类型的均衡表现  \n- 各种场景下的高准确率  \n- 复杂背景下的稳健性能  \n\n## INSPYRENET\nINSPYRENET 专注于人像分割，具有以下优势：\n- 处理速度快  \n- 边缘检测能力强  \n- 非常适合人像照片与人物主体  \n\n## BEN\nBEN 在各类图像上表现稳健，具备：\n- 速度与精度的良好平衡  \n- 对简单与复杂场景均有效  \n- 适合批量处理  \n\n## BEN2\nBEN2 是 BEN 的升级版，具备：\n- 更高的精度与速度  \n- 更强的复杂场景处理能力  \n- 支持更多图像类型  \n- 适合批量处理  \n\n## BIREFNET 模型\nBIREFNET 是一款强大的图像分割模型，提供多种版本：\n- BiRefNet-通用模型（性能均衡）  \n- BiRefNet_512x512 模型（针对 512×512 分辨率优化）  \n- BiRefNet_人像模型（针对人像\u002F人体抠图优化）  \n- BiRefNet_抠图模型（通用抠图）  \n- BiRefNet-HR 模型（高分辨率，最高可达 2560×2560）  \n- BiRefNet-HR_抠图模型（高分辨率抠图）  \n- BiRefNet_lite 模型（轻量版，处理更快）  \n- BiRefNet_lite-2K 模型（轻量版，支持 2K 分辨率）  \n\n## SAM\nSAM 是一款强大的目标检测与分割模型，具备：\n- 在复杂环境下的高精度  \n- 精确的边缘检测与保留  \n- 对细节的出色处理能力  \n- 支持单张图像中的多对象分割  \n- 输出对比  \n- 带背景的输出  \n- 视频批量输出  \n\n## SAM2\nSAM2 是最新的分割模型系列，专为高效、高质量的文本提示分割而设计：\n- 多种尺寸：Tiny、Small、Base+、Large  \n- 推理优化，同时保持高精度  \n- 首次使用时自动下载；也可手动放置于 `ComfyUI\u002Fmodels\u002Fsam2`  \n\n## GroundingDINO\nGroundingDINO 是一款基于文本提示的目标检测与分割模型，具备：\n- 在复杂环境下的高精度  \n- 精确的边缘检测与保留  \n- 对细节的出色处理能力  \n- 支持单张图像中的多对象分割  \n- 输出对比  \n- 带背景的输出  \n- 视频批量输出  \n\n## BiRefNet 模型\n- BiRefNet-通用模型（性能均衡）  \n- BiRefNet_512x512 模型（针对 512×512 分辨率优化）  \n- BiRefNet_人像模型（针对人像\u002F人体抠图优化）  \n- BiRefNet_抠图模型（通用抠图）  \n- BiRefNet-HR 模型（高分辨率，最高可达 2560×2560）  \n- BiRefNet-HR_抠图模型（高分辨率抠图）  \n- BiRefNet_lite 模型（轻量版，处理更快）  \n- BiRefNet_lite-2K 模型（轻量版，支持 2K 分辨率）  \n\n\u003C\u002Fdetails>\n\n\n## 需求\n- ComfyUI  \n- Python 3.10 及以上  \n- 必需包（自动安装）：  \n  - huggingface-hub≥0.19.0  \n  - transparent-background≥1.1.2  \n  - segment-anything≥1.0  \n  - groundingdino-py≥0.4.0  \n  - opencv-python≥4.7.0  \n  - onnxruntime≥1.15.0  \n  - onnxruntime-gpu≥1.15.0  \n  - protobuf≥3.20.2,\u003C6.0.0  \n  - hydra-core≥1.3.0  \n  - omegaconf≥2.3.0  \n  - iopath≥0.1.9  \n\n### SDMatte 模型（手动下载）\n- 首次运行时自动下载至 `models\u002FRMBG\u002FSDMatte\u002F`  \n- 若网络受限，则需手动放置权重文件：  \n  - `models\u002FRMBG\u002FSDMatte\u002FSDMatte.safetensors`（标准版）或 `SDMatte_plus.safetensors`（Plus 版）  \n  - 组件（配置文件）会自动下载；如有需要，可将 Hugging Face 仓库的结构镜像至 `models\u002FRMBG\u002FSDMatte\u002F`（scheduler\u002F、text_encoder\u002F、tokenizer\u002F、unet\u002F、vae\u002F）  \n\n## 故障排除（简要）\n- 初始化 GroundingDINO 时出现 401 错误或缺少 `models\u002Fsam2`：  \n  - 删除 `%USERPROFILE%\\.cache\\huggingface\\token`（若存在，也删除 `%USERPROFILE%\\.huggingface\\token`）  \n  - 确保未设置 `HF_TOKEN` 或 `HUGGINGFACE_TOKEN` 环境变量  \n  - 重新运行；公共仓库会匿名下载（无需登录）  \n- 预览显示“所需输入缺失：图像”：  \n  - 确保图像输出已连接，并且上游节点已成功运行  \n\n## 致谢\n- RMBG-2.0：https:\u002F\u002Fhuggingface.co\u002Fbriaai\u002FRMBG-2.0  \n- INSPYRENET：https:\u002F\u002Fgithub.com\u002Fplemeri\u002FInSPyReNet  \n- BEN：https:\u002F\u002Fhuggingface.co\u002FPramaLLC\u002FBEN  \n- BEN2：https:\u002F\u002Fhuggingface.co\u002FPramaLLC\u002FBEN2  \n- BiRefNet：https:\u002F\u002Fhuggingface.co\u002FZhengPeng7  \n- SAM：https:\u002F\u002Fhuggingface.co\u002Ffacebook\u002Fsam-vit-base  \n- GroundingDINO：https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FGroundingDINO  \n- 衣物分割：https:\u002F\u002Fhuggingface.co\u002Fmattmdjaga\u002Fsegformer_b2_clothes  \n- SDMatte：https:\u002F\u002Fgithub.com\u002FvivoCameraResearch\u002FSDMatte  \n\n- 由 [AILab](https:\u002F\u002Fgithub.com\u002F1038lab) 创建  \n\n## 星标历史\n\n\u003Ca href=\"https:\u002F\u002Fwww.star-history.com\u002F#1038lab\u002Fcomfyui-rmbg&Date\">\n \u003Cpicture>\n   \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1d67b0908289.png&theme=dark\" \u002F>\n   \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1d67b0908289.png\" \u002F>\n   \u003Cimg alt=\"星标历史图表\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_readme_1d67b0908289.png\" \u002F>\n \u003C\u002Fpicture>\n\u003C\u002Fa>\n\n如果这个自定义节点对您有帮助，或者您喜欢我的工作，请为这个仓库点个 ⭐！这将是对我的努力的巨大鼓励！  \n\n## 许可证\nGPL-3.0 许可证","# ComfyUI-RMBG 快速上手指南\n\nComfyUI-RMBG 是一个基于 ComfyUI 的自定义节点工具，用于高级图像背景移除和对象、人脸、服装及时尚元素的精确分割。该工具集成了多种模型（如 RMBG-2.0、INSPYRENET、SAM、SAM2 等），并支持实时背景替换与增强边缘检测功能。\n\n---\n\n## 环境准备\n\n### 系统要求\n- 操作系统：Windows \u002F macOS \u002F Linux\n- Python 版本：3.8 - 3.11\n- 显卡支持：建议使用 NVIDIA GPU 并安装 CUDA 驱动以加速推理过程\n\n### 前置依赖\n确保已安装以下软件：\n- [ComfyUI](https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI)\n- Python 依赖库（通过 pip 安装）：\n  ```bash\n  pip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n  pip install transformers accelerate diffusers\n  ```\n\n> 📌 提示：若在国内使用，可使用清华源加速安装：\n> ```bash\n> pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n> ```\n\n---\n\n## 安装步骤\n\n1. **克隆仓库**  \n   执行以下命令将 ComfyUI-RMBG 克隆到本地：\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG.git\n   ```\n\n2. **将节点文件复制到 ComfyUI 目录**  \n   将 `ComfyUI-RMBG` 文件夹中的内容复制到 ComfyUI 的 `custom_nodes` 文件夹中：\n   ```bash\n   cp -r ComfyUI-RMBG\u002F* path\u002Fto\u002FComfyUI\u002Fcustom_nodes\u002F\n   ```\n\n3. **启动 ComfyUI**  \n   在 ComfyUI 根目录下运行：\n   ```bash\n   python main.py\n   ```\n\n4. **加载模型**  \n   启动后，在 ComfyUI 界面中选择“节点”菜单，找到并加载 `RMBG` 相关节点。部分模型可能需要从官方仓库下载，具体路径请参考项目文档或 `update.md`。\n\n---\n\n## 基本使用\n\n### 最简单的使用示例\n\n1. **加载图像**\n   - 使用 `Load Image` 节点，输入图像路径（支持本地路径或 URL）。\n\n2. **执行背景移除**\n   - 添加 `Segment_V1` 或 `Segment_V2` 节点，并连接至图像输出。\n   - 设置参数（如模型类型、是否保留透明通道等）。\n\n3. **查看结果**\n   - 连接 `Image Output` 节点，预览处理后的图像（带透明背景）。\n\n> 示例流程图（文字描述）：\n> ```\n> Load Image -> Segment_V1 -> Image Output\n> ```\n\n---\n\n## 注意事项\n\n- 部分模型需手动下载并放置在指定目录中，具体路径可在 `update.md` 中查找。\n- 若遇到兼容性问题，请检查 ComfyUI 和相关依赖版本是否匹配。\n\n--- \n\n以上为 ComfyUI-RMBG 的快速上手指南，更多高级用法请参考项目 README 及 `update.md` 文档。","一个时尚电商公司的产品设计师正在为即将上线的新品服装系列制作高质量的产品展示图，需要从大量实拍照片中快速、精准地去除背景，并对衣物进行精细的分割，以便在不同背景下进行合成和展示。\n\n### 没有 ComfyUI-RMBG 时\n- 手动使用 Photoshop 等工具进行背景去除和分割，耗时且效率低下，难以应对大批量图片处理需求。\n- 传统工具对复杂背景（如纹理布料、透明材质）或边缘细节（如衣服褶皱、发丝）处理不够精确，导致成品质量不稳定。\n- 缺乏统一的工作流程，需在多个软件之间频繁切换，增加了出错概率和后期调整成本。\n- 对于多角度拍摄的服装，无法实现一致的背景替换效果，影响整体视觉风格的统一性。\n\n### 使用 ComfyUI-RMBG 后\n- 可通过集成多种先进模型（如 SAM2、RMBG-2.0）实现自动化背景移除与对象分割，大幅缩短图像处理时间，提升工作效率。\n- 支持实时背景替换和增强边缘检测功能，显著提升了衣物轮廓和细节的准确性，确保输出图像清晰自然。\n- 提供统一的节点化工作流，可在 ComfyUI 中一站式完成图像处理任务，减少跨软件操作带来的复杂性和错误率。\n- 利用 SAM3 和 GroundingDINO 等模型，可对多角度拍摄的服装进行一致性的背景替换，保证视觉呈现的专业性和一致性。\n\nComfyUI-RMBG 通过高效、精准的图像分割与背景处理能力，极大提升了电商产品图制作的效率与质量。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002F1038lab_ComfyUI-RMBG_349318d9.png","1038lab","AI Lab","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002F1038lab_8aa634bc.jpg",null,"https:\u002F\u002Fgithub.com\u002F1038lab",[81,85],{"name":82,"color":83,"percentage":84},"Python","#3572A5",99.7,{"name":86,"color":87,"percentage":88},"JavaScript","#f1e05a",0.3,1866,109,"2026-04-04T17:57:20","GPL-3.0","Linux, macOS, Windows","需要 NVIDIA GPU，显存 8GB+，CUDA 11.7+","16GB+",{"notes":97,"python":98,"dependencies":99},"建议使用 conda 管理环境，首次运行需下载约 5GB 模型文件。部分功能可能需要安装额外的模型和依赖项，具体可参考项目文档。","3.8+",[100,101,102,103,104,105,106,107,108],"torch>=2.0","transformers>=4.30","accelerate","diffusers","einops","pillow","numpy","tqdm","opencv-python",[14],[111,112,113,114,115,116,117],"comfyui","comfyui-nodes","image","mask","remove-background","segmentation","stable-diffusion",4,"2026-03-27T02:49:30.150509","2026-04-06T05:15:09.372977",[122,127,132,137,142,147],{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},5893,"如何解决 'Config' 对象没有 'get_text_config' 属性的错误？","请更新 Transformers 库到版本 4.48.3。使用 ComfyUI 自带的 Python 环境执行以下命令：`C:\\ai\\ComfyUI_windows_portable\\python_embeded\\python.exe -m pip uninstall transformers`，然后运行 `C:\\ai\\ComfyUI_windows_portable\\python_embeded\\python.exe -m pip install transformers==4.48.3`。","https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fissues\u002F34",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},5894,"RMBG 节点卡住无法继续处理图像怎么办？","尝试将 ComfyUI 的语言设置从韩语或其他亚洲语言改为英语。此外，确保在 Windows 中启用了 UTF-8 编码支持。如果问题仍然存在，请检查是否安装了正确的依赖库，并通过 `python -m pip show ____` 验证安装路径是否正确。","https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fissues\u002F108",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},5895,"如何在抠图时保留一定的白边？","目前该功能尚未直接支持，但可以通过调整模型参数或后期处理来实现。建议联系开发者以获取更多关于边缘处理的配置选项。","https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fissues\u002F19",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},5896,"如何解决 'segmentation' 掩膜维度错误（Expected 3 dimensions for mask, got 2）的问题？","请检查用于生成掩膜的节点是否正确输出了三维张量（batch size × height × width）。如果使用的是 InpaintCropImproved 节点，请确认输入数据是否包含 batch 维度，否则需要调整节点配置或添加 batch 处理逻辑。","https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fissues\u002F58",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},5897,"Inspyrenet 模型无法下载或执行怎么办？","请确保网络连接正常，并且防火墙或代理未阻止下载操作。如果问题持续，可以手动下载模型文件并放置到指定目录中，或者尝试更换网络环境重新下载。","https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG\u002Fissues\u002F50",{"id":148,"question_zh":149,"answer_zh":150,"source_url":126},5898,"如何在 ComfyUI 中降级 Transformers 库版本？","使用 ComfyUI 自带的 Python 环境执行以下命令：`C:\\ai\\ComfyUI_windows_portable\\python_embeded\\python.exe -m pip uninstall transformers`，然后安装所需版本，例如 `C:\\ai\\ComfyUI_windows_portable\\python_embeded\\python.exe -m pip install transformers==4.48.3`。",[]]