Skip to main content
POST
/
v1
/
images
/
generations
Image Generation / Editing
curl --request POST \
  --url https://www.anyfast.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "wan2.7-image-pro",
  "prompt": "A flower shop with exquisite windows and a beautiful wooden door",
  "image": "https://example.com/input.jpg",
  "n": 1,
  "size": "2K",
  "enable_sequential": false,
  "thinking_mode": true,
  "watermark": false,
  "seed": 1073741823,
  "response_format": "url"
}
'
import requests

url = "https://www.anyfast.ai/v1/images/generations"

payload = {
"model": "wan2.7-image-pro",
"prompt": "A flower shop with exquisite windows and a beautiful wooden door",
"image": "https://example.com/input.jpg",
"n": 1,
"size": "2K",
"enable_sequential": False,
"thinking_mode": True,
"watermark": False,
"seed": 1073741823,
"response_format": "url"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'wan2.7-image-pro',
prompt: 'A flower shop with exquisite windows and a beautiful wooden door',
image: 'https://example.com/input.jpg',
n: 1,
size: '2K',
enable_sequential: false,
thinking_mode: true,
watermark: false,
seed: 1073741823,
response_format: 'url'
})
};

fetch('https://www.anyfast.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'wan2.7-image-pro',
'prompt' => 'A flower shop with exquisite windows and a beautiful wooden door',
'image' => 'https://example.com/input.jpg',
'n' => 1,
'size' => '2K',
'enable_sequential' => false,
'thinking_mode' => true,
'watermark' => false,
'seed' => 1073741823,
'response_format' => 'url'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.anyfast.ai/v1/images/generations"

payload := strings.NewReader("{\n \"model\": \"wan2.7-image-pro\",\n \"prompt\": \"A flower shop with exquisite windows and a beautiful wooden door\",\n \"image\": \"https://example.com/input.jpg\",\n \"n\": 1,\n \"size\": \"2K\",\n \"enable_sequential\": false,\n \"thinking_mode\": true,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"response_format\": \"url\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"wan2.7-image-pro\",\n \"prompt\": \"A flower shop with exquisite windows and a beautiful wooden door\",\n \"image\": \"https://example.com/input.jpg\",\n \"n\": 1,\n \"size\": \"2K\",\n \"enable_sequential\": false,\n \"thinking_mode\": true,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"response_format\": \"url\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://www.anyfast.ai/v1/images/generations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"wan2.7-image-pro\",\n \"prompt\": \"A flower shop with exquisite windows and a beautiful wooden door\",\n \"image\": \"https://example.com/input.jpg\",\n \"n\": 1,\n \"size\": \"2K\",\n \"enable_sequential\": false,\n \"thinking_mode\": true,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"response_format\": \"url\"\n}"

response = http.request(request)
puts response.read_body
{
  "created": 1773803391,
  "data": [
    {
      "url": "https://example.com/generated.png",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json
model
enum<string>
required

Model ID. wan2.7-image-pro supports 4K output for text-to-image; wan2.7-image is faster.

Available options:
wan2.7-image-pro,
wan2.7-image
Example:

"wan2.7-image-pro"

prompt
string
required

Text description of the image. Supports Chinese and English. Max 5000 characters.

Example:

"A flower shop with exquisite windows and a beautiful wooden door"

image
string

Input image for editing — URL (HTTP/HTTPS) or Base64 data URI (data:{MIME};base64,{data}). Formats: JPEG, JPG, PNG (no transparency), BMP, WEBP. Max 20 MB per image. Resolution: 240–8000 px per side, aspect ratio 1:8–8:1. Up to 9 images.

Example:

"https://example.com/input.jpg"

n
integer
default:1

Number of images to generate.

  • Sequential mode off (enable_sequential: false): 1–4, default 1.
  • Sequential mode on (enable_sequential: true): 1–12, default 12.
Required range: 1 <= x <= 12
Example:

1

size
string

Output resolution. Two formats (cannot mix):

  • Preset: 1K (1024×1024), 2K (2048×2048, default), 4K (4096×4096, wan2.7-image-pro text-to-image only).
  • Custom pixels: {W}x{H} — total pixels 768×768–4096×4096 (text-to-image) or up to 2048×2048 (other modes), aspect ratio 1:8–8:1.
Example:

"2K"

enable_sequential
boolean
default:false

Enable group image output mode. When true, n represents the maximum number of images; actual count is decided by the model.

thinking_mode
boolean
default:true

Enable thinking mode for enhanced reasoning and higher quality. Only effective for text-to-image (no image input, sequential mode off).

watermark
boolean
default:false

Add a watermark to the generated image.

seed
integer

Random seed for reproducible results. Same seed produces similar outputs, though exact reproduction is not guaranteed.

Required range: 0 <= x <= 2147483647
response_format
enum<string>
default:url

Return a URL or Base64-encoded image.

Available options:
url,
b64_json
Example:

"url"

Response

Image generated successfully

created
integer

Unix timestamp

Example:

1773803391

data
object[]