Recolor API

Recolor API

The Recolor API allows you to programmatically change garment colors in your generated images.

Endpoints

Core endpoints for garment recoloring integration.

POST

Create Recolor Task

Initiate a new recoloring process for an existing model or pose task.

Parameters

  • pose_image_generation_idRequired
    ID of the base pose task.
  • models_image_generation_task_idRequired
    ID of the base model task.
  • color_changesRequired
    Array of objects with 'target' (garment name) and 'color' (hex or name).

    + Show child attributes

    color_changes.targetstring

    The specific garment to recolor (e.g., 'blouse', 'lehenga').

    color_changes.colorstring

    The target color as a descriptive string or hex code (e.g., 'royal blue', '#0000ff').

  • image_qualityOptional
    '2k' or '4k'. (Default is '2k' if not specified).
POST/v4/models/multipose-image-recolor/
Request

Headers

x-api-key: "YOUR_API_KEY"

Body (JSON)

{
  "pose_image_generation_id": 936,
  "color_changes": [
    {"target": "blouse", "color": "royal blue"},
    {"target": "lehenga", "color": "royal blue"}
  ],
  "image_quality": "2k"
}
200 OKResponse
{
  "id": 501,
  "status": "queued",
  "created_at": "2024-05-05T12:00:00Z"
}
GET

Poll for Task Status & Results

Because AI image generation is asynchronous, you must poll the server (e.g., every 3-5 seconds) to get the final image.

Task Statuses

queued/pending: Task is in the queue.
processing: AI is currently generating the image.
completed: The response will contain the result URL.
failed: Check the response for error details.
GET/v2/models/multipose-tasks/{task_id}/
Request

Headers

x-api-key: "YOUR_API_KEY"

200 OKResponse
{
  "id": 501,
  "status": "completed",
  "result_url": "https://cdn.vtryon.com/res/..."
}
GET

Get All Recolor Tasks

Retrieve status and results for recolor generation tasks.

Parameters

  • pageOptional
    The page number to retrieve (e.g., page=1).
  • page_sizeOptional
    The number of items to return per page (e.g., page_size=10).
GET/v4/models/multipose-image-recolor/
Request

Headers

x-api-key: "YOUR_API_KEY"

200 OKResponse
{
  "count": 1,
  "next": null,
  "results": [
    {
      "id": 501,
      "status": "completed",
      "result_url": "https://cdn.vtryon.com/res/..."
    }
  ]
}
DELETE

Delete Recolor Task

Permanently deletes a specific recolor generation task using its ID.

Parameters

  • task_idRequired
    Unique ID of the recolor task to delete.
DELETE/v2/models/multipose-tasks/{task_id}/
Request

Headers

x-api-key: "YOUR_API_KEY"

200 OKResponse
{
  "detail": "Deleted successfully"
}

What's Next?

Master the Vtryon API to build your own custom fashion applications.