Image Expander API

popnow/image-expander-v1/editFrom 4 credits per image

Widen a photo to a new aspect ratio: new scenery is painted around the original instead of cropping it or stretching it.

Call it with the model name popnow/image-expander-v1/edit on POST /jobs/createTask, from 4 credits per image ($0.04). New accounts get 30 free credits to try it in the Playground first.

  • Expand Image
  • 7 aspect ratios

Introduction

Image Expander grows a photo outward to a new shape. Pick a target aspect ratio and the tool keeps your picture, sets it inside a wider or taller frame and paints new scenery into the empty space, so the result reads as one continuous image. It is the opposite of cropping: nothing in the original is cut away, and nothing is stretched to fill the frame.

Key features

Seven target shapes

The finished image can be square, landscape or portrait: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2 or 2:3. That covers feed posts, video covers, stories, banners and print-style layouts from one source photo, without planning every crop at the shoot.

Continuation instead of padding

The new area is painted to carry on what is already there. Floors, skies, walls, foliage and the direction of the light continue past the old border, instead of the frame being padded with blur, mirrored edges or a flat colour.

No prompt to write

The extension is inferred from the picture itself. One image and one ratio are the whole request, which makes it simple to turn a folder of vertical shots into landscape banners in a single batch.

Request parameters

ParameterRequiredDescription
aspect_ratioNoThe shape of the frame: wide, square or tall. 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · Default: 1:1
image_urlYesThe picture to start from.
output_formatNoFile type of the result. png · jpeg · webp · Default: png

Pricing

Prices are in credits, the same credits you use on the website (1 credit = $0.01). The hold is taken when the task is accepted and settled to the actual charge when it finishes; failed tasks are refunded.

OptionCredits per image≈ USD
Standard3.6$0.036

Each task is rounded up to whole credits, so one run at the lowest tier costs 4 credits per image ($0.04).

For an exact number before you run, send the same body to POST /jobs/quote.

Use cases

One shoot, every format

Turn a vertical product or portrait shot into a 16:9 website header and a 1:1 marketplace tile without reshooting, and without leaving awkward bars down the sides of the frame.

Room for text and layout

Add sky or backdrop around a subject so there is clean space for a headline, a logo or a call to action on a banner, a thumbnail or a presentation slide.

Fixing tight crops

Give breathing room back to photos framed too tightly: a cropped elbow, a chair cut off by the edge, a horizon pressed against the border.

Prompt guide & pro tips

Pick the ratio for the destination

Decide where the image will be used before expanding: 16:9 for video covers and headers, 9:16 for stories and reels, 1:1 for feeds and marketplaces, 3:2 or 2:3 for print-style layouts.

Mind the output size

The expanded image is 1536 pixels on its long edge. A large original therefore comes back smaller than it went in; if the destination needs more pixels, upscale the result afterwards instead of starting from a lower-quality source.

Start from clean edges

The tool continues whatever touches the border of the photo. Simple backgrounds such as sky, studio paper, plaster walls or sand extend most convincingly. When a face, a hand or lettering is cut by the edge, the tool has to invent the missing part, and that is where results are least predictable, so choose a source with more margin around such details.

API quick start

Call the Image Expander API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow- and use the same credits as the website.
  2. Send the request. POST /jobs/createTask with model popnow/image-expander-v1/edit and an input object that follows the parameter table. The response returns a task ID straight away.
  3. Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "popnow/image-expander-v1/edit",
  "input": {
    "image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
    "aspect_ratio": "1:1",
    "output_format": "png"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.

Image Expander API questions

How much does the Image Expander API cost?

Image Expander costs 4 credits ($0.04) per image. Credits are the same as on the website (1 credit = $0.01), new accounts get 30 free credits, and failed tasks are refunded.

What is the model name for Image Expander in the API?

Put popnow/image-expander-v1/edit for Expand Image in the model field of POST /jobs/createTask.

Can I say what should appear in the new area?

No. There is no prompt field; the extension continues what is already in the photo.

How big is the result?

The long edge is always 1536 pixels and the short edge follows the ratio you pick: 1536 × 864 for 16:9, 864 × 1536 for 9:16, 1536 × 1536 for 1:1.

Which ratio should I pick?

The one your destination uses: 16:9 for video covers and headers, 9:16 for stories and reels, 1:1 for feeds and marketplace tiles, 3:2 or 2:3 for print-style layouts.

What are the limits of the Image Expander API?

Aspect ratios: 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3. Requests outside these limits are rejected before anything is charged.

Can I try Image Expander without writing code?

Yes. The Playground runs Image Expander on your PopNow credits, needs no API key, and shows the matching code for every run.

More about Image Expander