typefile
{
"image": "https://replicate.delivery/pbxt/MYTyYKwXa8uARHYGYpDv1Kxmea1La0Xoiog5gQ22eaE4GCM2/0.png",
"num_images_per_prompt": 1,
"num_inference_steps": 20,
"padding": 0.15,
"prompt": "",
"seed": 92
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_CmH**********************************
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 impetusdesign/sxn-trd using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"impetusdesign/sxn-trd:e1663b7ef15439c40a53b3709745219f7acfd33364a025f04e70e646f356aa45",
{
input: {
image: "https://replicate.delivery/pbxt/MYTyYKwXa8uARHYGYpDv1Kxmea1La0Xoiog5gQ22eaE4GCM2/0.png",
num_images_per_prompt: 1,
num_inference_steps: 20,
padding: 0.15,
prompt: "",
seed: 92
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_CmH**********************************
This is your API token. Keep it to yourself.
import replicate
Run impetusdesign/sxn-trd using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"impetusdesign/sxn-trd:e1663b7ef15439c40a53b3709745219f7acfd33364a025f04e70e646f356aa45",
input={
"image": "https://replicate.delivery/pbxt/MYTyYKwXa8uARHYGYpDv1Kxmea1La0Xoiog5gQ22eaE4GCM2/0.png",
"num_images_per_prompt": 1,
"num_inference_steps": 20,
"padding": 0.15,
"prompt": "",
"seed": 92
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].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_CmH**********************************
This is your API token. Keep it to yourself.
Run impetusdesign/sxn-trd 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": "impetusdesign/sxn-trd:e1663b7ef15439c40a53b3709745219f7acfd33364a025f04e70e646f356aa45",
"input": {
"image": "https://replicate.delivery/pbxt/MYTyYKwXa8uARHYGYpDv1Kxmea1La0Xoiog5gQ22eaE4GCM2/0.png",
"num_images_per_prompt": 1,
"num_inference_steps": 20,
"padding": 0.15,
"prompt": "",
"seed": 92
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "1vggk9ds7srj60cn70xvkb987m",
"model": "impetusdesign/sxn-trd",
"version": "e1663b7ef15439c40a53b3709745219f7acfd33364a025f04e70e646f356aa45",
"input": {
"image": "https://replicate.delivery/pbxt/MYTyYKwXa8uARHYGYpDv1Kxmea1La0Xoiog5gQ22eaE4GCM2/0.png",
"num_images_per_prompt": 1,
"num_inference_steps": 20,
"padding": 0.15,
"prompt": "",
"seed": 92
},
"logs": "0%| | 0/19 [00:00<?, ?it/s]\n 5%|▌ | 1/19 [00:00<00:04, 4.00it/s]\n 16%|█▌ | 3/19 [00:00<00:02, 7.89it/s]\n 21%|██ | 4/19 [00:00<00:01, 8.38it/s]\n 26%|██▋ | 5/19 [00:00<00:01, 8.74it/s]\n 32%|███▏ | 6/19 [00:00<00:01, 9.00it/s]\n 37%|███▋ | 7/19 [00:00<00:01, 9.16it/s]\n 42%|████▏ | 8/19 [00:00<00:01, 9.28it/s]\n 47%|████▋ | 9/19 [00:01<00:01, 9.37it/s]\n 53%|█████▎ | 10/19 [00:01<00:00, 9.43it/s]\n 58%|█████▊ | 11/19 [00:01<00:00, 9.47it/s]\n 63%|██████▎ | 12/19 [00:01<00:00, 9.51it/s]\n 68%|██████▊ | 13/19 [00:01<00:00, 9.54it/s]\n 74%|███████▎ | 14/19 [00:01<00:00, 9.56it/s]\n 79%|███████▉ | 15/19 [00:01<00:00, 9.55it/s]\n 84%|████████▍ | 16/19 [00:01<00:00, 9.54it/s]\n 89%|████████▉ | 17/19 [00:01<00:00, 9.53it/s]\n 95%|█████████▍| 18/19 [00:01<00:00, 9.54it/s]\n100%|██████████| 19/19 [00:02<00:00, 9.56it/s]\n100%|██████████| 19/19 [00:02<00:00, 9.09it/s]",
"output": [
"https://replicate.delivery/yhqm/6IroTfL1kvW0aqOwVVDsegvq4D5YFvdKlBs1qmVxAtq9xiSUA/output_0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-24T13:53:13.022Z",
"started_at": "2025-02-24T13:56:09.70071Z",
"completed_at": "2025-02-24T13:56:13.646235Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/1vggk9ds7srj60cn70xvkb987m/cancel",
"get": "https://api.replicate.com/v1/predictions/1vggk9ds7srj60cn70xvkb987m",
"stream": "https://stream.replicate.com/v1/files/yswh-anp5vbaudbu7o7swp5ev2kg7e4ku6pn7pfzfrekhavfbw3stcbfq",
"web": "https://replicate.com/p/1vggk9ds7srj60cn70xvkb987m"
},
"metrics": {
"predict_time": 3.945524672,
"total_time": 180.624235
}
}
