Loading...
Loading...
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 area. Triggers on "inpaint", "inpainting", "image inpaint", "remove from image", "fill region", "mask-driven edit", "remove watermark", "remove object", "patch the photo", "fill the hole", or any explicit ask to edit a specific masked region of a still.
npx skill4agent add agentspace-so/runcomfy-agent-skills image-inpaintingruncomfy# 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 ./outruncomfy-clitongyi-mai/z-image/turbo/inpaintingDedicated 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).
tongyi-mai/z-image/turbo/inpainting/loraInpainting 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.
google/nano-banana-2/editIdentity-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.
openai/gpt-image-2/editMulti-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.
blackforestlabs/flux-1-kontext/pro/editSingle-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.
tongyi-mai/z-image/turbo/inpainting| Field | Type | Required | Notes |
|---|---|---|---|
| string | yes | What fills the masked region; describe preservation constraints for the surround |
| string | yes | Source image URL |
| string | yes | Grayscale mask URL (white = inpaint, black = preserve) |
| float | no | 0.3–0.6 for retouching, 0.7–1.0 for full replacement |
| float | no | 0.6–0.9 typical |
| enum | no | W:H output ratio |
| int | no | Reproducibility |
runcomfy 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 ./outruncomfy 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 ./out0.3–0.50.6–0.70.8–1.0"preserve rooflines and sky gradient""match brick pattern and mortar tone""the left shelf""upper-right quadrant"runcomfy 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 ./outimage-editstrength: 0.9strength: 0.8/trainerimage-editimage-outpaintingvideo-inpainting| 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 |
runcomfy run--output-dirnpm i -g @runcomfy/clinpx -y @runcomfy/cliruncomfy login~/.config/runcomfy/token.jsonRUNCOMFY_TOKEN--inputmodel-api.runcomfy.net*.runcomfy.net*.runcomfy.comBash(runcomfy *)runcomfy-cliimage-editimage-outpaintingai-image-generationvideo-inpainting