POST
/
v1
/
ai-photo-editor
Python
from magic_hour import Client
from os import getenv

client = Client(token=getenv("API_TOKEN"))
res = client.v1.ai_photo_editor.create(
    assets={"image_file_path": "api-assets/id/1234.png"},
    resolution=768,
    style={
        "image_description": "A photo of a person",
        "likeness_strength": 5.2,
        "negative_prompt": "painting, cartoon, sketch",
        "prompt": "A photo portrait of a person wearing a hat",
        "prompt_strength": 3.75,
        "steps": 4,
        "upscale_factor": 2,
        "upscale_fidelity": 0.5,
    },
    name="Photo Editor image",
)
{
  "id": "cuid-example",
  "frame_cost": 10,
  "credits_charged": 10
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".

Body

application/json

Body

The body is of type object.

Response

200
application/json

Success