gensta DOCS
api-platform.gensta.ai/v1 Developer portal

Request

POST/v1/generationsmodel: seedream-5.0-pro · mode: layer_decomposition
json
{
  "model": "seedream-5.0-pro",
  "mode": "layer_decomposition",
  "variant": "normal",
  "parameters": {
    "size": "auto",
    "num_outputs": 1,
    "output_format": "png",
    "watermark": false
  },
  "input": {
    "image": { "type": "https_url", "url": "https://cdn.example.com/poster.png" },
    "prompt": "Separate the title, subject, shadows, and background"
  }
}

The base image and layers default to PNG. You can explicitly request JPEG for the base image; all other layers remain PNG. The prompt is optional. num_outputs: 1 identifies one decomposition result; it does not limit or request the number of layers.

Input and output

  • Input: exactly one JPEG or PNG image, supplied by HTTPS URL or ready media_asset_id; 262,144–36,000,000 pixels and no more than 30,000,000 bytes.
  • Size: auto, 1K, 1.5K, or 2K.
  • Output: one base image in the requested JPEG or PNG format, plus up to 16 PNG layers.

Layer artifacts

json
{
  "artifacts": [
    {
      "kind": "image",
      "artifact_index": 0,
      "role": "base",
      "content_type": "image/png",
      "download_url": "https://..."
    },
    {
      "kind": "image",
      "artifact_index": 1,
      "role": "layer",
      "content_type": "image/png",
      "metadata": {
        "schema_version": 1,
        "z_index": 1,
        "name": "subject",
        "description": "Main subject",
        "bounding_box": { "absolute": [120, 88, 940, 1210], "normalized": [117, 86, 918, 1000] }
      },
      "download_url": "https://..."
    }
  ]
}

Sort layer artifacts by metadata.z_index. Keep layer files in PNG format when importing them into an editor.

Pricing in USD

The create response reserves the maximum for the base plus possible layers in billing.reserved_amount. After success, Gensta charges for the base image and each layer actually returned, exposes the final USD amount in billing.charged_amount, and releases the unused reserve. Current USD rates are published by GET /v1/models.