POST
/
v1
/
ai-photo-editor
curl --request POST \
  --url https://api.magichour.ai/v1/ai-photo-editor \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Photo Editor image",
  "steps": 4,
  "resolution": 768,
  "style": {
    "steps": 4,
    "image_description": "A photo of a person",
    "likeness_strength": 5.2,
    "prompt": "A photo portrait of a person wearing a hat",
    "prompt_strength": 3.75,
    "negative_prompt": "painting, cartoon, sketch"
  },
  "assets": {
    "image_file_path": "api-assets/id/1234.png"
  }
}'
{
  "id": "clx7uu86w0a5qp55yxz315r6r",
  "frame_cost": 10
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
Body
resolution
integer
required

The resolution of the final output image. The allowed value is based on your subscription. Please refer to our pricing page for more details

Required range: 512 <= x <= 1024
Example:

768

style
object
required
assets
object
required

Provide the assets for photo editor

name
string
default:Photo Editor - dateTime

The name of image

Example:

"Photo Editor image"

steps
integer
deprecated

Deprecated: Please use .style.steps instead. Number of iterations used to generate the output. Higher values improve quality and increase the strength of the prompt but increase processing time.

Required range: 3 <= x <= 6

Response

200
application/json

Success

id
string
required

Unique ID of the image. This value can be used in the get image project API to fetch additional details such as status

Example:

"clx7uu86w0a5qp55yxz315r6r"

frame_cost
integer
required

The frame cost of the image generation

Example:

10