typefile
{
"garment_images": [
"https://replicate.delivery/pbxt/PI6gzf5rL1KgfnLhtkEXRkW05lipG7S8rgRjX1dlzmLQgl2E/tmpc_r9xgn2.png"
],
"no_op": false,
"output_format": "jpg",
"output_quality": 95,
"person_image": "https://replicate.delivery/pbxt/PI6gzygH4k2tDugMX3gZd80To55K1O3Og0sS4d2XYN0FB6bp/ig_0d3024fffdd6f918016a324f6c18788191b799b0e5b7b0cd08.png",
"preserve_input_size": true,
"prompt": "",
"turbo": false
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_agf**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run prunaai/p-image-try-on using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"prunaai/p-image-try-on:6aaa4749ee142241dfa3bf5736f9e8d16e0796d4452e450ba2e92e40cf7e676a",
{
input: {
garment_images: ["https://replicate.delivery/pbxt/PI6gzf5rL1KgfnLhtkEXRkW05lipG7S8rgRjX1dlzmLQgl2E/tmpc_r9xgn2.png"],
no_op: false,
output_format: "jpg",
output_quality: 95,
person_image: "https://replicate.delivery/pbxt/PI6gzygH4k2tDugMX3gZd80To55K1O3Og0sS4d2XYN0FB6bp/ig_0d3024fffdd6f918016a324f6c18788191b799b0e5b7b0cd08.png",
preserve_input_size: true,
prompt: "",
turbo: false
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_agf**********************************
This is your API token. Keep it to yourself.
import replicate
Run prunaai/p-image-try-on using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"prunaai/p-image-try-on:6aaa4749ee142241dfa3bf5736f9e8d16e0796d4452e450ba2e92e40cf7e676a",
input={
"garment_images": ["https://replicate.delivery/pbxt/PI6gzf5rL1KgfnLhtkEXRkW05lipG7S8rgRjX1dlzmLQgl2E/tmpc_r9xgn2.png"],
"no_op": False,
"output_format": "jpg",
"output_quality": 95,
"person_image": "https://replicate.delivery/pbxt/PI6gzygH4k2tDugMX3gZd80To55K1O3Og0sS4d2XYN0FB6bp/ig_0d3024fffdd6f918016a324f6c18788191b799b0e5b7b0cd08.png",
"preserve_input_size": True,
"prompt": "",
"turbo": False
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_agf**********************************
This is your API token. Keep it to yourself.
Run prunaai/p-image-try-on using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "prunaai/p-image-try-on:6aaa4749ee142241dfa3bf5736f9e8d16e0796d4452e450ba2e92e40cf7e676a",
"input": {
"garment_images": ["https://replicate.delivery/pbxt/PI6gzf5rL1KgfnLhtkEXRkW05lipG7S8rgRjX1dlzmLQgl2E/tmpc_r9xgn2.png"],
"no_op": false,
"output_format": "jpg",
"output_quality": 95,
"person_image": "https://replicate.delivery/pbxt/PI6gzygH4k2tDugMX3gZd80To55K1O3Og0sS4d2XYN0FB6bp/ig_0d3024fffdd6f918016a324f6c18788191b799b0e5b7b0cd08.png",
"preserve_input_size": true,
"prompt": "",
"turbo": false
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "g9hd22x26drmr0cytmtsx11c5g",
"model": "prunaai/p-image-try-on",
"version": "6aaa4749ee142241dfa3bf5736f9e8d16e0796d4452e450ba2e92e40cf7e676a",
"input": {
"garment_images": [
"https://replicate.delivery/pbxt/PI6gzf5rL1KgfnLhtkEXRkW05lipG7S8rgRjX1dlzmLQgl2E/tmpc_r9xgn2.png"
],
"no_op": false,
"output_format": "jpg",
"output_quality": 95,
"person_image": "https://replicate.delivery/pbxt/PI6gzygH4k2tDugMX3gZd80To55K1O3Og0sS4d2XYN0FB6bp/ig_0d3024fffdd6f918016a324f6c18788191b799b0e5b7b0cd08.png",
"preserve_input_size": true,
"prompt": "",
"turbo": false
},
"logs": "",
"output": "https://replicate.delivery/xezq/gNH1vQuPEublOZVk8Xuh5fjrLQjzKm6fXff29WW1I3DIxLAbB/out-0.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2026-06-17T10:52:02.483Z",
"started_at": "2026-06-17T10:55:04.951833Z",
"completed_at": "2026-06-17T10:55:14.045614Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/g9hd22x26drmr0cytmtsx11c5g/cancel",
"get": "https://api.replicate.com/v1/predictions/g9hd22x26drmr0cytmtsx11c5g",
"stream": "https://stream.replicate.com/v1/files/jbxs-yqrbugj6j37ncrni6cuqkghtkherd2zemqnpqidi7s3xttnee5cq",
"web": "https://replicate.com/p/g9hd22x26drmr0cytmtsx11c5g"
},
"metrics": {
"billing.image_input_count": 1,
"billing.image_input_megapixel_count": 1,
"image_input_count": 1,
"image_input_megapixel_count": 1,
"image_output_count": 1,
"num_groups": 1,
"predict_time": 9.093781004,
"seed": 788563,
"total_time": 191.56261417
}
}

