$npx -y skills add prime-skills/runcomfy-agent-skills --skill image-inpaintingMask-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
| 1 | # Image Inpainting |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | [runcomfy.com](https://www.runcomfy.com/?utm_source=skills.sh&utm_medium=skill&utm_campaign=image-inpainting) · [Z-Image Inpainting](https://www.runcomfy.com/models/tongyi-mai/z-image/turbo/inpainting?utm_source=skills.sh&utm_medium=skill&utm_campaign=image-inpainting) · [CLI docs](https://docs.runcomfy.com/cli/introduction?utm_source=skills.sh&utm_medium=skill&utm_campaign=image-inpainting) |
| 6 | |
| 7 | ## Powered by the RunComfy CLI |
| 8 | |
| 9 | ```bash |
| 10 | # 1. Install (see runcomfy-cli skill for details) |
| 11 | npm i -g @runcomfy/cli # or: npx -y @runcomfy/cli --version |
| 12 | |
| 13 | # 2. Sign in |
| 14 | runcomfy login # or in CI: export RUNCOMFY_TOKEN=<token> |
| 15 | |
| 16 | # 3. Inpaint |
| 17 | runcomfy run tongyi-mai/z-image/turbo/inpainting \ |
| 18 | --input '{"image": "...", "mask_image": "...", "prompt": "..."}' \ |
| 19 | --output-dir ./out |
| 20 | ``` |
| 21 | |
| 22 | CLI deep dive: [`runcomfy-cli`](https://www.skills.sh/agentspace-so/runcomfy-agent-skills/runcomfy-cli) skill. |
| 23 | |
| 24 | --- |
| 25 | |
| 26 | ## Pick the right model |
| 27 | |
| 28 | Listed by precision of region targeting (mask-required first, then description-based). |
| 29 | |
| 30 | **Z-Image Turbo Inpainting** — `tongyi-mai/z-image/turbo/inpainting` *(default — mask required)* |
| 31 | > Dedicated inpainting endpoint with mask, strength, and control-scale. Open-weights, sub-second to a few seconds. |
| 32 | > Pick for: precise region edits with a binary mask — object removal, watermark cleanup, full-region replacement. |
| 33 | > Avoid for: edits without a mask — use Nano Banana 2 Edit (description-based). |
| 34 | |
| 35 | **Z-Image Turbo Inpainting LoRA** — [`tongyi-mai/z-image/turbo/inpainting/lora`](https://www.runcomfy.com/models/tongyi-mai/z-image/turbo/inpainting/lora?utm_source=skills.sh&utm_medium=skill&utm_campaign=image-inpainting) |
| 36 | > Inpainting endpoint with LoRA adapter support — apply a fine-tuned style during inpainting. |
| 37 | > Pick for: brand-style-locked inpainting (LoRA captures the look, mask defines the region). |
| 38 | > Avoid for: generic inpainting — use the base inpainting endpoint. |
| 39 | |
| 40 | **Nano Banana 2 Edit** — `google/nano-banana-2/edit` *(description-based fallback)* |
| 41 | > Identity-preserving edit driven by spatial language ("the watermark in the bottom-right", "the cables overhead"). No mask required. |
| 42 | > Pick for: when no mask is available and the region can be described. |
| 43 | > Avoid for: precise pixel-level region edges — use Z-Image Inpainting. |
| 44 | |
| 45 | **GPT Image 2 Edit** — `openai/gpt-image-2/edit` |
| 46 | > Multi-ref edit with layout-precise instructions; honors "remove only the X" directives. |
| 47 | > Pick for: complex prompt + reference composition where the masked region needs context from other images. |
| 48 | > Avoid for: simple single-image mask-driven jobs — use Z-Image Inpainting. |
| 49 | |
| 50 | **FLUX Kontext Pro** — `blackforestlabs/flux-1-kontext/pro/edit` |
| 51 | > Single-instruction local edit with maximum preservation of everything else. |
| 52 | > Pick for: "keep everything except X" style local edits without a mask. |
| 53 | > Avoid for: explicit mask-driven workflows — use Z-Image Inpainting. |
| 54 | |
| 55 | --- |
| 56 | |
| 57 | ## Route 1: Z-Image Turbo Inpainting — default |
| 58 | |
| 59 | **Model**: `tongyi-mai/z-image/turbo/inpainting` |
| 60 | **Catalog**: [Z-Image inpainting](https://www.runcomfy.com/models/tongyi-mai/z-image/turbo/inpainting?utm_source=skills.sh&utm_medium=skill&utm_campaign=image-inpainting) |
| 61 | |
| 62 | ### Schema |
| 63 | |
| 64 | | Field | Type | Required | Notes | |
| 65 | |---|---|---|---| |
| 66 | | `prompt` | string | yes | What fills the masked region; describe preservation constraints for the surround | |
| 67 | | `image` | string | yes | Source image URL | |
| 68 | | `mask_image` | string | yes | **Grayscale mask URL** (white = inpaint, black = preserve) | |
| 69 | | `strength` | float | no | 0.3–0.6 for retouching, 0.7–1.0 for full replacement | |
| 70 | | `control_scale` | float | no | 0.6–0.9 typical | |
| 71 | | `aspect_ratio` | enum | no | W:H output ratio | |
| 72 | | `seed` | int | no | Reproducibility | |
| 73 | |
| 74 | ### Invoke |
| 75 | |
| 76 | **Object removal (low strength):** |
| 77 | |
| 78 | ```bash |
| 79 | runcomfy run tongy |