typenumeric
value typeinteger
{
"image": "https://replicate.delivery/pbxt/Ie1kGdCYbdUwm0ql8bL1BT61MtmbYPwWazKBS0ooCqqWq1Wd/turtle.png",
"prompt": "Cute turtle",
"seed": 1,
"steps": 20
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_TQU**********************************
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 greeneryscenery/sheeps-control-v4 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"greeneryscenery/sheeps-control-v4:19632a95f72bc6d1112e9b70303aad7d3651cbcec5b8c3539ad9131227a75fd1",
{
input: {
image: "https://replicate.delivery/pbxt/Ie1kGdCYbdUwm0ql8bL1BT61MtmbYPwWazKBS0ooCqqWq1Wd/turtle.png",
prompt: "Cute turtle",
seed: 1,
steps: 20
}
}
);
// 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_TQU**********************************
This is your API token. Keep it to yourself.
import replicate
Run greeneryscenery/sheeps-control-v4 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"greeneryscenery/sheeps-control-v4:19632a95f72bc6d1112e9b70303aad7d3651cbcec5b8c3539ad9131227a75fd1",
input={
"image": "https://replicate.delivery/pbxt/Ie1kGdCYbdUwm0ql8bL1BT61MtmbYPwWazKBS0ooCqqWq1Wd/turtle.png",
"prompt": "Cute turtle",
"seed": 1,
"steps": 20
}
)
# 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_TQU**********************************
This is your API token. Keep it to yourself.
Run greeneryscenery/sheeps-control-v4 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": "greeneryscenery/sheeps-control-v4:19632a95f72bc6d1112e9b70303aad7d3651cbcec5b8c3539ad9131227a75fd1",
"input": {
"image": "https://replicate.delivery/pbxt/Ie1kGdCYbdUwm0ql8bL1BT61MtmbYPwWazKBS0ooCqqWq1Wd/turtle.png",
"prompt": "Cute turtle",
"seed": 1,
"steps": 20
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "2uv7unz7jfhbpkblqu6rwfm2se",
"model": "greeneryscenery/sheeps-control-v4",
"version": "19632a95f72bc6d1112e9b70303aad7d3651cbcec5b8c3539ad9131227a75fd1",
"input": {
"image": "https://replicate.delivery/pbxt/Ie1kGdCYbdUwm0ql8bL1BT61MtmbYPwWazKBS0ooCqqWq1Wd/turtle.png",
"prompt": "Cute turtle",
"seed": 1,
"steps": 20
},
"logs": "0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:18, 1.03it/s]\n 10%|█ | 2/20 [00:01<00:08, 2.15it/s]\n 20%|██ | 4/20 [00:01<00:03, 4.27it/s]\n 30%|███ | 6/20 [00:01<00:02, 5.94it/s]\n 40%|████ | 8/20 [00:01<00:01, 7.23it/s]\n 50%|█████ | 10/20 [00:01<00:01, 8.08it/s]\n 60%|██████ | 12/20 [00:02<00:00, 8.78it/s]\n 70%|███████ | 14/20 [00:02<00:00, 9.31it/s]\n 80%|████████ | 16/20 [00:02<00:00, 9.56it/s]\n 90%|█████████ | 18/20 [00:02<00:00, 9.63it/s]\n100%|██████████| 20/20 [00:02<00:00, 9.68it/s]\n100%|██████████| 20/20 [00:02<00:00, 7.05it/s]",
"output": "https://replicate.delivery/pbxt/hRAWKtAtuQovChhbFwkMpOIheoYV5a3p4GsGyyI4WNHQQtYIA/image.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-04-13T12:31:23.846152Z",
"started_at": "2023-04-13T12:31:23.95726Z",
"completed_at": "2023-04-13T12:31:28.24074Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/2uv7unz7jfhbpkblqu6rwfm2se/cancel",
"get": "https://api.replicate.com/v1/predictions/2uv7unz7jfhbpkblqu6rwfm2se"
},
"metrics": {
"predict_time": 4.28348,
"total_time": 4.394588
}
}
