Same-style material generation

Updated at:

This product for the automated generation of product detail assets uses a multimodal large model (MLLM) and structured extraction of image and text to enable product detail page asset enrichment for e-commerce platforms and brand owners.

Product overview

This product automatically generates product detail assets. It uses a multimodal large language model (MLLM) and structured image-text extraction to enrich product detail page assets for e-commerce platforms and brand owners. A caller submits product information such as the product ID, title, brand, main image, and store name. The service then automatically locates matching products, verifies their consistency, and extracts size information and product attributes from the details of the matches. The service renders this data as a ready-to-use size chart and attribute table (SVG). The service also returns structured detail copy classifications and processing notes.

Since collecting matching products and extracting image-text data are time-consuming tasks that take multiple days (a task submitted on Day T can be queried starting from Day T+3.5), this service operates asynchronously and provides two APIs:

  1. On Day T, call the submission API to create a recognition task.

  2. Retrieve the returned TaskId and persist it in your database.

  3. Starting from Day T+3.5, use the TaskId to call the query API to check the task results.

  4. Stop querying when the task enters a terminal state (COMPLETED or FAILED).

2. Use cases

  1. Automate asset enrichment: When a product is missing a size chart or attribute image, automatically reconstruct and render one from the product details of matching products. This eliminates the manual work of searching for images, removing backgrounds, and handling layouts.

  2. Persist size information as structured data: Extract size charts embedded in long images from the product details of matching products and convert them into structured data. You can then store this data in a database for reuse.

  3. Govern product detail copy: Automatically classify product detail copy from matching products into eight categories (marketing, feature, material, style, scenario, service, compliance, and noise) for content moderation and repurposing.

3. Features

  1. Upfront item verification: The service first identifies candidate items, then uses a large multimodal model to verify brand consistency and main image consistency. If verification fails, the item is classified as no_match. This prevents generating images with incorrect sizing data, as the service prioritizes accuracy over completeness to reduce returns.

  2. Size extraction and multi-table fusion: For products with multiple size charts (e.g., for different fits, genders, or age groups), the service performs size extraction and multi-table fusion to generate a consolidated size chart and sizing recommendations. The service does not assume units; if they are not specified in the source data, the service does not default to cm.

  3. Attribute extraction and fusion: The service fuses structured attributes with attribute descriptions from detail images. The service automatically merges attributes with the same name by concatenating their values with a +, which prevents displaying multiple rows for the same attribute.

  4. Asset rendering and hosting: The service renders size charts and attribute images as SVG files (vector-based, compact, and scalable without distortion), uploads them to object storage, and returns an accessible URL. The URL's hash is derived from the SVG content, so the URL remains unchanged if the content is unchanged. This design allows identical assets to reuse the same URL.

  5. Per-item explainability: The notes array returns tips, warnings, and audit information from the processing steps (e.g., "7 invalid images discarded during image cleaning" or "No copywriting classification generated"). This information is kept separate from business fields such as sizeImageUrl, attrImageUrl, or textClassification.

  6. Supported input format: The service accepts a publicly accessible product main image URL and product text information. The service processes one product per submission, and the output schema is consistent.

4. Development

4.0 Asynchronous call pattern

#

API

Description

Key return value

①

Submission API

Creates a recognition task and returns immediately without waiting for processing to complete.

Data.TaskId

②

Query API

Uses the TaskId to query the task status and recognition result.

Data.Status + Data.Result

Caller                          Product Backend             Same-Style Data Source      Recognition & Extraction Engine
  │                                 │                          │                           │
  │── ① Submit recognition task ───▶│                          │                           │
  │◀─ ② Return TaskId ──────────────│                          │                           │
  │                                 │── ③ Submit same-style collection ───▶│                           │
  │                                 │                          │ (Cross-day collection T to T+3.5) │
  │                                 │◀─ ④ Receive same-style candidates ──│                           │
  │                                 │                                                      │
  │                                 │── ⑤ Validate, extract attributes, classify text ──▶│
  │                                 │◀─ ⑥ Return structured result ──────────────────────│
  │                                 │                                                      │
  │                                 │── ⑦ Render SVG → ⑧ Upload to object storage → URL  │
  │                                 │                                                      │
  │── ⑨ Query with TaskId on/after T+3.5 ▶│                                                      │
  │◀─ ⑩ Return Status + Result ──────│                                                      │

Processing timeline (for scheduling queries)

Stage

Outer Data.Status

Timeline

Queuing

QUEUED

Submitted on Day T, accepted within seconds.

Same-style collection

RUNNING

