POST
/
v1
/
ai
/
image-style-transfer
curl --request POST \
  --url https://api.freepik.com/v1/ai/image-style-transfer \
  --header 'Content-Type: application/json' \
  --header 'x-freepik-api-key: <api-key>' \
  --data '{
  "image": "iVBORw0KGgoAAAANSUhEUgAA...",
  "reference_image": "iVBORw0KGgoAAAANSUhEUgAA...",
  "webhook_url": "https://my-webhook-url.com/endpoint",
  "prompt": "Transform the image into a modern artistic style",
  "style_strength": 85,
  "structure_strength": 60,
  "is_portrait": true,
  "portrait_style": "pop",
  "portrait_beautifier": "beautify_face_max",
  "flavor": "gen_z",
  "engine": "colorful_anime",
  "fixed_generation": true
}'
{
  "data": {
    "generated": [],
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "IN_PROGRESS"
  }
}

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
image
string
required

Base64 Image to style transfer

reference_image
string
required

Base64 Reference image for style transfer

webhook_url
string

Webhook URL

prompt
string

Prompt for the AI model

style_strength
integer
default:100

Percentage of style strength

Required range: 0 <= x <= 100
structure_strength
integer
default:50

Allows to maintain the structure of the original image

Required range: 0 <= x <= 100
is_portrait
boolean
default:false

Is the image a portrait

portrait_style
enum<string>
default:standard

Portrait style

Available options:
standard,
pop,
super_pop
portrait_beautifier
enum<string>

Portrait beautifier

Available options:
beautify_face,
beautify_face_max
flavor
enum<string>
default:faithful

Flavor of the transferring style

Available options:
faithful,
gen_z,
psychedelia,
detaily,
clear,
donotstyle,
donotstyle_sharp
engine
enum<string>
default:balanced
Available options:
balanced,
definio,
illusio,
3d_cartoon,
colorful_anime,
caricature,
real,
super_real,
softy
fixed_generation
boolean
default:false

When this option is enabled, using the same settings will consistently produce the same image. Fixed generations are ideal for fine-tuning, as it allows for incremental changes to parameters (such as the prompt) to see subtle variations in the output. When disabled, expect each generation to introduce a degree of randomness, leading to more diverse outcomes.

Response

200
application/json
OK - The request has succeeded and the Style Transfer process has started.
data
object
required
Example:
{
  "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "status": "IN_PROGRESS",
  "generated": [
    "https://openapi-generator.tech",
    "https://openapi-generator.tech"
  ]
}