Skip to main content

Outpainting

For flux

Outpainting only

Input

outpainting for VTON

Outpainting only - no txt2img

Outpainting VTON result

txt2img + Outpainting

Txt2img only 1:1 (1024x1024)

outpainting for VTON

txt2img + outpaint to 9:16

Outpainting with txt2img result

txt2img + outpaint 16:9

outpainting for VTON

txt2img + outpaint 16:9

Outpainting with txt2img result

See outpaint examples in the gallery

Overview

Outpainting is a technique used to extend an image to bring in more context and background into the initally generated subject of the image. Examples for usage could be taking a 1:1 aspect-ratio (1024x1024) and extending it into a 16:9 cinematic view, or taking a waist up portrait 1:1 and extending it into a full body portrait 9:16. One of the advantages of this is better preservation of the face identity, as well as the ability of the model on focusing on the background generation due to it being separated into a separate task.

See pricing for the cost of this feature.

Usage

Below are the arguments that should be added at the end of the prompt text to enable outpainting:

  1. --outpaint - The anchor for outpainting. Options: top-left, top-right, bottom-left, bottom-right, center, top-center, bottom-center, left-center, right-center
  2. --outpaint_height
  3. --outpaint_width
  4. --outpaint_prompt - Optional

In case you're interested in setting an input image and doing only outpainting, and skipping the txt2img/img2img step, make sure to set denoising_strength: 0

Examples

Outpaint only

--outpaint top-center --outpaint_width 864 --outpaint_height 1296
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si
mask_image_url=
denoising_strength=0
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=true
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=0
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=true
w=576
h=864

txt2img + outpainting

<lora:1533312:1.0> ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=false
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=0
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=false
w=1024
h=1024

txt2img + multi-person outpainting

<lora:1533312:1.0> ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint left-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "president Trump the middle of the field"
num_images=1
negative_prompt=
seed=
steps=
cfg_scale=
controlnet=
input_image_url=
mask_image_url=
denoising_strength=
controlnet_conditioning_scale=
controlnet_txt2img=false
super_resolution=false
inpaint_faces=false
face_correct=false
film_grain=false
face_swap=false
hires_fix=false
backend_version=0
ar=1:1
scheduler=euler_a
color_grading=
use_lpw=false
w=1024
h=1024

API Usage

POST /tunes/1504944/prompts

# Note the hard-coded 1504944 which is the tune_id of Flux1.dev from the gallery
# Outpaint only example
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \
-F prompt[text]="--outpaint top-center --outpaint_width 864 --outpaint_height 1296" \
-F prompt[denoising_strength]=0 \
-F prompt[input_image_url]="https://sdbooth2-production.s3.amazonaws.com/qg202t8sqfn1olewuzdujgaq29si" \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"

# txt2img + outpainting example
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/tunes/1504944/prompts \
-F prompt[text]='<lora:1533312:1.0> ohwx woman, dressed in cozy peach sweater, shoulders up, depth of field --outpaint top-center --outpaint_width 1792 --outpaint_height 1024 --outpaint_prompt "fields"' \
-F prompt[w]=1024 \
-F prompt[h]=1024 \
-F prompt[callback]="https://optional-callback-url.com/to-your-service-when-ready?prompt_id=1"