defaultsunset over a lake in the mountains
typetext
{
"n_predictions": 9,
"prompt": "an armchair in the shape of an avocado"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_9CN**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run borisdayma/dalle-mini using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"borisdayma/dalle-mini:2e3975b1692cd6aecac28616dba364cc9f1e30c610c6efd62dbe9b9c7d1d03ea",
{
input: {
n_predictions: 9,
prompt: "an armchair in the shape of an avocado"
}
}
);
console.log(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_9CN**********************************
This is your API token. Keep it to yourself.
import replicate
Run borisdayma/dalle-mini using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"borisdayma/dalle-mini:2e3975b1692cd6aecac28616dba364cc9f1e30c610c6efd62dbe9b9c7d1d03ea",
input={
"n_predictions": 9,
"prompt": "an armchair in the shape of an avocado"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_9CN**********************************
This is your API token. Keep it to yourself.
Run borisdayma/dalle-mini 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": "borisdayma/dalle-mini:2e3975b1692cd6aecac28616dba364cc9f1e30c610c6efd62dbe9b9c7d1d03ea",
"input": {
"n_predictions": 9,
"prompt": "an armchair in the shape of an avocado"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "6rgocrrbrmzybbjyovel4ob354",
"model": "borisdayma/dalle-mini",
"version": "2e3975b1692cd6aecac28616dba364cc9f1e30c610c6efd62dbe9b9c7d1d03ea",
"input": {
"n_predictions": 9,
"prompt": "an armchair in the shape of an avocado"
},
"logs": "Tokenizing prompt...\nGenerating images...\n/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/jax/_src/tree_util.py:188: FutureWarning: jax.tree_util.tree_multimap() is deprecated. Please use jax.tree_util.tree_map() instead as a drop-in replacement.\nwarnings.warn('jax.tree_util.tree_multimap() is deprecated. Please use jax.tree_util.tree_map() '",
"output": [
{
"image": "https://replicate.delivery/pbxt/DJ8zOfCn5s2EGqE41rRO8efjsrDdtQIe9wSA1bqYKX2DioLFB/output_0.png"
},
{
"image": "https://replicate.delivery/pbxt/4GJRctngUSasIJu49wYfeexqJJkeW467ZMvTfudRyGvNERXKC/output_1.png"
},
{
"image": "https://replicate.delivery/pbxt/j2PgPtFpdorLHxnoldItTftanyXYb6dVCmMdBQKCn3fhI6SRA/output_2.png"
},
{
"image": "https://replicate.delivery/pbxt/ZlpZFTympEbxAN97TNXqB2p90heZdOE7Eu3Apyl6bwrQEdpIA/output_3.png"
},
{
"image": "https://replicate.delivery/pbxt/cBVVbQDSUVpyEpzGydgGJYZVOPZiOalCZJXaB5mMxKbIiuUE/output_4.png"
},
{
"image": "https://replicate.delivery/pbxt/5XaazbhIli5qPBfUkyHk5Se3RlfPLDt9xhf8ghLCJm4FioLFB/output_5.png"
},
{
"image": "https://replicate.delivery/pbxt/XZ7IbK1FLrZTLZzuWzfNaSsA1J4AaqCQlqeSfE9D0JrCR0liA/output_6.png"
},
{
"image": "https://replicate.delivery/pbxt/jixoC6ucQlpQDRkpvRDNjCevHmyGYy1HaxMBzyCgFanQEdpIA/output_7.png"
},
{
"image": "https://replicate.delivery/pbxt/Ixe16YkcZ4RaNSYHQOaKT2eeoAMj9N1dIXQGQFczxFpFR0liA/output_8.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-24T03:24:51.898554Z",
"started_at": "2023-07-24T03:28:28.470691Z",
"completed_at": "2023-07-24T03:29:38.242959Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/6rgocrrbrmzybbjyovel4ob354/cancel",
"get": "https://api.replicate.com/v1/predictions/6rgocrrbrmzybbjyovel4ob354"
},
"metrics": {
"predict_time": 69.772268,
"total_time": 286.344405
}
}