Remove a small object
You give it a still and a box around the object; you get the still with the object
gone and every pixel outside a small feathered circle unchanged (a badge removal
changed about 9k px). A whole-frame edit for the same removal comes back 0.5–1% zoomed
with every pixel nudged (PSNR ~23–26 dB against the approved still), and a still that
video is pinned to must not move. This leaf runs on python-crop-and-paste-back; load
it for the script.
Inputs
- The still, at 2K (2752×1536) when you have the edit's original; otherwise the 1080p.
- A square box of about 256 px (at 2K) centred on the object.
- What the object sits on, for the prompt ("the knit of her sweater").
Run it
-
Crop and enlarge 4×, in the still's own pixels:
exec python crop_paste.py crop --image <still> --no-conform --box 1180,940,1436,1196 --scale 4 --out <job>/refs/shot12_pin_crop.png -
Edit, two or three takes, one call each (call
describefirst in a job):run(model="fal/google/nano-banana-2.1/edit", input={"prompt": <the removal prompt>, "image_urls": ["<job>/refs/shot12_pin_crop.png"], "aspect_ratio": "1:1", "resolution": "2K", "num_images": 1, "seed": 1000, "output_format": "png", "safety_tolerance": "5", "thinking_level": "high"}, into="<job>/refs", unit="shot12_pin_edit") -
Paste back a feathered circle:
exec python crop_paste.py paste --image <still> --no-conform --box 1180,940,1436,1196 --edit <job>/refs/shot12_pin_edit_a.png --mask circle --out <job>/stills/shot12_c.png -
Conform to 1920×1080 with
python-conform-to-1080p.
If the removal was already made as a whole-frame edit, keep it only inside a box instead:
exec python crop_paste.py patch-box --original <approved still> --edited <full-frame edit> --box x0,y0,x1,y1 --out <patched> (aligns the edit first, 12 px feather).
Prompt
Short, and about the surface that continues. The proven edit asked for little more than "remove it, continue the knit"; spelled out:
This is an enlarged close crop of a still from a live-action film. Remove the small enamel pin on her sweater and continue the knit through where it was: the same stitch, colour, folds, light and fine grain as the knit around it. Change nothing else. Same framing and crop.
Do this too
- Edit the character's reference pictures the same way (sheet views, any image the video model gets). If a reference still has the badge, the video model puts it back.
- Never name the object in the video prompt. With "no pin or badge" in the scene, H3 Max grew a small dark pin within 1 s. Describe the clean surface instead: "a plain, unadorned knit, the same from the first frame to the last" rendered clean on 2 seeds.
- A still that video is already pinned to means every clip pinned to it renders again after the edit. Make removals before animating.
Check it
paste prints changed_px: a few thousand to ~10k for a badge. Look at the patch at
100% for a seam or a change in grain. After animating, check every 0.75 s of every clip
by eye for the object coming back: a colour scan misses a pin of another colour.
How removals fit with the other small-detail fixes: guide-keep-small-details.