Day T to Day T+3.5. This asynchronous, cross-day collection is the most time-consuming stage.

Recognition & extraction

RUNNING

Seconds

Rendering & uploading

RUNNING

Seconds

End-to-end

—

Submitted on Day T; final results are available starting from Day T+3.5.

⚠️ This API does not return results within minutes. Queries on the submission day (Day T), Day T+1, or Day T+2 will almost certainly return a status of QUEUED or RUNNING. Schedule your queries on a daily basis and avoid rapid polling (see Section 4.3).

4.1 Submit a recognition task

Item

Setting

invocation mode

Synchronous HTTP POST with a JSON body

response

Immediately returns Data.TaskId, without waiting for the processing to complete.

original request retention

The server retains a daily copy of the original JSON request to help resolve disputes over field semantics.

4.1.1 Request parameters

Parameter

Type

Required

Description

Impact if Missing

ItemId

String

Yes

The caller-side product ID, the tracing primary key, is returned in Result.data.baseInfo.itemId.

Cannot be added to the pool.

ImageUrl

String

Yes

URL of the product's main image (must be publicly accessible), used for the image consistency check.

Disables image consistency checks, rendering the processing pipeline unusable.

ShopName

String

Yes

The name of the shop to which the product belongs is used for brand extraction and is returned in Result.data.baseInfo.shopName.

Loses brand-based rejection capability.

Title

String

Yes

The product title, used for retrieving matching items.

Prevents submitting tasks to find similar items.

BrandName

String

No

The product brand.

—

ProductUrl

String

No

The product's detail page URL. It is used for tracing only and does not affect the recognition result.

A tracing reference is lost.

Category

String

No

The product category name. This is an extension field.

—

4.1.2 Request example

{
  "ItemId": "228516909",
  "Title": "FILA Kids' Training Shoes",
  "BrandName": "FILA",
  "ImageUrl": "https://example.com/items/228516909/main.jpg",
  "ShopName": "FILA Official Flagship Store",
  "ProductUrl": "https://example.com/items/228516909",
  "Category": "Kids' Shoes"
}

4.1.3 Response parameters

Field

Type

Always Returned

Description

RequestId

String

✅

A unique identifier for the API call. A new ID is generated for each request and cannot be used to query the task.

Code

String

✅

The status code of the call. A value of success indicates that the call was successful.

Message

String

✅

The status of the call. A successful call returns Success.

Success

Bool

✅

Indicates whether the call was successful. The value is true if the call succeeded.

Data

Object

⬜

The business data object is returned when Success = true.

└ TaskId

String

✅

Asynchronous task ID: Used to query task results. If the period between submission and query exceeds 3.5 calendar days, you must persist this ID to the database along with the ItemId.

└ SubmittedAt

String

✅

The time the server accepts the task, in UTC ISO 8601 format. Its calendar day is Day T, and T+3 is calculated based on this.

4.1.4 Response examples

1) Successful submission

{
  "RequestId": "01A05BD6-A1A6-1950-8E0E-75E55A3C5DC8",
  "Code": "success",
  "Message": "Success",
  "Success": true,
  "Data": {
    "TaskId": "3a7754d6048642778eba01253ea18068",
    "SubmittedAt": "2026-09-04T09:30:00Z"
  }
}

2) Missing required parameter — Submission failed

When a key field is missing, the server records reject_reason and increments a counter. The field is not populated with an empty string and passed downstream.

{
  "RequestId": "5F2C9B41-77D3-1C22-8F31-1E5B31A0C912",
  "Code": "InvalidParameter",
  "Message": "missing required parameter: ImageUrl",
  "Success": false,
  "Data": null
}

3) Brand cannot be determined — Submission failed

{
  "RequestId": "9AC2B0E1-2E45-1907-B0AA-6D5E19C7A331",
  "Code": "InvalidParameter",
  "Message": "BrandName is empty and cannot be derived from ShopName",
  "Success": false,
  "Data": null
}

4.2 Query API

Item

Setting

Invocation mode

Synchronous HTTP POST with a JSON body

Earliest query time

Day T+3.5 (where T is the submission day, derived from the calendar day of Data.SubmittedAt in the submission response)

Billing

The query API is free of charge. However, schedule your queries daily starting from Day T+3.5 and avoid high-frequency polling.

4.2.1 Request parameters

Parameter

Type

Required

Description

taskId

String

Yes

The Data.TaskId from the submission API response.

Note the case sensitivity: The field in the submission API response is Data.TaskId (UpperCamelCase), while in the query API request it is taskId (lowerCamelCase). Use these fields as-is per the gateway specification; do not normalize their casing.

