Skip to main content
POST
/
v1
/
images
/
edits
curl --request POST \
  --url https://api.powertokens.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "wan2.7-image-pro",
  "response_format": "url",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "image": "https://example.com/car.webp"
          },
          {
            "image": "https://example.com/paint.webp"
          },
          {
            "text": "Spray the graffiti from image 2 onto the car in image 1"
          }
        ]
      }
    ]
  },
  "size": "2K",
  "n": 1,
  "watermark": false,
  "negative_prompt": "Preserve original car body color",
  "seed": 0
}
'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ],
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Pass Authorization: Bearer <token> in the request header.

Body

application/json
model
enum<string>
required

Image editing model name.

Available options:
wan2.7-image-pro
input
object
required
response_format
enum<string>
default:url

Unified response format.

Available options:
url,
b64_json
size
string
default:1K

Output image resolution. For image editing, official specifications such as 1K or 2K are recommended. The gateway maps this to upstream parameters.size.

n
integer

Number of images to generate. The gateway maps this to upstream parameters.n.

Required range: 1 <= x <= 4
watermark
boolean
default:false

Whether to add a watermark. The gateway maps this to upstream parameters.watermark.

negative_prompt
string

Negative prompt. The gateway maps this to upstream parameters.negative_prompt.

seed
integer
default:0

Random seed, range [0, 2147483647]. The gateway maps this to upstream parameters.seed.

Required range: 0 <= x <= 2147483647
bbox_list
integer[][][]

Interactive editing bounding box regions, corresponding to input images in order. The gateway maps this to upstream parameters.bbox_list.

Response

Success. Returns the image editing result.

created
integer<int64>

Creation time as a Unix timestamp (seconds).

data
object[]

List of generated images.

metadata
object

Additional result information. Field contents vary by capability.