Explainers
What Is Outpainting? Extending an Image Past Its Edges
Outpainting invents new content beyond the original frame. How it differs from inpainting, why the seam is the hard part, and where it falls apart.
By Mohit P · · Updated · 7 min read
Outpainting makes new image content past the edges of a picture you already have: a portrait crop becomes a full scene, a square photo widens into a banner, sky appears above a mountain the lens cut off. The pixels you started with never change. Everything new sits outside the original frame.
It is the mirror image of inpainting, which redraws a patch inside a photo. Mechanically the two jobs are almost the same, but they behave very differently, because a model working inside a photo is surrounded by evidence and a model working outside one is not.
That difference explains why the join between old and new is the hard part, why the picture drifts the further you push it, and why outpainting cannot bring back what a camera never captured.
It is a masked generation with the mask outside the photo
Outpainting uses the same model and algorithm as inpainting. The app grows the canvas to the size you asked for. It marks the new empty area as the region to fill. Then it runs the same fill-in loop as always: clear away a little noise, lock the known pixels back into place, repeat. (The region to fill is called the mask, each pass is a denoising step, and the whole thing is a masked diffusion loop.) The only change is where the mask sits.
The mask machinery is the same here, and our inpainting explainer walks through it. The rest of this post covers only what changes when the mask moves outside the original photo.
Why the edge is the hard part
At the border of an outpainted region, the model has something to go on from one side and nothing from the other. Inpainting is different. There, real pixels ring the hole on all four sides. They pin down the horizon, the light direction, the texture, and the perspective. Outpainting gets a single edge and open space beyond it.
One edge is a weaker guide than it sounds. A horizon coming in from the left should leave the seam at the same height and the same angle. If it does not, nothing corrects it. There is no evidence on the right to disagree. The same goes for a wall that should stay flat, a shadow that should keep falling one way, a course of bricks that should stay level. Inpainting would catch those errors between its two anchors. Here they spread outward.
Instead of an obvious cut, you see a continuation that is subtly wrong. The sky is a different blue. The pavement drifts out of plane. The depth of field resets. Softening the boundary, a step called feathering, hides a mismatch a few pixels wide. It does nothing about geometry that leaves the seam on the wrong trajectory.
Why long extensions drift
After the first pass, every new strip is built from invented pixels rather than photographed ones. So errors compound. Step one sits beside your real photo. Step two sits beside step one. By step four the model is faithfully continuing a scene with little left to do with the image you started from. Each step looks plausible on its own, but the sequence has wandered.
Nothing pulls the chain back toward the original. The color balance creeps. The style loosens. Content shows up that nothing you supplied implied. Wide panoramas built this way often end up as two or three distinct visual worlds. Each one blends fine with its neighbor and badly with the picture at the far end.
Technique: small steps, and say what is out there
Two habits do most of the work: extend in modest steps instead of one large jump, and use your prompt to describe what should exist beyond the frame.
- Increments beat leaps. Add a small band of new canvas at a time. That keeps plenty of settled image (the photo plus whatever earlier steps already invented) next to the piece being invented now, so each generation stays on a leash. One enormous extension is text-to-image with a stripe of reference down one side. The trade is that more steps means more compounding, so extend as far as you need and stop.
- Describe the whole scene. The model cannot see what is out of frame, so tell it: “continues into open desert, low afternoon sun from the left, empty horizon.” Naming the light and the horizon costs nothing, and it removes the most common failures. Say what should not be there in your main prompt (the positive prompt), because turbo models ignore negative prompts.
- Fix the seam separately. Sometimes a boundary is close but not right. Inpainting a band straddling it usually beats regenerating the whole extension, because on that band the model finally has evidence on both sides.
- Retry before you re-plan. A second draw often lands a continuation the first one missed. After that, a light pass of img2img across the joined result can pull the two halves into one color and one grain.
It invents; it does not uncrop
Outpainting cannot reveal what was outside the frame. That information was never recorded. It gives you a plausible guess. This is the most common misunderstanding about it. It bites hardest in exactly the cases where people reach for it: a photo cropped too tight, a screenshot missing its edges, a picture where you want to know what was beside the subject.
The model draws on what usually accompanies scenes like yours. Say a friend stood just out of frame. Outpainting will not produce that friend. It will produce empty wall, or someone else entirely. Treat outpainted pixels as illustration rather than evidence. And be careful about extending photos of real people or places in ways a viewer could mistake for the original shot. The result looks photographic, which is what makes the invention easy to miss.
Where this stands in Onhand
Onhand does not offer outpainting. Its editing tools include photo-to-photo editing, Refine, and masked inpainting with Turbo. Generation runs locally through the engine used by the selected model. A larger aspect ratio for a new image does not extend an existing photograph.
If you extend an image elsewhere, you can import the result and use Turbo inpainting to attempt a small seam repair. This is a new edit, so save the original and inspect both the join and the surrounding detail.
For repainting a region inside the frame, see AI inpainting on iPhone. If you need outpainting itself, Onhand vs Draw Things covers an app that offers outpainting and an infinite canvas.
Sources
Primary sources for the claims above, so you can check them rather than take our word for it.
- Lugmayr et al., RePaint: Inpainting using Denoising Diffusion Probabilistic Models (2022). The re-anchoring loop that lets an unmodified diffusion model fill a mask consistently with its surroundings, which is the mechanism outpainting reuses.
- Bar-Tal et al., MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation (2023). Tackles panorama drift by fusing overlapping generations instead of extending one step at a time.
- Rombach et al., High-Resolution Image Synthesis with Latent Diffusion Models (2022). The latent diffusion architecture behind the Stable Diffusion family, including masked generation.