Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Mask-driven image inpainting on RunComfy via the `runcomfy` CLI. Routes to Tongyi MAI Z-Image Turbo Inpainting (the dedicated inpainting endpoint with mask, strength, and control-scale) and to identity-preserving edit models (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 cleanup, and any controlled local edit where a binary mask defines the target
.claude/skills/aiskillstore-image-inpainting/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 94% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 151% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 147% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 141% | 0% |
Mask-driven region edits — remove objects, fill gaps, replace masked areas — on RunComfy via the runcomfy CLI. This skill routes to Z-Image Turbo Inpainting when a mask is available, and to instruction-driven edit models when the region must be described in prose.
runcomfy.com · Z-Image Inpainting · CLI docs
bash# 1. Install (see runcomfy-cli skill for details) npm i -g @runcomfy/cli # or: npx -y @runcomfy/cli --version # 2. Sign in runcomfy login # or in CI: export RUNCOMFY_TOKEN=<token> # 3. Inpaint runcomfy run tongyi-mai/z-image/turbo/inpainting \ --input '{"image": "...", "mask_image": "...", "prompt": "..."}' \ --output-dir ./out
CLI deep dive: runcomfy-cli skill.
Listed by precision of region targeting (mask-required first, then description-based).
Z-Image Turbo Inpainting — tongyi-mai/z-image/turbo/inpainting (default — mask required) > Dedicated inpainting endpoint with mask, strength, and control-scale. Open-weights, sub-second to a few seconds. > Pick for: precise region edits with a binary mask — object removal, watermark cleanup, 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 endpoint with LoRA adapter support — apply a fine-tuned 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 endpoint.
Nano Banana 2 Edit — google/nano-banana-2/edit (description-based fallback) > Identity-preserving edit driven by spatial language ("the watermark in the bottom-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 "remove only the X" directives. > Pick for: complex prompt + reference composition where the masked region needs context 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 workflows — use Z-Image Inpainting.
Model: tongyi-mai/z-image/turbo/inpainting Catalog: 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 | Grayscale mask URL (white = inpaint, black = preserve) | | strength | float | no | 0.3–0.6 for retouching, 0.7–1.0 for full replacement | | control_scale | float | no | 0.6–0.9 typical | | aspect_ratio | enum | no | W:H output ratio | | seed | int | no | Reproducibility |
Object removal (low strength):
bashruncomfy run tongyi-mai/z-image/turbo/inpainting \ --input '{ "prompt": "Remove overhead cables; preserve rooflines and sky gradient; thin clean sky.", "image": "https://your-cdn.example/street.jpg", "mask_image": "https://your-cdn.example/cables-mask.png", "strength": 0.5, "control_scale": 0.8 }' \ --output-dir ./out
Region replacement (high strength):
bashruncomfy run tongyi-mai/z-image/turbo/inpainting \ --input '{ "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 }' \ --output-dir ./out
0.3–0.5 retouching / blemish cleanup0.6–0.7 object replacement with style match0.8–1.0 full region replacement"preserve rooflines and sky gradient", "match brick pattern and mortar tone"."the left shelf", "upper-right quadrant" — disambiguates if the mask covers multiple objects.When you don't have a mask, use Nano Banana 2 Edit with spatial language. The model identifies the target region from your prompt:
bashruncomfy run google/nano-banana-2/edit \ --input '{ "prompt": "Remove the watermark in the bottom-right corner. Keep everything else exactly as in the input.", "image_urls": ["https://your-cdn.example/photo.jpg"] }' \ --output-dir ./out
For richer description-based edit, see image-edit.
strength: 0.9 and a description of the new backgroundstrength: 0.8/trainerimage-edit.image-outpainting.video-inpainting.Mask-creation tools (Photoshop, GIMP, segment-anything models) are upstream of this skill; the CLI consumes a mask URL but doesn't generate one.
| code | meaning | |---|---| | 0 | success | | 64 | bad CLI args | | 65 | bad input JSON / schema mismatch | | 69 | upstream 5xx | | 75 | retryable: timeout / 429 | | 77 | not signed in or token rejected |
Full reference: docs.runcomfy.com/cli/troubleshooting.
The skill picks Z-Image Inpainting when a mask is available, falls back to description-based edit otherwise, and invokes runcomfy run with the matching JSON body. The CLI POSTs to the Model API, polls request status, and downloads the result into --output-dir.
npm i -g @runcomfy/cli or npx -y @runcomfy/cli. Agents must not pipe an arbitrary remote install script into a shell on the user's behalf.runcomfy login writes the API token to ~/.config/runcomfy/token.json with mode 0600. Set RUNCOMFY_TOKEN env var in CI / containers.--input. The CLI does not shell-expand prompt content. No shell-injection surface.model-api.runcomfy.net and *.runcomfy.net / *.runcomfy.com. No telemetry.Bash(runcomfy *) only.runcomfy-cli — the underlying CLIimage-edit — full image-edit router (multi-ref, batch, description-based)image-outpainting — extending the canvas (opposite of inpainting)ai-image-generation — text-to-image / image-to-image routervideo-inpainting — frame-by-frame mask edits on video| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | fail→pass | 13,228 | 10,110 | -24% | 1 | 1 | 0% | 2,552 | 4,939 | +94% | 0 | 0 | — |
case-06 | fail→pass | 9,815 | 5,636 | -43% | 1 | 1 | 0% | 1,665 | 4,181 | +151% | 0 | 0 | — |
case-03 | fail→pass | 8,719 | 3,428 | -61% | 1 | 1 | 0% | 1,516 | 3,745 | +147% | 0 | 0 | — |
case-01 | fail→pass | 17,692 | 4,171 | -76% | 1 | 1 | 0% | 2,613 | 3,921 | +50% | 0 | 0 | — |
case-02 | fail→pass | 8,068 | 2,818 | -65% | 1 | 1 | 0% | 1,496 | 3,601 | +141% | 0 | 0 | — |
case-04 | fail→fail | 10,891 | 7,933 | -27% | 1 | 1 | 0% | 1,969 | 4,451 | +126% | 0 | 0 | — |
case-07 | pass→pass | 8,908 | 3,255 | -63% | 1 | 1 | 0% | 1,654 | 3,713 | +124% | 0 | 0 | — |
case-08 | fail→pass | 9,949 | 5,575 | -44% | 1 | 1 | 0% | 1,770 | 4,124 | +133% | 0 | 0 | — |
case-09 | fail→pass | 11,112 | 4,163 | -63% | 1 | 1 | 0% | 2,025 | 3,895 | +92% | 0 | 0 | — |
case-10 | fail→pass | 14,585 | 3,470 | -76% | 1 | 1 | 0% | 2,257 | 3,801 | +68% | 0 | 0 | — |
case-11 | fail→pass | 12,504 | 3,905 | -69% | 1 | 1 | 0% | 1,999 | 3,826 | +91% | 0 | 0 | — |
case-12 | pass→pass | 9,895 | 3,189 | -68% | 1 | 1 | 0% | 1,643 | 3,557 | +116% | 0 | 0 | — |
case-13 | fail→pass | 11,018 | 6,491 | -41% | 1 | 1 | 0% | 1,810 | 4,202 | +132% | 0 | 0 | — |
case-14 | fail→pass | 12,422 | 4,019 | -68% | 1 | 1 | 0% | 1,937 | 3,666 | +89% | 0 | 0 | — |
case-15 | pass→pass | 8,784 | 3,519 | -60% | 1 | 1 | 0% | 1,618 | 3,465 | +114% | 0 | 0 | — |
case-16 | fail→pass | 8,810 | 3,766 | -57% | 1 | 1 | 0% | 1,499 | 3,756 | +151% | 0 | 0 | — |
case-17 | pass→pass | 10,940 | 3,288 | -70% | 1 | 1 | 0% | 1,651 | 3,547 | +115% | 0 | 0 | — |
case-18 | fail→pass | 13,768 | 1,707 | -88% | 1 | 1 | 0% | 2,516 | 3,337 | +33% | 0 | 0 | — |
case-19 | fail→pass | 12,882 | 1,382 | -89% | 1 | 1 | 0% | 2,080 | 3,289 | +58% | 0 | 0 | — |
case-20 | fail→pass | 10,897 | 6,976 | -36% | 1 | 1 | 0% | 1,991 | 4,415 | +122% | 0 | 0 | — |
case-21 | pass→pass | 8,737 | 6,667 | -24% | 1 | 1 | 0% | 1,518 | 4,192 | +176% | 0 | 0 | — |
case-22 | pass→pass | 10,201 | 4,320 | -58% | 1 | 1 | 0% | 1,532 | 3,960 | +158% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +68 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.