DEV Community

AI-KSK
AI-KSK

Posted on Edited on Originally published at huggingface.co

Local Redraw at High Resolution: Crop, Regenerate, Paste Back Seamlessly

Editing a small region of a large image is a resolution problem: the model works best at around a megapixel, and the region you want to change is a fraction of that. The crop-regenerate-paste-back pattern solves it, and the hard part is the seam.

The pattern

  1. Locate the region to change
  2. Crop it out at a resolution the model handles well
  3. Regenerate the crop with a reference and an instruction
  4. Paste back with a feathered blend
  5. Verify the seam at 1:1

Each step has a failure mode, and the failures compound.

Why crop rather than edit in place

A Qwen-class edit model at 928×1664 handles an image where the subject occupies most of the frame. If your source is 4K and the region you want to change is a hand, editing in place means the model sees a hand at maybe 200 pixels — too small to resolve, so it invents something.

Cropping makes the hand the subject. The model now has enough pixels for the task.

The cost is that the model loses context. A cropped hand does not know what lighting surrounds it unless you supply that context, which is why the reference matters.

The seam is the whole problem

Paste-back is where this pattern lives or dies. Three things matter:

Feather width. A hard paste gives a visible rectangle. A very wide feather gives a blur. The right width depends on how well the regenerate matched the surroundings.

Colour match. The regenerated region has its own colour distribution. If it is slightly warmer or cooler than the surroundings, the seam shows as a tint, not as an edge.

Grain and texture continuity. Real images have noise. A regenerated region may be cleaner or noisier than its surroundings, and that mismatch is visible at 1:1 even when colour and edge are right.

Of the three, colour is the easiest to fix (a match pass) and grain the hardest (needs a grain layer).

Choosing the crop size

The crop should be:

  • Large enough that the model sees the region as a subject
  • Small enough that the surrounding context fits in the model's window
  • Aligned to something in the image, so the paste boundary is not arbitrary

A crop that cuts through a face is worse than one that cuts through a wall. If you can choose the boundary, choose a low-detail area.

Verification

Look at the seam at 1:1, not at fit-to-screen. Then look at it again after any upscale — upscaling doubles the visibility of a seam.

If the result is going to be delivered at 4K, verify the seam at 4K.

Where this breaks

  1. Context loss. The crop does not know the surrounding light unless you tell it.
  2. Seam at high detail boundaries. Cropping through a face or through text is a bad choice.
  3. Colour drift between regenerate and surroundings.
  4. Grain mismatch — the hardest to fix.
  5. Iteration cost. Each attempt is a crop, a render, a paste, and a check.

Practical approach

Do one region at a time. Verify each at 1:1 before moving to the next. A pipeline of five regions with unverified seams is five problems you will find at the end.

Workflows

Two graphs, published on RunningHub with invite code rh-v1111:

  • Qwen 2511 local redraw: reference-edited content transfer
  • Qwen 2511 local redraw: mask crop, regenerate, paste back

Files

https://huggingface.co/AI-KSK/ksk-video-170-comfyui-workflows

Notes

  • Workflow files only. Model weights are not included; each keeps its own licence.
  • Tutorial exports, not a product.
  • Independent AI-KSK release. Not affiliated with the model authors or RunningHub.

Optional API platform - 88API (affiliate link)

Explore 88API for access to multiple AI model APIs. Available models, routes and prices are listed on the platform; Alipay top-ups are supported.

https://88api.ai/sign-up?aff=usx3

Disclosure: I may earn a commission from eligible purchases after you register through this referral link.

Top comments (0)