4.2.2 Request example

{
  "taskId": "3a7754d6048642778eba01253ea18068"
}

4.2.3 Response parameters

Top-level fields:

Field

Type

Always present

Description

RequestId

String

✅

The request ID for this API call. This ID is unique for each polling attempt.

Code / Message / Success

String / String / Bool

✅

The invocation status. For a successful call, Code is "success", Message is "Success", and Success is true.

Data

Object

⬜

The task data object.

Structure of the Data object:

Field

Type

Always present

Description

Data.TaskId

String

✅

The task ID, returned as-is.

Data.Status

String

✅

gateway asynchronous task status: QUEUED / RUNNING / COMPLETED / FAILED

Data.UsageMap

Object

⬜

The processing count, e.g., {"ProcessingCount": 1}. This is returned after the task completes or fails.

Data.Result

String

⬜

The business result, provided as a JSON string. Returned when Data.Status is COMPLETED or FAILED. You must deserialize this string to read its contents.

Structure after deserializing Data.Result:

Field

Type

Always present

Description

code

String

✅

The business code. A value of "0" indicates a successful result.

message

String

✅

The business message. Normally Success.

success

Bool

✅

Indicates whether the business logic ran successfully.

status

String

✅

Business identification result: success (match found and images generated), no_match (no match found), or failed (identification failed).

data

Object

✅

The business data. When status is no_match, this object only contains the requestId.

└ requestId

String

✅

The task identifier, which is the same as the top-level Data.TaskId.

└ baseInfo

Object

⬜

Returns the basic information of the submitted product. Returned when status is success.

└ itemId

String

✅

The submitted ItemId, returned as-is.

└ shopName

String

✅

The submitted ShopName, returned as-is.

└ sizeImageUrl

String|null

⬜

The SVG URL of the size chart image. If no size data is available, this field is present but set to null.

└ attrImageUrl

String|null

⬜

The SVG URL of the attribute image. If no attribute data is available, this field is present but set to null (most products have attributes).

└ textClassification

Object

⬜

Product description text classified into eight categories. All keys are always present, and their value arrays can be empty.

└ marketing

Array

✅

Marketing points

└ feature

Array

✅

Features

└ material

Array

✅

Material composition

└ style

Array

✅

Style

└ scenario

Array

✅

Usage scenario

└ service

Array

✅

Service commitments

└ compliance

Array

✅

Compliance statements

└ noise

Array

✅

Noise text (no business value)

└ notes

Array

⬜

Processing notes, such as tips, alerts, or audit information. It can be an empty array.

4.2.4 Response examples

1) Task in Progress (Querying Before Day T+3.5)

{
  "RequestId": "01A05BD6-A1A6-1950-8E0E-75E55A3C5DC8",
  "Code": "success",
  "Message": "Success",
  "Success": true,
  "Data": {
    "TaskId": "3a7754d6048642778eba01253ea18068",
    "Status": "RUNNING"
  }
}

2) Match found

{
  "RequestId": "01A05BD6-A1A6-1950-8E0E-75E55A3C5DC8",
  "Code": "success",
  "Message": "Success",
  "Success": true,
  "Data": {
    "TaskId": "3a7754d6048642778eba01253ea18068",
    "Status": "COMPLETED",
    "UsageMap": {
      "ProcessingCount": 1
    },

    "Result": "{\"code\":\"0\",\"data\":{\"requestId\":\"3a7754d6048642778eba01253ea18068\",\"baseInfo\":{\"itemId\":\"228516909\",\"shopName\":\"FILA Official Flagship Store\"},\"sizeImageUrl\":\"https://example.com/size.svg\",\"attrImageUrl\":\"https://example.com/attr.svg\",\"textClassification\":{\"marketing\":[],\"feature\":[],\"material\":[],\"style\":[],\"scenario\":[],\"service\":[],\"compliance\":[],\"noise\":[]},\"notes\":[]},\"message\":\"Success\",\"status\":\"success\",\"success\":true}"

  }
}

The deserialized Data.Result object:

{
  "code": "0",
  "data": {
    "requestId": "3a7754d6048642778eba01253ea18068",
    "baseInfo": {
      "itemId": "228516909",
      "shopName": "FILA Official Flagship Store"
    },
    "sizeImageUrl": "https://example.com/size.svg",
    "attrImageUrl": "https://example.com/attr.svg",
    "textClassification": {

      "marketing": [],


      "feature": [],


      "material": [],


      "style": [],


      "scenario": [],


      "service": [],


      "compliance": [],


      "noise": [ ]

    },

    "notes": [ ]

  },
  "message": "Success",
  "status": "success",
  "success": true
}

