image-inpaint-region
Skill210 starsChanged 2 days agoMITView on GitHub
Local circular region inpainting with LaMa (IOPaint). Uses IOPaint default InpaintRequest and mask handling. Use for local region inpaint / local region repair / inpaint when circle center and radius cx,cy,r are known.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- godot-fun/gaiword for word, first seen Nov 15, 2026
Other versions1 project uses a version of this.
Word for word · 1
- godot-fun/gai★ 210100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/AGENTS.mdAGENTS.md
- ai-text-to-speechSkill
- audio-denoiseSkill
- audio-fadeSkill
- audio-loudness-normalizationSkill
- audio-sample-rate-standardizeSkill
- audio-splitSkill
- audio-to-oggSkill
- audio-to-textSkill
- audio-to-wavSkill
- audio-trimSkill
- audio-volume-adjustSkill
- file-naming-normalizationSkill
- git-commit-messageSkill
- image-region-remove-key-color-appSkill
- image-remove-backgroundSkill
- image-remove-white-backgroundSkill
- image-resizeSkill
- image-sprite-sheet-splitSkill
- image-to-pngSkill
- image-to-textSkill
- image-trimSkill
- storyboard-av-mixSkill
- storyboard-shot-to-htmlSkill
- storyboardSkill
- storyboard-ttsSkill
- video-4k-normalizationSkill
- video-bgmSkill
- video-compress-to-sizeSkill
- video-cutSkill
- video-merge-gpuSkill
- video-mergeSkill
- video-publishSkill
- video-remove-audioSkill
- video-to-4kSkill
- video-to-60fpsSkill
- video-to-mp4Skill
- video-to-ogvSkill
- video-to-wavSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.
- Very specific: line 19
Run inpaint.py through the iopaint manifest entry (.dependency/iopaint/.venv/).
- Distinctive: line 20
Do not hand-write equivalent inpaint commands — use the bundled script.
- Very specific: line 22
Require region first: If --region cx,cy,r is missing, inspect the image (or ask the user) before running.
- Very specific: line 77
Call ModelManager with InpaintRequest() defaults.
- Very specific: line 78
Write PNG via pil_to_bytes(..., "png", 100, ...).
- Distinctive: line 117
Use the bundled script, not hand-written IOPaint CLI with separate mask files unless the user already has a mask image.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Image Inpaint Region (LaMa)
Local circular region inpainting with IOPaint LaMa. Builds a circular mask from --region cx,cy,r, then runs the same inference path as iopaint run / the IOPaint API.
Both --image and --region cx,cy,r are required.
Rules
When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.
- Run
inpaint.pythrough theiopaintmanifest entry (.dependency/iopaint/.venv/). Never use hostpython,py,python3, or any interpreter outside.dependency/. - Do not hand-write equivalent inpaint commands — use the bundled script.
- Single file only. Pass one image with
--image; directories are not supported. - Require region first. If
--region cx,cy,ris missing, inspect the image (or ask the user) before running. - Use IOPaint defaults for inference config unless the user explicitly asks otherwise — do not invent custom mask blur, compositing, or hd_strategy overrides in the script.
- Pass the input path as-is. Output goes to
<image-dir>/image-inpaint-region/by default — no path rewriting. - Never overwrite source files. Output lands in
image-inpaint-region/or--output.
Setup (first run)
IOPaint needs Python 3.11 and PyTorch. From project root:
.dependency/python-3.11/python.exe -m venv .dependency/iopaint/.venv
.dependency/iopaint/.venv/Scripts/python.exe -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
.dependency/iopaint/.venv/Scripts/python.exe -m pip install iopaintCPU-only: skip the CUDA torch line and pip install iopaint (pulls CPU torch). Use bin/python on Unix.
Register in .dependency/manifest.json:
"iopaint": {
"populated": true,
"bin": ".dependency/iopaint/.venv/Scripts/python.exe"
}LaMa weights (big-lama.pt) download on first run.
Quick Start
Both --image and --region are required:
# image/foo.png → image/image-inpaint-region/foo.png
# center (148, 248), radius 48
.dependency/iopaint/.venv/Scripts/python.exe .ai/image-inpaint-region/inpaint.py --image image/foo.png --region 148,248,48GPU inference:
.dependency/iopaint/.venv/Scripts/python.exe .ai/image-inpaint-region/inpaint.py --image image/foo.png --region 148,248,48 --device cudaCustom output path:
.dependency/iopaint/.venv/Scripts/python.exe .ai/image-inpaint-region/inpaint.py --image image/foo.png --region 148,248,48 -o image/foo_inpaintedHow it works
- Open the image as RGB (same as
iopaintbatch processing). - Draw a filled circle mask from
--region cx,cy,r. - Binarize mask at 127 (same as
iopaint.batch_processing/ API). - Call
ModelManagerwithInpaintRequest()defaults. - Write PNG via
pil_to_bytes(..., "png", 100, ...).
IOPaint defaults used
These come from InpaintRequest() and iopaint run — the script does not override them:
| Setting | Default | Notes |
--model | lama | Same as iopaint run |
--device | cpu | Same as iopaint run / start; use --device cuda when GPU is available |
hd_strategy | Crop | LaMa erase-model preprocessing |
hd_strategy_crop_trigger_size | 800 | Crop when long side > 800 px |
hd_strategy_crop_margin | 128 | Margin around mask for crop strategy |
| Mask threshold | 127 | >= 127 → 255, else 0 |
The skill only adds --region cx,cy,r so you do not need a separate mask file.
Options
| Option | Default | Notes |
--image | Required | Single supported image file |
--region | Required | cx,cy,r — center x, center y, radius in pixels |
| Output | <image-dir>/image-inpaint-region/<name>.png | Use -o / --output for custom file or directory |
--model | lama | IOPaint model name |
--device | cpu | cpu or cuda (falls back via IOPaint check_device) |
Supported inputs: .png, .jpg, .jpeg, .webp, .gif, .bmp, .tif, .tiff, .avif, .ico.
Agent Workflow
- Confirm source — user path only; do not copy into
image/or use chat attachment cache. - Confirm region — inspect the image and determine circle center
(cx, cy)and radiusrbefore running. - One file per run — process one image, verify the result, then repeat for additional files if needed.
- Inspect — check the inpainted area; leftover content → larger
r; nearby art eaten → smallerror move center. - Revert — delete the output file or
git restore; sources are never modified.
Agent Notes
- Use the bundled script, not hand-written IOPaint CLI with separate mask files unless the user already has a mask image.
- Missing iopaint venv → populate
.dependency/per dependency-manager, retry same command. - Do not copy, move, or replace the source with inpainted output — tell the user where the output file is.
- For full IOPaint UI / brush mask editing, use the upstream
iopaint startworkflow instead.
Troubleshooting
| Issue | Fix |
iopaint missing / not populated | Follow Setup; update manifest |
Missing --region | Inspect image; both --image and --region cx,cy,r are required |
Invalid --region | Must be three numbers: center x, center y, radius (> 0) |
Directory passed to --image | Run once per file; this skill accepts image files only |
| Output already exists | Delete the existing output or choose a different -o path |
| CUDA not available | IOPaint falls back to cpu via check_device |
| Target still visible | Increase radius r in --region |
| Nearby art eaten | Decrease radius r; adjust center (cx, cy) |
| Wrong interpreter | Must use .dependency/iopaint/.venv/Scripts/python.exe |
CLI
Copy-paste commands: cli/image-inpaint-region.md
Related
- Engine: Sanster/IOPaint (LaMa)
- Upstream batch CLI:
iopaint run --model lama --device cpu --image ... --mask ... --output ...
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

