{
  "openapi": "3.1.0",
  "info": {
    "title": "Runware API - P-Image-Try-On",
    "summary": "Virtual try-on image model for dressing a person in one or more reference garments while preserving identity and pose",
    "description": "P-Image-Try-On is an image editing model from Pruna AI for virtual try-on workflows. It takes a source image of a person together with one or more garment reference images and generates a new image in which the person is realistically dressed in the provided garments. The model is built to preserve identity, pose, body shape, and the overall structure of the original image, making it useful for fashion previews, e-commerce visualization, styling exploration, and other garment-transfer workflows.",
    "version": "1.0.0",
    "x-model-id": "prunaai-p-image-try-on",
    "x-air-id": "prunaai:p-image@try-on",
    "x-status": "live",
    "x-creator": {
      "id": "prunaai",
      "name": "Pruna AI",
      "logo": "https://assets.runware.ai/9d2bd33f-144d-4a7f-8caf-fed8a74614b7.png"
    },
    "x-capabilities": [
      "image-to-image",
      "edit",
      "checkpoint"
    ],
    "x-released-at": "2026-06-18T00:00:00Z",
    "x-cover-image": "https://assets.runware.ai/covers/prunaai-p-image-try-on.jpg",
    "x-pricing": {
      "overview": "$0.015 for the first garment, $0.008 for each additional one",
      "examples": [
        {
          "configuration": "First garment",
          "price": "$0.015"
        },
        {
          "configuration": "2 garments",
          "price": "$0.023"
        },
        {
          "configuration": "3 garments",
          "price": "$0.031"
        }
      ]
    }
  },
  "servers": [
    {
      "url": "https://api.runware.ai/v1",
      "description": "Runware REST API"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Runware API Key (e.g., Bearer <your-key>)"
      }
    },
    "schemas": {
      "AuthenticationTask": {
        "title": "Authentication",
        "description": "Authenticates a connection using an API key. Can be sent as the first element of the request array as an alternative to using the Authorization header.",
        "type": "object",
        "x-response-schema": "https://schemas.runware.ai/responses/utilities/authentication.json",
        "properties": {
          "taskType": {
            "$id": "https://schemas.runware.ai/requests/parameters/api/task-type.json",
            "title": "Task Type",
            "description": "Identifier for the type of task being performed",
            "type": "string",
            "const": "authentication"
          },
          "apiKey": {
            "$id": "https://schemas.runware.ai/requests/parameters/authentication/api-key.json",
            "title": "API Key",
            "description": "Your Runware API key.",
            "type": "string"
          },
          "connectionSessionUUID": {
            "$id": "https://schemas.runware.ai/requests/parameters/authentication/connection-session-uuid.json",
            "title": "Connection Session UUID",
            "description": "Optional session UUID to resume a previous connection and receive any buffered results.",
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "taskType",
          "apiKey"
        ],
        "additionalProperties": false
      },
      "RequestBody": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "model": {
              "title": "Model",
              "description": "Identifier of the model to use for generation.",
              "type": "string",
              "const": "prunaai:p-image@try-on"
            },
            "inputs": {
              "title": "Inputs",
              "description": "The unified payload wrapper for complex media assets dictating image, video or audio inference constraints.",
              "type": "object",
              "properties": {
                "referenceImages": {
                  "title": "Reference Images",
                  "description": "List of reference images (UUID, URL, Data URI, or Base64).",
                  "type": "array",
                  "minItems": 2,
                  "items": {
                    "type": "object",
                    "properties": {
                      "image": {
                        "title": "Image",
                        "description": "Image input (UUID, URL, Data URI, or Base64).",
                        "type": "string",
                        "anyOf": [
                          {
                            "format": "uuid"
                          },
                          {
                            "format": "uri"
                          },
                          {
                            "pattern": "^data:image\\/[a-zA-Z]+;base64,[a-zA-Z0-9+/=]+$"
                          },
                          {
                            "pattern": "^[a-zA-Z0-9+/=]+$"
                          }
                        ]
                      },
                      "role": {
                        "type": "string",
                        "title": "Role",
                        "description": "Role of the image in the virtual try-on process. Use exactly one `person`, one to eleven `garment`, and optionally one `pose`.",
                        "enum": [
                          "person",
                          "garment",
                          "pose"
                        ]
                      }
                    },
                    "required": [
                      "image",
                      "role"
                    ],
                    "title": "Image",
                    "description": "Image input (UUID, URL, Data URI, or Base64).",
                    "additionalProperties": false
                  },
                  "maxItems": 13,
                  "allOf": [
                    {
                      "contains": {
                        "properties": {
                          "role": {
                            "const": "person"
                          }
                        },
                        "required": [
                          "role"
                        ]
                      },
                      "maxContains": 1,
                      "minContains": 1
                    },
                    {
                      "contains": {
                        "properties": {
                          "role": {
                            "const": "garment"
                          }
                        },
                        "required": [
                          "role"
                        ]
                      },
                      "maxContains": 11,
                      "minContains": 1
                    },
                    {
                      "contains": {
                        "properties": {
                          "role": {
                            "const": "pose"
                          }
                        },
                        "required": [
                          "role"
                        ]
                      },
                      "maxContains": 1,
                      "minContains": 0
                    }
                  ]
                }
              },
              "required": [
                "referenceImages"
              ],
              "additionalProperties": false
            },
            "positivePrompt": {
              "title": "Positive Prompt",
              "description": "Experimental guidance for non-flatlay garment images, for example which garment from which image to use.",
              "type": "string"
            },
            "seed": {
              "title": "Seed",
              "description": "Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9223372036854776000
            },
            "settings": {
              "title": "Settings",
              "description": "Global inference settings.",
              "type": "object",
              "properties": {
                "preserveInputSize": {
                  "type": "boolean",
                  "title": "Preserve Input Size",
                  "description": "Return the output at the original input resolution. When disabled, the output keeps the model's internal working resolution, which may differ from the input because inputs are dynamically resized for quality and speed.",
                  "default": true
                },
                "turbo": {
                  "title": "Turbo",
                  "description": "Enable turbo mode for faster generation. May reduce subtle details in complex tasks.",
                  "type": "boolean",
                  "default": false
                }
              },
              "additionalProperties": false
            },
            "taskType": {
              "title": "Task Type",
              "description": "Identifier for the type of task being performed",
              "type": "string",
              "const": "imageInference"
            },
            "taskUUID": {
              "title": "Task UUID",
              "description": "UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.",
              "type": "string",
              "format": "uuid"
            },
            "webhookURL": {
              "title": "Webhook URL",
              "description": "Specifies a webhook URL where JSON responses will be sent via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.",
              "type": "string",
              "format": "uri"
            },
            "includeCost": {
              "title": "Include Cost",
              "description": "Include task cost in the response.",
              "type": "boolean",
              "default": false
            },
            "numberResults": {
              "title": "Number of Results",
              "description": "Number of results to generate. Each result uses a different seed, producing variations of the same parameters.",
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "maximum": 20
            },
            "uploadEndpoint": {
              "title": "Upload Endpoint",
              "description": "Specifies a URL where the generated content will be automatically uploaded using the HTTP PUT method. The raw binary data of the media file is sent directly as the request body. For secure uploads to cloud storage, use presigned URLs that include temporary authentication credentials.\n\n**Common use cases:**\n\n- **Cloud storage**: Upload directly to S3 buckets, Google Cloud Storage, or Azure Blob Storage using presigned URLs.\n- **CDN integration**: Upload to content delivery networks for immediate distribution.\n\n```text\n// S3 presigned URL for secure upload\nhttps://your-bucket.s3.amazonaws.com/generated/content.mp4?X-Amz-Signature=abc123&X-Amz-Expires=3600\n\n// Google Cloud Storage presigned URL\nhttps://storage.googleapis.com/your-bucket/content.jpg?X-Goog-Signature=xyz789\n\n// Custom storage endpoint\nhttps://storage.example.com/uploads/generated-image.jpg\n```\n\nThe content data will be sent as the request body to the specified URL when generation is complete.\n\n[Read full documentation](https://runware.ai/docs/models/prunaai-p-image-try-on#uploadEndpoint)",
              "type": "string",
              "format": "uri"
            },
            "ttl": {
              "title": "TTL",
              "description": "Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.",
              "type": "integer",
              "minimum": 60
            },
            "outputType": {
              "title": "Output Type",
              "description": "Image output type.",
              "type": "string",
              "enum": [
                "URL",
                "base64Data",
                "dataURI"
              ],
              "default": "URL"
            },
            "outputFormat": {
              "title": "Output Format",
              "description": "Specifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities.\n\n- \\`JPG\\`: Best for photorealistic images with smaller file sizes (no transparency).\n- \\`PNG\\`: Lossless compression, supports high quality and transparency (alpha channel).\n- \\`WEBP\\`: Modern format providing superior compression and transparency support.\n- \\`MP4\\`: Widely supported video container (H.264), recommended for general use.\n- \\`WEBM\\`: Optimized for web delivery.\n- \\`MOV\\`: QuickTime format, common in professional workflows (Apple ecosystem).\n- \\`GIF\\`: Animated image format (no audio), suitable for short loops or previews.\n- \\`MP3\\`: Compressed audio, smaller file size.\n- \\`WAV\\`: Uncompressed, high-quality audio.\n- \\`FLAC\\`: Lossless compression.\n- \\`OGG\\`: Open-source compressed audio format (Vorbis codec).\n- \\`SVG\\`: Scalable Vector Graphics.\n- \\`TIFF\\`: High-quality output supporting layers.\n- \\`GLB\\`: Binary glTF format for 3D models, including geometry, textures, and PBR materials.\n\n> [!NOTE]\n> \\*\\*Transparency\\*\\*: If you are using features like background removal or LayerDiffuse that require transparency, you must select a format that supports an alpha channel (e.g., \\`PNG\\`, \\`WEBP\\`, \\`TIFF\\`). \\`JPG\\` does not support transparency.\n\n[Read full documentation](https://runware.ai/docs/models/prunaai-p-image-try-on#outputFormat)",
              "type": "string",
              "enum": [
                "JPG",
                "PNG",
                "WEBP"
              ],
              "default": "JPG"
            },
            "outputQuality": {
              "title": "Output Quality",
              "description": "Compression quality of the output. Higher values preserve quality but increase file size.",
              "type": "integer",
              "minimum": 20,
              "maximum": 99,
              "default": 95
            },
            "deliveryMethod": {
              "title": "Delivery Method",
              "description": "Determines how the API delivers task results.",
              "type": "string",
              "oneOf": [
                {
                  "const": "sync",
                  "description": "Returns complete results directly in the API response."
                },
                {
                  "const": "async",
                  "description": "Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse."
                }
              ],
              "default": "sync"
            },
            "safety": {
              "type": "object",
              "title": "Safety Settings",
              "description": "Content safety checking configuration for image generation.",
              "properties": {
                "checkContent": {
                  "title": "Check Content",
                  "description": "Enable or disable content safety checking.",
                  "type": "boolean",
                  "default": false
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "inputs",
            "taskType",
            "taskUUID",
            "model"
          ],
          "additionalProperties": false
        },
        "description": "You must always POST an array of task objects."
      },
      "ResponseBody": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Unknown response structure"
            }
          }
        }
      },
      "ErrorResponse": {
        "title": "Error Response",
        "description": "Standard error response returned by the Runware API.",
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "additionalProperties": true,
              "properties": {
                "code": {
                  "type": "string",
                  "description": "A short identifier for the error (e.g., invalidApiKey, timeoutProvider)."
                },
                "message": {
                  "type": "string",
                  "description": "A human-readable explanation of what went wrong."
                },
                "parameter": {
                  "type": "string",
                  "description": "The request parameter related to the error, if applicable."
                },
                "taskType": {
                  "type": "string",
                  "description": "The task type of the request that failed."
                },
                "taskUUID": {
                  "type": "string",
                  "description": "The unique identifier of the failed request."
                },
                "documentation": {
                  "type": "string",
                  "description": "A link to relevant documentation."
                }
              }
            }
          }
        },
        "required": [
          "errors"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/": {
      "post": {
        "summary": "Run P-Image-Try-On",
        "description": "P-Image-Try-On is an image editing model from Pruna AI for virtual try-on workflows. It takes a source image of a person together with one or more garment reference images and generates a new image in which the person is realistically dressed in the provided garments. The model is built to preserve identity, pose, body shape, and the overall structure of the original image, making it useful for fashion previews, e-commerce visualization, styling exploration, and other garment-transfer workflows.",
        "operationId": "run_prunaai_p_image_try_on",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — Missing or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — No valid API key provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — Insufficient account balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — The API key lacks permissions for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server Error — Something went wrong on Runware's end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable — Temporarily unavailable (maintenance or capacity).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ]
}