3. The same style is recognized, but the product has no size data — sizeImageUrl is null

The business result after parsing Data.Result (The outer structure is the same as above and is omitted):

{
  "code": "0",
  "data": {
    "requestId": "5c88f1e2a4b1490d9f2b7c3d6e8a0b12",
    "baseInfo": {
      "itemId": "230972423",
      "shopName": "A brand's official flagship store for kidswear"
    },
    "sizeImageUrl": null,
    "attrImageUrl": "https://example.com/attr.svg",
    "textClassification": {

      "marketing": [],

      "feature": ["Breathable and quick-drying"],
      "material": ["100% Polyester"],

      "style": [],

      "scenario": ["Daily commute"],
      "service": ["7-day no-questions-asked return"],

      "compliance": [],


      "noise": [ ]

    },
    "notes": ["No size/spec chart data for this product; size chart image not generated.", "7 invalid images discarded during the image cleaning stage."]
  },
  "message": "Success",
  "status": "success",
  "success": true
}

4) No match found

{
  "RequestId": "01A05BD6-A1A6-1950-8E0E-75E55A3C5DC8",
  "Code": "success",
  "Message": "Success",
  "Success": true,
  "Data": {
    "TaskId": "3a7754d6048642778eba01253ea18068",
    "Status": "COMPLETED",
    "UsageMap": {
      "ProcessingCount": 1
    },
    "Result": "{\"code\":\"0\",\"data\":{\"requestId\":\"3a7754d6048642778eba01253ea18068\"},\"message\":\"Success\",\"status\":\"no_match\",\"success\":true}"
  }
}

Deserialized Data.Result (the data object contains only the requestId):

{
  "code": "0",
  "data": {
    "requestId": "3a7754d6048642778eba01253ea18068"
  },
  "message": "Success",
  "status": "no_match",
  "success": true
}

5) Identification failed

{
  "RequestId": "01A05BD6-A1A6-1950-8E0E-75E55A3C5DC8",
  "Code": "success",
  "Message": "Success",
  "Success": true,
  "Data": {
    "TaskId": "3a7754d6048642778eba01253ea18068",
    "Status": "FAILED",
    "UsageMap": {
      "ProcessingCount": 1
    },
    "Result": "{\"code\":\"0\",\"data\":{\"requestId\":\"3a7754d6048642778eba01253ea18068\"},\"message\":\"download main image failed after 3 retries: 403\",\"status\":\"failed\",\"success\":true}"
  }
}

6) Task Not Found or Expired

{
  "RequestId": "3B71D2A8-2E45-1907-B0AA-6D5E19C7A331",
  "Code": "TaskNotFound",
  "Message": "task not found or expired: 3a7754d6048642778eba01253ea18068",
  "Success": false,
  "Data": null
}

4.3 Status and polling cadence

Status determination matrix

Outer Data.Status

Inner Result.status

Description

Polling action

QUEUED

-

Queued for processing.

Continue polling

RUNNING

-

Processing (includes similar item collection, recognition and extraction, rendering and upload). Tasks are typically in this state before Day T+3.

Continue polling

COMPLETED

success

Recognition succeeded, and a match was found.

Stop polling

COMPLETED

no_match

Recognition completed, but no match was found.

Stop polling

FAILED

failed

Recognition failed.

Stop polling

The outer Data.Status indicates the status of the gateway asynchronous task. The actual recognition result is stored in the Data.Result field, which is a string. You must deserialize this string to read its inner status and data fields.
When Data.Status ∈ {QUEUED, RUNNING}, the Data.Result field is not returned. Do not attempt to deserialize it.

Integration requirements

Requirement

Description

Initial query time

Day T+3.5, where T is the submission date (the calendar day of Data.SubmittedAt). Polling before Day T+3 will almost certainly return QUEUED or RUNNING and will not speed up processing.

Polling cadence

Perform scheduled batch queries daily. Poll once or twice per day, starting from Day T+3.5. Do not use high-frequency polling at intervals of seconds or minutes.

Handling non-terminal states

If the status is still QUEUED or RUNNING on Day T+3.5, continue to poll daily. Do not resubmit the task, as this will result in duplicate billing.

Stop polling condition

Stop polling when Data.Status is COMPLETED or FAILED.

Timeout detection

The timeout threshold and the server-side circuit breaking time will be confirmed in Chapter 6. As an initial step, implement a client-side alert that triggers if a task has not reached a terminal state after daily polling begins on Day T+3.

Task persistence

