# Create Any Image

## Overview

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`:

```sh
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --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:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsjEqvP6TzRhcUMPYrshZ%2Fresult.png?alt=media&#x26;token=247d9a68-a5ce-431b-8d83-941a01ca158c" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
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.
{% endhint %}

## 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)&#x20;

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

### `imageFromPrompt.size`: (optional)&#x20;

The size and format of the generated.

The following values are supported:&#x20;

* `SQUARE_HD` (default)
* `LANDSCAPE_16_9`
* `LANDSCAPE_4_3`
* `PORTRAIT_16_9`
* `PORTRAIT_4_3`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.photoroom.com/image-editing-api-plus-plan/create-any-image.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
