typefile
{
"image1": "https://replicate.delivery/pbxt/JYUwgFNQbajoEQxvkJIPjDfIpE5Pj51iSfeU8CaYe1896Hyk/generatedimg_4_43531b30-b813-4226-9d5a-a80b5a29f613_1695126618.png",
"image2": "https://replicate.delivery/pbxt/JYUwgCRwYFmMbVAK0RmU5ftY6zg86x6zjTrLG9Bq3abzB6Mw/generatedimg_2_466bb97d-67eb-406a-8a20-2aeb975ea45c_1695134551.png",
"prompt": "A deer shaped clock"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_AgH**********************************
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 charlesmccarthy/blend-images using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"charlesmccarthy/blend-images:1ed8aaaa04fa84f0c1191679e765d209b94866f6503038416dcbcb340fede892",
{
input: {
image1: "https://replicate.delivery/pbxt/JYUwgFNQbajoEQxvkJIPjDfIpE5Pj51iSfeU8CaYe1896Hyk/generatedimg_4_43531b30-b813-4226-9d5a-a80b5a29f613_1695126618.png",
image2: "https://replicate.delivery/pbxt/JYUwgCRwYFmMbVAK0RmU5ftY6zg86x6zjTrLG9Bq3abzB6Mw/generatedimg_2_466bb97d-67eb-406a-8a20-2aeb975ea45c_1695134551.png",
prompt: "A deer shaped clock"
}
}
);
// 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_AgH**********************************
This is your API token. Keep it to yourself.
import replicate
Run charlesmccarthy/blend-images using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"charlesmccarthy/blend-images:1ed8aaaa04fa84f0c1191679e765d209b94866f6503038416dcbcb340fede892",
input={
"image1": "https://replicate.delivery/pbxt/JYUwgFNQbajoEQxvkJIPjDfIpE5Pj51iSfeU8CaYe1896Hyk/generatedimg_4_43531b30-b813-4226-9d5a-a80b5a29f613_1695126618.png",
"image2": "https://replicate.delivery/pbxt/JYUwgCRwYFmMbVAK0RmU5ftY6zg86x6zjTrLG9Bq3abzB6Mw/generatedimg_2_466bb97d-67eb-406a-8a20-2aeb975ea45c_1695134551.png",
"prompt": "A deer shaped clock"
}
)
# 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_AgH**********************************
This is your API token. Keep it to yourself.
Run charlesmccarthy/blend-images 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": "charlesmccarthy/blend-images:1ed8aaaa04fa84f0c1191679e765d209b94866f6503038416dcbcb340fede892",
"input": {
"image1": "https://replicate.delivery/pbxt/JYUwgFNQbajoEQxvkJIPjDfIpE5Pj51iSfeU8CaYe1896Hyk/generatedimg_4_43531b30-b813-4226-9d5a-a80b5a29f613_1695126618.png",
"image2": "https://replicate.delivery/pbxt/JYUwgCRwYFmMbVAK0RmU5ftY6zg86x6zjTrLG9Bq3abzB6Mw/generatedimg_2_466bb97d-67eb-406a-8a20-2aeb975ea45c_1695134551.png",
"prompt": "A deer shaped clock"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "y6fgly3be4x5erx5sxj2ekhwxa",
"model": "charlesmccarthy/blend-images",
"version": "1ed8aaaa04fa84f0c1191679e765d209b94866f6503038416dcbcb340fede892",
"input": {
"image1": "https://replicate.delivery/pbxt/JYUwgFNQbajoEQxvkJIPjDfIpE5Pj51iSfeU8CaYe1896Hyk/generatedimg_4_43531b30-b813-4226-9d5a-a80b5a29f613_1695126618.png",
"image2": "https://replicate.delivery/pbxt/JYUwgCRwYFmMbVAK0RmU5ftY6zg86x6zjTrLG9Bq3abzB6Mw/generatedimg_2_466bb97d-67eb-406a-8a20-2aeb975ea45c_1695134551.png",
"prompt": "A deer shaped clock"
},
"logs": "0%| | 0/25 [00:00<?, ?it/s]\n 32%|███▏ | 8/25 [00:00<00:00, 74.16it/s]\n 64%|██████▍ | 16/25 [00:00<00:00, 76.68it/s]\n 96%|█████████▌| 24/25 [00:00<00:00, 77.78it/s]\n100%|██████████| 25/25 [00:00<00:00, 77.27it/s]\n 0%| | 0/25 [00:00<?, ?it/s]\n 32%|███▏ | 8/25 [00:00<00:00, 78.77it/s]\n 64%|██████▍ | 16/25 [00:00<00:00, 76.97it/s]\n 96%|█████████▌| 24/25 [00:00<00:00, 76.73it/s]\n100%|██████████| 25/25 [00:00<00:00, 77.01it/s]\n 0%| | 0/100 [00:00<?, ?it/s]\n 1%| | 1/100 [00:00<00:12, 7.84it/s]\n 2%|▏ | 2/100 [00:00<00:12, 7.79it/s]\n 3%|▎ | 3/100 [00:00<00:12, 7.77it/s]\n 4%|▍ | 4/100 [00:00<00:12, 7.76it/s]\n 5%|▌ | 5/100 [00:00<00:12, 7.77it/s]\n 6%|▌ | 6/100 [00:00<00:12, 7.78it/s]\n 7%|▋ | 7/100 [00:00<00:11, 7.77it/s]\n 8%|▊ | 8/100 [00:01<00:11, 7.77it/s]\n 9%|▉ | 9/100 [00:01<00:11, 7.76it/s]\n 10%|█ | 10/100 [00:01<00:11, 7.76it/s]\n 11%|█ | 11/100 [00:01<00:11, 7.76it/s]\n 12%|█▏ | 12/100 [00:01<00:11, 7.76it/s]\n 13%|█▎ | 13/100 [00:01<00:11, 7.75it/s]\n 14%|█▍ | 14/100 [00:01<00:11, 7.75it/s]\n 15%|█▌ | 15/100 [00:01<00:10, 7.75it/s]\n 16%|█▌ | 16/100 [00:02<00:10, 7.76it/s]\n 17%|█▋ | 17/100 [00:02<00:10, 7.76it/s]\n 18%|█▊ | 18/100 [00:02<00:10, 7.75it/s]\n 19%|█▉ | 19/100 [00:02<00:10, 7.75it/s]\n 20%|██ | 20/100 [00:02<00:10, 7.75it/s]\n 21%|██ | 21/100 [00:02<00:10, 7.76it/s]\n 22%|██▏ | 22/100 [00:02<00:10, 7.75it/s]\n 23%|██▎ | 23/100 [00:02<00:09, 7.75it/s]\n 24%|██▍ | 24/100 [00:03<00:09, 7.76it/s]\n 25%|██▌ | 25/100 [00:03<00:09, 7.76it/s]\n 26%|██▌ | 26/100 [00:03<00:09, 7.76it/s]\n 27%|██▋ | 27/100 [00:03<00:09, 7.76it/s]\n 28%|██▊ | 28/100 [00:03<00:09, 7.75it/s]\n 29%|██▉ | 29/100 [00:03<00:09, 7.75it/s]\n 30%|███ | 30/100 [00:03<00:09, 7.75it/s]\n 31%|███ | 31/100 [00:03<00:08, 7.74it/s]\n 32%|███▏ | 32/100 [00:04<00:08, 7.74it/s]\n 33%|███▎ | 33/100 [00:04<00:08, 7.74it/s]\n 34%|███▍ | 34/100 [00:04<00:08, 7.75it/s]\n 35%|███▌ | 35/100 [00:04<00:08, 7.75it/s]\n 36%|███▌ | 36/100 [00:04<00:08, 7.75it/s]\n 37%|███▋ | 37/100 [00:04<00:08, 7.75it/s]\n 38%|███▊ | 38/100 [00:04<00:08, 7.75it/s]\n 39%|███▉ | 39/100 [00:05<00:07, 7.75it/s]\n 40%|████ | 40/100 [00:05<00:07, 7.75it/s]\n 41%|████ | 41/100 [00:05<00:07, 7.75it/s]\n 42%|████▏ | 42/100 [00:05<00:07, 7.74it/s]\n 43%|████▎ | 43/100 [00:05<00:07, 7.73it/s]\n 44%|████▍ | 44/100 [00:05<00:07, 7.73it/s]\n 45%|████▌ | 45/100 [00:05<00:07, 7.73it/s]\n 46%|████▌ | 46/100 [00:05<00:06, 7.73it/s]\n 47%|████▋ | 47/100 [00:06<00:06, 7.74it/s]\n 48%|████▊ | 48/100 [00:06<00:06, 7.74it/s]\n 49%|████▉ | 49/100 [00:06<00:06, 7.74it/s]\n 50%|█████ | 50/100 [00:06<00:06, 7.75it/s]\n 51%|█████ | 51/100 [00:06<00:06, 7.75it/s]\n 52%|█████▏ | 52/100 [00:06<00:06, 7.75it/s]\n 53%|█████▎ | 53/100 [00:06<00:06, 7.74it/s]\n 54%|█████▍ | 54/100 [00:06<00:05, 7.74it/s]\n 55%|█████▌ | 55/100 [00:07<00:05, 7.74it/s]\n 56%|█████▌ | 56/100 [00:07<00:05, 7.74it/s]\n 57%|█████▋ | 57/100 [00:07<00:05, 7.74it/s]\n 58%|█████▊ | 58/100 [00:07<00:05, 7.74it/s]\n 59%|█████▉ | 59/100 [00:07<00:05, 7.74it/s]\n 60%|██████ | 60/100 [00:07<00:05, 7.74it/s]\n 61%|██████ | 61/100 [00:07<00:05, 7.74it/s]\n 62%|██████▏ | 62/100 [00:08<00:04, 7.74it/s]\n 63%|██████▎ | 63/100 [00:08<00:04, 7.74it/s]\n 64%|██████▍ | 64/100 [00:08<00:04, 7.74it/s]\n 65%|██████▌ | 65/100 [00:08<00:04, 7.74it/s]\n 66%|██████▌ | 66/100 [00:08<00:04, 7.74it/s]\n 67%|██████▋ | 67/100 [00:08<00:04, 7.74it/s]\n 68%|██████▊ | 68/100 [00:08<00:04, 7.73it/s]\n 69%|██████▉ | 69/100 [00:08<00:04, 7.72it/s]\n 70%|███████ | 70/100 [00:09<00:03, 7.72it/s]\n 71%|███████ | 71/100 [00:09<00:03, 7.73it/s]\n 72%|███████▏ | 72/100 [00:09<00:03, 7.72it/s]\n 73%|███████▎ | 73/100 [00:09<00:03, 7.72it/s]\n 74%|███████▍ | 74/100 [00:09<00:03, 7.72it/s]\n 75%|███████▌ | 75/100 [00:09<00:03, 7.72it/s]\n 76%|███████▌ | 76/100 [00:09<00:03, 7.73it/s]\n 77%|███████▋ | 77/100 [00:09<00:02, 7.74it/s]\n 78%|███████▊ | 78/100 [00:10<00:02, 7.73it/s]\n 79%|███████▉ | 79/100 [00:10<00:02, 7.74it/s]\n 80%|████████ | 80/100 [00:10<00:02, 7.74it/s]\n 81%|████████ | 81/100 [00:10<00:02, 7.73it/s]\n 82%|████████▏ | 82/100 [00:10<00:02, 7.73it/s]\n 83%|████████▎ | 83/100 [00:10<00:02, 7.73it/s]\n 84%|████████▍ | 84/100 [00:10<00:02, 7.73it/s]\n 85%|████████▌ | 85/100 [00:10<00:01, 7.73it/s]\n 86%|████████▌ | 86/100 [00:11<00:01, 7.72it/s]\n 87%|████████▋ | 87/100 [00:11<00:01, 7.71it/s]\n 88%|████████▊ | 88/100 [00:11<00:01, 7.72it/s]\n 89%|████████▉ | 89/100 [00:11<00:01, 7.72it/s]\n 90%|█████████ | 90/100 [00:11<00:01, 7.72it/s]\n 91%|█████████ | 91/100 [00:11<00:01, 7.73it/s]\n 92%|█████████▏| 92/100 [00:11<00:01, 7.73it/s]\n 93%|█████████▎| 93/100 [00:12<00:00, 7.73it/s]\n 94%|█████████▍| 94/100 [00:12<00:00, 7.74it/s]\n 95%|█████████▌| 95/100 [00:12<00:00, 7.74it/s]\n 96%|█████████▌| 96/100 [00:12<00:00, 7.73it/s]\n 97%|█████████▋| 97/100 [00:12<00:00, 7.74it/s]\n 98%|█████████▊| 98/100 [00:12<00:00, 7.74it/s]\n 99%|█████████▉| 99/100 [00:12<00:00, 7.73it/s]\n100%|██████████| 100/100 [00:12<00:00, 7.73it/s]\n100%|██████████| 100/100 [00:12<00:00, 7.74it/s]",
"output": "https://pbxt.replicate.delivery/jWpveeiis2oXLE4cmnTu5l2SpfKGdbqKBbLAHgBDFykqzsLjA/output.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-09-19T14:44:58.838855Z",
"started_at": "2023-09-19T14:47:01.217908Z",
"completed_at": "2023-09-19T14:47:18.855162Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/y6fgly3be4x5erx5sxj2ekhwxa/cancel",
"get": "https://api.replicate.com/v1/predictions/y6fgly3be4x5erx5sxj2ekhwxa"
},
"metrics": {
"predict_time": 17.637254,
"total_time": 140.016307
}
}