Because there is a 3.5-calendar-day gap between submission and querying, you must persist the TaskId and ItemId. Also, record the SubmittedAt timestamp to calculate when polling can begin.

Submission retry

For 5xx errors or timeouts, implement a retry with backoff strategy for up to 3 attempts (for example, with delays of 3s, 6s, and 12s, plus jitter). Do not retry on 4xx errors, as this is ineffective and can mask the underlying problem.

Funnel analysis

Perform funnel analysis for each batch. The funnel metrics are: total submissions → COMPLETED tasks → successful results → generated images. Note that the submission batch (Day T) and result retrieval batch (Day T+3.5) do not occur on the same day. For reconciliation, aggregation must be based on the submission date.

4.4 Material URL

Materials for sizeImageUrl and attrImageUrl are stored in object storage using the following key pattern:

same-item/render/{tenantId}/{yyyymmdd}/{ItemId}/{size|attr}_{first_10_of_sha1}.svg

Parameter

Description

tenantId

Isolates materials by customer or tenant.

sha1

Derived from the SVG content. If the content does not change, the URL does not change. You can use this for cache-based deduplication.

Format

The format is always SVG. If you need PNG or JPG files, convert them in your application.

Lifecycle

Materials on this prefix have a 7-day retention period and are automatically deleted afterward. This period begins on the material's creation date. To prevent data loss, transfer materials to your own storage before this period ends.

4.5 Exception handling

Scenario

Outer Data.Status

Inner Result.status

Output behavior

Missing size or specification table data

COMPLETED

success

The sizeImageUrl field is null.

Missing attribute data

COMPLETED

success

The attrImageUrl field is null.

SVG rendering exception

COMPLETED

success

The corresponding image field is null, and the reason is recorded in the notes field.

Asset upload failure

COMPLETED

success

If the upload fails after three retries, the system sets the image field to null.

Inaccessible asset URL

COMPLETED

success

After the upload, the system sends a HEAD request to verify the URL. If this check fails, it triggers a server-side alarm.

No match found or validation fails

COMPLETED

no_match

The data object contains only the requestId.

Main image download failure

FAILED

failed

The inner message field contains the failure reason.

Recognition and extraction failure

FAILED

failed

The system skips rendering and records the failure reason in the inner message field.

Similar item collection timeout

FAILED

failed

This event triggers server-side circuit breaking and an alarm. The inner message field indicates a timeout (the circuit breaking threshold is to be determined; see Chapter 6).

Error codes

gateway-level error codes (top-level Code, Success = false, and Data is null)

Code

Description

Actions

success

The request was successful.

—

InvalidParameter

Missing required parameter or invalid parameter format.

Correct the input parameters and do not retry.

TaskNotFound

The specified taskId does not exist or has expired.

Verify the taskId. To rerun the task, submit a new request.

Throttling

Exceeded the QPS/concurrency quota.

Retry with backoff.

InternalError

An internal error occurred.

Retry with backoff up to 3 times. If the error persists, contact support.

Business-level failure: When a task fails at the business level, the gateway API call may still return a success status (top-level Code = success and Success = true). The failure information is found in the nested fields: Data.Status = FAILED, the inner Result.status = failed, and the inner message. Do not rely solely on the top-level fields to determine task success.

For a list of common platform error codes, see https://help.aliyun.com/document_detail/3038043.html

5. Billing method

Item

Description

Billable API

Only submission APIs are billed. The query API is free.

Billing metric

Count by Data.UsageMap.ProcessingCount

Not billed

Submission failure (Top-level Success = false, for example: invalid parameter or undetermined brand)

Billed

status = no_match and status = failed consume the same collection and recognition computing power and are billed per submission (ProcessingCount = 1).

6. Constraints

Item

Constraint

Processing period

A task submitted on Day T can be queried starting from Day T+3.5. This interface does not provide minute-level results and is not suitable for a real-time pipeline.

Task state persistence

You must persist TaskId, ItemId, and SubmittedAt yourself. The server does not provide an API to retrieve tasks by ItemId.

Input image

The product main image must be accessible from the public network. If hotlink protection is enabled, provide a URL with no Referer restrictions or a direct OSS link. Otherwise, the task ends with a FAILED / failed status.

Output format

Output assets are in SVG format only. Conversion to PNG or JPG is not supported.

Asset retention period

Assets are retained for 7 days after their creation. Please save them promptly after retrieving their URLs.

Out of scope

The following features are not supported: text-to-image generation from scratch (due to insufficient numerical fidelity, as a single sizing error can cause product returns); a standalone similar-item collection service; and slicing long detail images.