Skip to main content
POST
/
v1
/
ai
/
ideogram-image-edit
Ideogram Image Edit - Edit an image using inpainting
curl --request POST \
  --url https://api.freepik.com/v1/ai/ideogram-image-edit \
  --header 'Content-Type: application/json' \
  --header 'x-freepik-api-key: <api-key>' \
  --data '
{
  "prompt": "A beautiful sunset over the ocean",
  "image": "iVBORw0KGgoAAAANSUhEUgAA...",
  "mask": "iVBORw0KGgoAAAANSUhEUgAA...",
  "seed": 12345,
  "rendering_speed": "DEFAULT",
  "magic_prompt": "AUTO",
  "color_palette": {
    "name": "EMBER",
    "members": [
      {
        "color_hex": "#FF5733",
        "color_weight": 0.5
      }
    ]
  },
  "style_codes": [
    "style_code_1",
    "style_code_2"
  ],
  "style_type": "AUTO",
  "style_reference_images": [
    "https://example.com/style-ref.jpg"
  ],
  "character_reference_images": [
    "https://example.com/character-ref.jpg"
  ],
  "webhook_url": "https://www.example.com/webhook"
}
'
{
  "data": {
    "generated": [],
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "CREATED"
  }
}

Authorizations

x-freepik-api-key
string
header
required

Your Freepik API key. Required for authentication. Learn how to obtain an API key

Body

application/json
prompt
string
required

The prompt describing the desired changes to the image.

Example:

"A beautiful sunset over the ocean"

image
string
required

The image to be edited. Supports HTTPS URLs or Base64 encoded string. Supported formats: JPEG, WebP, PNG (max 10MB)

Example:

"iVBORw0KGgoAAAANSUhEUgAA..."

mask
string
required

A black and white image of the same size as the image being edited. Black regions indicate where to edit the image. Supports HTTPS URLs or Base64 encoded string. Supported formats: JPEG, WebP, PNG (max 10MB)

Example:

"iVBORw0KGgoAAAANSUhEUgAA..."

seed
integer

Optional seed for reproducibility

Required range: 0 <= x <= 2147483647
Example:

12345

rendering_speed
enum<string>
default:DEFAULT

The rendering speed for image generation.

  • TURBO: Fastest, lower quality
  • DEFAULT: Balanced speed and quality
  • QUALITY: Slower, higher quality
Available options:
TURBO,
DEFAULT,
QUALITY
Example:

"DEFAULT"

magic_prompt
enum<string>

Determine if MagicPrompt should be used to enhance the prompt.

  • AUTO: Automatically decide
  • ON: Always use MagicPrompt
  • OFF: Never use MagicPrompt
Available options:
AUTO,
ON,
OFF
Example:

"AUTO"

color_palette
object

A color palette for generation. Specify either name (preset) or members (custom colors), not both.

style_codes
string[]

A list of style codes to use for image generation

Example:
["style_code_1", "style_code_2"]
style_type
enum<string>

The type of style to use. Must be specified if character_reference_images is provided.

  • AUTO: Automatically select style
  • GENERAL: General purpose style
  • REALISTIC: Realistic style
  • DESIGN: Design-oriented style
Available options:
AUTO,
GENERAL,
REALISTIC,
DESIGN
Example:

"AUTO"

style_reference_images
string[]

Images to use as style references. Provide as Base64 strings or URLs. Maximum total size: 10MB across all references. Supported formats: JPEG, PNG, WebP

Example:
["https://example.com/style-ref.jpg"]
character_reference_images
string[]

Images to use as character references for consistency. Provide as Base64 strings or URLs. Maximum total size: 10MB across all references. Supported formats: JPEG, PNG, WebP

Example:
["https://example.com/character-ref.jpg"]
webhook_url
string<uri>

Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

Example:

"https://www.example.com/webhook"

Response

OK - The task exists and the status is returned

data
object
required
Example:
{
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED",
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
]
}