Qwen Image Layered API Documentation

Qwen Image Layered generate request - Request Code

POST https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
  "num_inference_steps": 28,
  "guidance_scale": 5,
  "num_images": 1,
  "enable_safety_checker": true,
  "output_format": "png",
  "acceleration": "regular"
}
import requests

url = "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request"

headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}

data = {
    "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
    "num_inference_steps": 28,
    "guidance_scale": 5,
    "num_images": 1,
    "enable_safety_checker": True,
    "output_format": "png",
    "acceleration": "regular"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request';

const data = {
  image_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg',
  num_inference_steps: 28,
  guidance_scale: 5,
  num_images: 1,
  enable_safety_checker: true,
  output_format: 'png',
  acceleration: 'regular'
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
    "num_inference_steps": 28,
    "guidance_scale": 5,
    "num_images": 1,
    "enable_safety_checker": true,
    "output_format": "png",
    "acceleration": "regular"
  }'
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

public class ApiClient {
    public static void main(String[] args) throws Exception {
        String url = "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request";
        
        String json = "{" + "\n" +
            "  \"image_url\": \"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg\"," + "\n" +
            "  \"num_inference_steps\": 28," + "\n" +
            "  \"guidance_scale\": 5," + "\n" +
            "  \"num_images\": 1," + "\n" +
            "  \"enable_safety_checker\": true," + "\n" +
            "  \"output_format\": \"png\"," + "\n" +
            "  \"acceleration\": \"regular\"" + "\n" +
            "}";
        
        HttpClient client = HttpClient.newBuilder()
            .connectTimeout(Duration.ofSeconds(10))
            .build();
            
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .header("Content-Type", "application/json")
            .header("Cache-Control", "no-cache")
            .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(json))
            .build();
            
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
<?php
$url = 'https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request';

$data = [
    'image_url' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg',
    'num_inference_steps' => 28,
    'guidance_scale' => 5,
    'num_images' => 1,
    'enable_safety_checker' => true,
    'output_format' => 'png',
    'acceleration' => 'regular'
];

$jsonData = json_encode($data);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Cache-Control: no-cache',
    'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY'
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

Output

Successful API response:

{  
  "status": "IN_QUEUE",  
  "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",  
  "response_url": "https://gateway-falai-automate.appypie.workers.dev/qwen-image-layered-request-result/a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
}

Request Body - Qwen Image Layered generate request

Parameters for https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request:

ParameterRequiredTypeDescription
image_urlYesstringPublicly accessible URL of the input image to be decomposed into layers. Must be reachable by the server.
num_inference_stepsOptionalintegerNumber of denoising steps during the decomposition process. Higher values yield finer details at the cost of processing time.
guidance_scaleOptionalnumberControls the strength of the decomposition guidance. Higher values enforce stronger adherence to input structure.
num_imagesOptionalintegerNumber of layer sets to generate (currently supports only 1).
enable_safety_checkerOptionalbooleanEnables content safety filtering to block potentially harmful or inappropriate outputs.
output_formatOptionalstringOutput format for the generated layers. Only "png" is currently supported to preserve transparency.
accelerationOptionalstringProcessing mode. Use "regular" for standard quality, "fast" for quicker but lower resolution outputs.

Example Request - Qwen Image Layered generate request

JSON
{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/car_race.jpeg",
  "num_inference_steps": 28,
  "guidance_scale": 5,
  "num_images": 1,
  "enable_safety_checker": true,
  "output_format": "png",
  "acceleration": "regular"
}

Response - Qwen Image Layered generate request

JSON
{
  "status": "IN_QUEUE",
  "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",
  "response_url": "https://gateway-falai-automate.appypie.workers.dev/qwen-image-layered-request-result/a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
}

Request Headers

HeaderDescription
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYour subscription key for authentication

Response Handling

The Qwen Image Layered API returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.

Common Status Codes and Responses

Status CodeDescriptionResponse Body
200Success - The request was successfully processed.{ "success": true, ... }
Bad Request - The request contains invalid parameters or missing fields.{ "error": "Invalid request parameters" }
401Unauthorized - The provided subscription key is missing or invalid.{ "error": "Invalid or missing authentication" }
403Forbidden - The subscription does not have access to this API or action.{ "error": "Access denied for this operation" }
404Not Found - The requested resource or endpoint could not be found.{ "error": "Endpoint not found" }
Too Many Requests - The request rate limit has been exceeded.{ "error": "Rate limit exceeded, please retry later" }
500Internal Server Error - An unexpected error occurred on the server.{ "error": "An unexpected error occurred, please try again later" }

Example Error Response

{
  "error": "Invalid parameters"
}

Retrieving Results

After submitting your request, use this endpoint to check status and retrieve results.

Endpoint

POST https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request-result

Request Body

{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }
POST https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request-result HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
}
import requests

url = "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request-result"

headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}

data = {
    "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request-result';

const data = {
  request_id: 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8'
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request-result" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
  }'
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

public class ApiClient {
    public static void main(String[] args) throws Exception {
        String url = "https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request-result";
        
        String json = "{" + "\n" +
            "  \"request_id\": \"a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8\"" + "\n" +
            "}";
        
        HttpClient client = HttpClient.newBuilder()
            .connectTimeout(Duration.ofSeconds(10))
            .build();
            
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .header("Content-Type", "application/json")
            .header("Cache-Control", "no-cache")
            .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(json))
            .build();
            
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
<?php
$url = 'https://gateway.pixazo.ai/qwen-image-layered/v1/qwen-image-layered-request-result';

$data = [
    'request_id' => 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8'
];

$jsonData = json_encode($data);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Cache-Control: no-cache',
    'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY'
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

Qwen Image Layered API Pricing

Resolution Price (USD)
All Resolution$0.05

Ready to generate Qwen Image Layered API assets?

Start with an API key, then automate your pipeline.