Re-render small print in an enlarged crop
You give it a still, a square box around the prop, the product photo and a sentence on
what the print must look like; you get four patched stills where only the print's
pixels changed. A whole-frame edit at 1080p garbles lettering, and a second whole-frame
pass (or a 4K render scaled down) smooths the grain and redraws background faces.
Here the prop fills the model's image, so the lettering comes out right, and nothing
else in the frame is touched. This leaf runs on python-crop-and-paste-back; load it
for the script.
Inputs
- The still, conformed to 1920×1080 (the script does it).
- A square box around the prop at 1080p (find it on a gridded crop), e.g.
790,320,990,520. - The product photo, for the design. Turn it to face the way the prop faces.
design: what the print must look like, against the product photo: "near the top the white logo reads ACME over CO., in the same letter weights and spacing as image 2; centred on the side facing the camera, following its tilt".- For a shot with pinned first and last frames: the other pinned frame and the prop's centre in it, for the match reference.
Run it
-
Crop and enlarge 6×:
exec python crop_paste.py crop --image <still> --box 790,320,990,520 --scale 6 --out <job>/refs/shot09_last_crop.png. -
Optional match reference, on a pinned pair:
exec python crop_paste.py match-cut --image <still> --box 790,320,990,520 --other <the other pinned frame> --center 885,410 --out <job>/refs/shot09_last_match.png. It cuts the prop at the same scale as your crop (the box scaled by the zoom between the frames, measured). -
Re-render, four takes, one call each, seeds 9100 to 9103 (call
describefirst in a job):run(model="fal/fal-ai/nano-banana-pro/edit", input={"prompt": <the region prompt>, "image_urls": ["<job>/refs/shot09_last_crop.png", "<job>/references/product.jpg", "<job>/refs/shot09_last_match.png"], "aspect_ratio": "1:1", "resolution": "2K", "num_images": 1, "seed": 9100, "output_format": "png", "safety_tolerance": "5"}, into="<job>/refs", unit="regionedit") -
Paste back each take's changed pixels:
exec python crop_paste.py paste --image <still> --box 790,320,990,520 --edit <job>/refs/regionedit_a.png --out <job>/stills/shot09_last_q.png.
Prompt
Image 1 is an enlarged close crop of a frame from a live-action commercial.
Image 2 is a product photo of {prop}, for its design only.
[Image 3 is the same prop in the same shot a moment earlier, cropped at the same scale as image 1, so the print must come out the same size in pixels. The print must sit in exactly the same place on the prop as in image 3: the same distance from {print_landmarks}, the same size, width and letter proportions. Only the prop's angle may differ; the print must not slide around it.]
Re-render ONLY {prop} in image 1 so its printed design matches image 2 exactly: {design}
Keep its position, angle, size, silhouette, color and lighting exactly as in image 1, including any backlight and rim light. Keep hands, fingers, faces, hair and everything else in image 1 pixel-identical. Match image 1's softness and fine film grain on the print: never studio-sharp. Ignore the studio lighting of image 2. Same framing and crop as image 1.
print_landmarks: the edges the print's placement is measured from, "the prop's left
edge and from its lid" (default "the prop's left edge and from its top"). Include the
bracketed line only with a match reference.
Pinned first and last frames
Fix the print on the last frame after it is cropped to the source's push-in
(python-match-push-in), with the match reference cut from the locked first frame. A
match reference at a different scale makes the logo come out a different width, and it
slides across the prop mid-clip. If the two logos still differ, run it the other way:
re-render the first frame's print to match the better last one. Either direction works.
Tips and traps
- Keep the box square: the edit is asked for at 1:1.
- Never warp the product photo onto the prop yourself; let the model render it in the crop.
- Condition the references before they go in (colour, size, orientation):
guide-keep-small-details.
Check it
paste prints changed_px: it should cover the print, not the whole box. Put the
patched takes on a review page with the original still; zoom on the print, then judge
it at playback size. On a pinned pair, flip first and last: the print keeps its width
and place on the prop.


