For the complete documentation index, see llms.txt. This page is also available as Markdown.

Inpainting and outpainting (uncrop)

Inpainting

Inpainting is a technique used in image processing to fill in missing or damaged parts of an image in a way that blends seamlessly with the surrounding areas. This process can reconstruct removed elements or extend the background of an image while preserving the visual coherence of textures, colors, and patterns.

Inpainting is a part of background generation parameters

Parameter
Description

adapter_type

inpainting

ip_image2

url to mask image

Let's check the example. There is a generated image with some hand issues:

Quickly created mask:

And the result:

Outpainting (uncrop)

Outpainting, or "uncropping," is a technique used to expand an image beyond its original borders by generating new visual content that seamlessly extends the existing scene. Unlike inpainting, which fills in missing areas within an image, outpainting creatively imagines what might lie beyond the current frame, effectively "uncropping" it to add context or detail.

Let's make a horizontal image of the vertical one.

And the result:

Prompt or image description is generated by default so for this particular example is: "there is a boat that is sitting on the sand near a building".

Additional outpainting parameters:

Parameter
Description

background.generate.model_type

Controls the outpainting model. Supported values are qwen and qwen-no-blending. The default is qwen. qwen-no-blending works like qwen, but it does not blend the original image over the generated result.

placement

Controls where the source image is placed on the destination canvas before outpainting starts.

placement.coordinates

X and Y coordinates of the placed source image on the destination canvas.

placement.width

Width of the placed source image area.

placement.height

Height of the placed source image area.

placement.rotation

Rotation of the placed source image.

placement.fit

Controls whether the source image is fitted to the placement box.

We can use our prompt as well:

And the result:

generative_upscale applies diffusion-based upscaling to the final image. It can improve detail, but it can also slightly change the original source image. Keep it false when you want to preserve the source area more closely.

We can also place the source image manually and select the outpainting model:

Let's see an example. It's generative upscaled with blending of original image:

And the result:

Last updated