comfyui-inpainting

comfyui-inpainting is a skill for Claude Code, Codex from IvanYangYangXi/artclaw_bridge. It costs 65 tokens per session (1,734 once invoked), scanned A, original, MIT.

An inpainting workflow for ComfyUI, where inpainting means changing a selected part of an image while leaving the rest mostly unchanged. It uses an original image, a mask marking the area to edit, and a text description.

In plain words
What is it for?
Use it to remove or add objects, change clothing, or replace part of a background.
Why use it?
It avoids recreating an entire image when only one area needs changing. The mask tells the workflow where to add, remove, or replace content.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to remove or add objects, change clothing, or replace part of a background.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ivanyangyangxi/artclaw_bridge/comfyui-inpainting
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add IvanYangYangXi/artclaw_bridge --skill comfyui-inpainting
Clone the repo
git clone --depth 1 https://github.com/IvanYangYangXi/artclaw_bridge

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for comfyui-inpainting

README.md
[![agentmods](https://agentmods.dev/badge/skills/ivanyangyangxi/artclaw_bridge/comfyui-inpainting/github.svg)](https://agentmods.dev/skills/ivanyangyangxi/artclaw_bridge/comfyui-inpainting)
Your own site
<a href="https://agentmods.dev/skills/ivanyangyangxi/artclaw_bridge/comfyui-inpainting"><img src="https://agentmods.dev/badge/skills/ivanyangyangxi/artclaw_bridge/comfyui-inpainting/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for comfyui-inpainting

Your own site · 80×15
<a href="https://agentmods.dev/skills/ivanyangyangxi/artclaw_bridge/comfyui-inpainting"><img src="https://agentmods.dev/badge/skills/ivanyangyangxi/artclaw_bridge/comfyui-inpainting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,734 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.01734
Opus 5.5 $0.00026 $0.00694
Sonnet 5.5 $0.00013 $0.00347
Haiku 4.5 $0.00006 $0.00173

Measured 3mo ago against content hash 384be6f87a55, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

comfyui-inpainting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/official/comfyui/comfyui-inpainting/SKILL.md · 261 lines

How it starts

The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ComfyUI 局部重绘 (Inpainting)

修改图像的特定区域,保持其他部分不变。


预注入变量

run_python 已注入:submit_workflow, save_preview


核心概念

局部重绘需要:

  1. 原图 - 要修改的图像
  2. 遮罩 (Mask) - 标记要修改的区域(白色=修改,黑色=保持)
  3. 提示词 - 描述修改后的内容

使用方法

方法 1: 使用便捷函数

from comfyui_inpainting import build_inpaint_workflow

wf = build_inpaint_workflow(
    image_path="original.png",
    mask_path="mask.png",  # 白色区域会被重绘
    prompt="beautiful red dress",  # 修改后的内容
    negative_prompt="low quality",
    checkpoint="sdxl_base.safetensors",
    denoise=1.0,  # 1.0 = 完全重绘遮罩区域
    seed=42
)

result = submit_workflow(wf)
if result.get("images"):
    save_preview(result["images"][0])

方法 2: 分步构建

import random

wf = {}

# 1. 加载模型
wf["1"] = {"class_type": "CheckpointLoaderSimple", "inputs": {"ckpt_name": "sdxl.safetensors"}}

# 2. 加载原图和遮罩
wf["2"] = {"class_type": "LoadImage", "inputs": {"image": "original.png"}}
wf["3"] = {"class_type": "LoadImageMask", "inputs": {"image": "mask.png", "channel": "alpha"}}

# 3. 编码提示词
wf["4"] = {"class_type": "CLIPTextEncode", "inputs": {"text": "beautiful red dress", "clip": ["1", 1]}}
wf["5"] = {"class_type": "CLIPTextEncode", "inputs": {"text": "low quality", "clip": ["1", 1]}}

# 4. VAE 编码原图
wf["6"] = {"class_type": "VAEEncode", "inputs": {"pixels": ["2", 0], "vae": ["1", 2]}}

# 5. 设置潜空间噪波(只在遮罩区域)
wf["7"] = {
    "class_type": "SetLatentNoiseMask",
    "inputs": {
        "samples": ["6", 0],
        "mask": ["3", 0]
    }
}

# 6. 采样(只在遮罩区域重绘)
wf["8"] = {
    "class_type": "KSampler",
    "inputs": {
        "model": ["1", 0],
        "positive": ["4", 0],
        "negative": ["5", 0],
        "latent_image": ["7", 0],
        "seed": random.randint(0, 2**32),
        "steps": 25,
        "cfg": 7.0,
        "sampler_name": "euler",
        "scheduler": "normal",
        "denoise": 1.0  # 只在遮罩区域生效
    }
}

# 7. 解码保存
wf["9"] = {"class_type": "VAEDecode", "inputs": {"samples": ["8", 0], "vae": ["1", 2]}}
wf["10"] = {"class_type": "SaveImage", "inputs": {"images": ["9", 0], "filename_prefix": "inpaint"}}

result = submit_workflow(wf)

Read the full file on GitHub · 261 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 261 lines · 65 tokens per session scan A 384be6f87a55

Subscribe to this mod's changes

comfyui-inpainting is a skill published in the GitHub repository IvanYangYangXi/artclaw_bridge (39 stars, last pushed 7mo ago), licensed MIT. It adds 65 tokens to every session and 1,734 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

comfyui-inpainting compared with skills from other repositories

comfyui-inpainting next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
comfyui-inpaintingIvanYangYangXi/artclaw_bridgeSkill397mo agoMITA65Claude Code, Codex
dcc-mcpdcc-mcp/dcc-mcp-coreSkill78todayMITA167Claude Code
dcc-mcp-skills-creatordcc-mcp/dcc-mcp-coreSkill78todayMITA74Claude Code
dcc-cuadcc-mcp/dcc-mcp-coreSkill78todayMITA131Claude Code, Codex
marketplace-publish-extensiondcc-mcp/dcc-mcp-coreSkill78todayMITA88Claude Code
mesh-opsdcc-mcp/dcc-mcp-coreSkill78todayMITA85Claude Code
clawhub-compatdcc-mcp/dcc-mcp-coreSkill78todayMITA59Claude Code