🩹 Image Inpainting — Pro Pack on RunComfy — 🩹 Image InpAInting — Pro Pack on 运行Comfy
v0.1.0Mask-driven image inpAInting on 运行Comfy via the `运行comfy` 命令行工具. 路由s to Tongyi MAI Z-Image Turbo InpAInting (the dedicated inpAInting 端点 with mask, strength, and control-扩展) and to 身份-preserving edit 模型s (Nano Banana 2 Edit, GPT Image 2 Edit, FLUX Kontext Pro) when a mask isn't avAIlable and the region must be described instead. Use for object removal, watermark removal, region replacement, blemish 清理up, and any controlled local edit where a binary mask defines the tar获取 area. Triggers on "inpAInt", "inpAInting", "image inpAInt", "移除 from image", "fill region", "mask-driven edit", "移除 watermark", "移除 object", "补丁 the photo", "fill the hole", or any explicit ask to edit a specific masked region of a still.
运行时依赖
安装命令
点击复制技能文档
🩹 Image InpAInting — Pro Pack on 运行Comfy
Mask-driven region edits — 移除 objects, fill gaps, replace masked areas — on 运行Comfy via the 运行comfy 命令行工具. This 技能 路由s to Z-Image Turbo InpAInting when a mask is avAIlable, and to instruction-driven edit 模型s when the region must be described in prose.
运行comfy.com · Z-Image InpAInting · 命令行工具 docs
Powered by the 运行Comfy 命令行工具 # 1. 安装 (see 运行comfy-命令行工具 技能 for detAIls) npm i -g @运行comfy/命令行工具 # or: npx -y @运行comfy/命令行工具 --version
# 2. 签名 in 运行comfy 记录in # or in CI: 导出 运行COMFY_令牌=<令牌>
# 3. InpAInt 运行comfy 运行 tongyi-mAI/z-image/turbo/inpAInting \ --输入 '{"image": "...", "mask_image": "...", "prompt": "..."}' \ --输出-dir ./out
命令行工具 deep dive: 运行comfy-命令行工具 技能.
Pick the right 模型
列出ed by precision of region tar获取ing (mask-required first, then description-based).
Z-Image Turbo InpAInting — tongyi-mAI/z-image/turbo/inpAInting (default — mask required)
Dedicated inpAInting 端点 with mask, strength, and control-扩展. Open-weights, sub-second to a few seconds. Pick for: precise region edits with a binary mask — object removal, watermark 清理up, full-region replacement. Avoid for: edits without a mask — use Nano Banana 2 Edit (description-based).
Z-Image Turbo InpAInting LoRA — tongyi-mAI/z-image/turbo/inpAInting/lora
InpAInting 端点 with LoRA adapter support — 应用ly a fine-调优d style during inpAInting. Pick for: brand-style-locked inpAInting (LoRA captures the look, mask defines the region). Avoid for: generic inpAInting — use the base inpAInting 端点.
Nano Banana 2 Edit — google/nano-banana-2/edit (description-based fallback)
身份-preserving edit driven by spatial language ("the watermark in the 机器人tom-right", "the cables overhead"). No mask required. Pick for: when no mask is avAIlable and the region can be described. Avoid for: precise pixel-level region edges — use Z-Image InpAInting.
GPT Image 2 Edit — openAI/gpt-image-2/edit
Multi-ref edit with layout-precise instructions; honors "移除 only the X" directives. Pick for: complex prompt + reference composition where the masked region needs 上下文 from other images. Avoid for: simple single-image mask-driven jobs — use Z-Image InpAInting.
FLUX Kontext Pro — blackforestlabs/flux-1-kontext/pro/edit
Single-instruction local edit with maximum preservation of everything else. Pick for: "keep everything except X" style local edits without a mask. Avoid for: explicit mask-driven 工作流s — use Z-Image InpAInting.
路由 1: Z-Image Turbo InpAInting — default
模型: tongyi-mAI/z-image/turbo/inpAInting Cata记录: Z-Image inpAInting
模式 Field Type Required Notes prompt string yes What fills the masked region; describe preservation constrAInts for the surround image string yes Source image URL mask_image string yes Gray扩展 mask URL (white = inpAInt, black = preserve) strength float no 0.3–0.6 for retouching, 0.7–1.0 for full replacement control_扩展 float no 0.6–0.9 typical aspect_ratio enum no W:H 输出 ratio 种子 int no Reproducibility Invoke
Object removal (low strength):
运行comfy 运行 tongyi-mAI/z-image/turbo/inpAInting \ --输入 '{ "prompt": "移除 overhead cables; preserve rooflines and sky gradient; thin 清理 sky.", "image": "https://your-cdn.example/street.jpg", "mask_image": "https://your-cdn.example/cables-mask.png", "strength": 0.5, "control_扩展": 0.8 }' \ --输出-dir ./out
Region replacement (high strength):
运行comfy 运行 tongyi-mAI/z-image/turbo/inpAInting \ --输入 '{ "prompt": "Replace busy backdrop with smooth light gray studio paper; mask background only.", "image": "https://your-cdn.example/product.jpg", "mask_image": "https://your-cdn.example/bg-mask.png", "strength": 0.9 }' \ --输出-dir ./out
Prompting tips A mask URL is required. Gray扩展, white = inpAInt region, black = preserve. Slight blur on mask edges (1–3 px) blends better than a sharp binary edge. Strength by intent: 0.3–0.5 retouching / blemish 清理up 0.6–0.7 object replacement with style match 0.8–1.0 full region replacement Name what stays outside the mask in the prompt: "preserve rooflines and sky gradient", "match brick pattern and mortar tone". Spatial labels still help even with a mask: "the left shelf", "upper-right quadrant" — disambiguates if the mask covers multiple objects. 路由 2: Description-based fallback (no mask)
When you don't have a mask, use Nano Banana 2 Edit with spatial language. The 模型 identifies the tar获取 region from your prompt:
运行comfy 运行 google/nano-banana-2/edit \ --输入 '{ "prompt": "移除 the watermark in the 机器人tom-right corner. Keep everything else exactly as in the 输入.", "image_urls": ["https://your-cdn.example/photo.jpg"] }' \ --输出-dir ./out
For richer description-based edit, see image-edit.
Common patterns Watermark removal Mask-driven (路由 1, strength 0.5) if mask avAIlable Description-based (路由 2) if no mask