[Alpha] Create Any Image

Instead of starting from an existing image (by using the parameters imageFile or imageUrl), you can choose to generate a new AI image using a prompt.

To create an AI image, use the parameter imageFromPrompt:

curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: YOUR_API_KEY' \
  --form removeBackground=false \
  --form 'imageFromPrompt.prompt=three mugs on a table in a rustic coffee shop in a realistic style' \
  --form imageFromPrompt.seed=12345 \
  --output result.png

Result:

Create Any Image generates an image with a background, but the API will perform a background removal by default: you can set removeBackground=false if you want to keep the generated background.

Parameters

Create Any Image supports the following parameters:

imageFromPrompt.prompt

Your text prompt to create the image with, for example three coffee mugs on rustic countertop, a red car in a baroque style, or a tent on a snowy mountain.

By default, a realistic style will be used, but you can specify the style you want in the prompt, like in a cyberpunk style to override it.

imageFromPrompt.seed (optional)

The seed to generate the image. The same prompt with the same seed will generate the same image.

imageFromPrompt.size: (optional)

The size and format of the generated.

The following values are supported:

  • SQUARE_HD (default)

  • LANDSCAPE_16_9

  • LANDSCAPE_4_3

  • PORTRAIT_16_9

  • PORTRAIT_4_3

Last updated

Was this helpful?