PixMind Docs
API ReferenceImage ModelsSeedream 5.0 Pro Layer Decomposition

Seedream 5.0 Pro Layer Decomposition

Split an image into a base and transparent layers through the PixMind API.

Decompose one image into a base image and transparent PNG layers, retaining positions and stacking order.

Provider

ByteDance

Model ID

seedream-5.0-pro-layered

Endpoint

POST /api-platform/v1/generations

Authentication

Base URL: https://aihub-admin.aimix.pro. Send Authorization: Bearer <PIXMIND_API_KEY> on both creation and polling requests, and Content-Type: application/json when submitting JSON. Keep your key in a server environment variable.

Model notes

  • Exactly one PNG/JPEG input is required. Prompt is optional. Supply size 1K, 1.5K, 2K or auto; aspect ratios and exact pixels are not accepted for decomposition.
  • Preauthorization covers up to 17 outputs including the base image. Final charge is APIMart's final USD task cost × 1.15 × 6.77 × 140, rounded up once to whole credits. Excess preauthorization is refunded; failed tasks are refunded. API use does not require a website subscription.
  • Poll GET /api-platform/v1/tasks/{taskId}. Completed tasks contain images, layers (url, zIndex, size, outputFormat, boundingBox) and billing.settledPoints. Compose layers in ascending zIndex order.
  • Alternatively send model seedream-5.0-pro with layer_decomposition=true. All other generation requests retain the standard image pricing.

Request parameters

ParameterTypeRequiredDescription
modelstringYes

Layer decomposition model ID.

Default: seedream-5.0-pro-layered

image_urlsstring[]Yes

Exactly one public image URL or PNG/JPEG data URL; input up to 30 MB and 262144–36000000 total pixels.

promptstringNo

Optional decomposition instructions.

sizestringNo

Output resolution tier.

Allowed values: 1K, 1.5K, 2K, auto

Default: auto

numLayersintegerNo

Optional output-count prompt hint from 2 through 17, including the base. Actual output count can differ.

Request example

cURL
curl --request POST 'https://aihub-admin.aimix.pro/api-platform/v1/generations' \
  -H "Authorization: Bearer $PIXMIND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "seedream-5.0-pro-layered",
  "image_urls": [
    "https://example.com/poster.png"
  ],
  "size": "2K"
}'
JavaScript
// Node.js 20+. Keep the API key on your server.
const apiKey = process.env.PIXMIND_API_KEY;
if (!apiKey) throw new Error("PIXMIND_API_KEY is required");

const response = await fetch("https://aihub-admin.aimix.pro/api-platform/v1/generations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "seedream-5.0-pro-layered",
  "image_urls": [
    "https://example.com/poster.png"
  ],
  "size": "2K"
}),
  signal: AbortSignal.timeout(30_000)
});

const task = await response.json();
if (!response.ok || task.code !== 1000) {
  throw new Error(task.message ?? task.error?.message ?? `HTTP ${response.status}`);
}
console.log(task);

Accepted task response

Generation is asynchronous. Save taskId and poll GET /api-platform/v1/tasks/{taskId} until status is ready or failed.

200 OK
{
  "code": 1000,
  "data": {
    "id": "img_44160",
    "taskId": 44160,
    "type": "image",
    "model": "seedream-5.0-pro-layered",
    "status": "processing"
  }
}

Query the task and retrieve results

Replace 44160 with data.taskId from the accepted response, using a key belonging to the same user. pending and processing are non-terminal; ready and failed are terminal. On ready, read images (images) or videoUrl (videos); on failed, read errorMessage. The example stops after 60 queries. If it times out, save taskId and query again later instead of creating a duplicate task. Example result URLs are placeholders.

cURL
curl 'https://aihub-admin.aimix.pro/api-platform/v1/tasks/44160' \
  -H "Authorization: Bearer $PIXMIND_API_KEY"
JavaScript
// Continue after the request example above.
const taskId = task.data?.taskId;
if (!Number.isInteger(taskId)) throw new Error("Missing numeric taskId");

async function waitForTask(taskId) {
  for (let attempt = 0; attempt < 60; attempt++) {
    await new Promise(resolve => setTimeout(resolve, Math.min(2000 * 1.5 ** attempt, 10000)));
    const response = await fetch(`https://aihub-admin.aimix.pro/api-platform/v1/tasks/${taskId}`, {
      headers: { Authorization: `Bearer ${apiKey}` },
      signal: AbortSignal.timeout(30_000)
    });
    const result = await response.json();
    if (!response.ok || result.code !== 1000) {
      throw new Error(result.message ?? `HTTP ${response.status}`);
    }
    const data = result.data;
    if (data.status === "ready") return data;
    if (data.status === "failed") {
      throw new Error(data.errorMessage ?? "Generation failed");
    }
    if (!["pending", "processing"].includes(data.status)) {
      throw new Error(`Unexpected task status: ${data.status}`);
    }
  }
  throw new Error(`Polling timed out; save taskId ${taskId} to query again later`);
}

const result = await waitForTask(taskId);
console.log(result.images);
200 OK · ready
{
  "code": 1000,
  "data": {
    "taskId": 44160,
    "type": "image",
    "model": "seedream-5.0-pro-layered",
    "status": "ready",
    "progress": 100,
    "images": [
      "https://example.com/result.png"
    ]
  }
}

On this page