Generative AI Extend

Extend

Extend, often called “outpainting” on other platforms, enables users to expand content beyond the borders of a previously generated image using text prompts and numerical values, filling in new areas based on the context of the original image. This is a powerful tool to create assets with unique aspect ratios, such as advertising or social media uses.

Extend involves adding content to one or more sides of an image by specifying a percentage by which you want the image expanded. This means that the aspect ratio of the generated images will differ from the original unless the same value is specified for all four sides. Additionally, the pixel dimensions on the longest side will remain the same - 612px for the images provided in this endpoint’s response, 1024px and 4096px on the images retrieved through the download process.

Use of this endpoint is restricted to clients with an AI Generation license product and may result in the deduction of a credit depending on the terms of your license.

Refer to Swagger for full technical documentation of the extend endpoint

Example 1

In this example, we’re going to expand a headshot to become more of a three-quarter-length image.

Initial image generation parameters:
{ 
  "prompt": "film noir portrait, Hollywood actor, male movie star, studio, black and white",
  "negative_prompt": "color, outside, modern"
} 
Generated Image:

AI Gen Extend - Original Image - Actor

Extend parameters:
{ 
  "left_percentage": 50, 
  "right_percentage": 50, 
  "top_percentage": 15, 
  "bottom_percentage": 100 
} 
Extended Image:

AI Gen Extend - Extended Image - Actor

Example 2

In this example, we’re going to expand our initial image to show more of the environment.

Initial image generation parameters:
{ 
  "prompt": "cinematic film still man and woman neo-tokyo at night cyberpunk movie, dystopian cityscape artificial lighting, rain-soaked, neon-lit futuristic architecture, holographic, smoky, fashion, dark and moody colors, reflective, decay, cybernetics, shallow DOF, vignette, bokeh, cinemascope, moody, epic, film grain, grainy",
  "negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, bright, cheerful"
} 
Generated Image:

AI Gen Extend - Original Image - Cinematic

Extend parameters:
{ 
  "prompt": "gritty urban background", 
  "left_percentage": 100, 
  "right_percentage": 100, 
  "top_percentage": 15, 
  "bottom_percentage": 200 
} 
Extended Image:

AI Gen Extend - Extended Image - Cinematic