defaultsunset over a lake in the mountains
typetext
{
"n_predictions": 9,
"prompt": "white snow covered mountain under blue sky during daytime"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_B5m**********************************
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: "white snow covered mountain under blue sky during daytime"
}
}
);
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_B5m**********************************
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": "white snow covered mountain under blue sky during daytime"
}
)
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_B5m**********************************
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": "white snow covered mountain under blue sky during daytime"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "cjglp4zbjn6kwv3pzr7zdwjnje",
"model": "borisdayma/dalle-mini",
"version": "2e3975b1692cd6aecac28616dba364cc9f1e30c610c6efd62dbe9b9c7d1d03ea",
"input": {
"n_predictions": 9,
"prompt": "white snow covered mountain under blue sky during daytime"
},
"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/eLnpJbSxU4V7VCesvb5QRuiAVc5qe47PKckWSWAyxjeghoLFB/output_0.png"
},
{
"image": "https://replicate.delivery/pbxt/HGPb46eqYRRdUi2HR8yrljEjemrld1sBJKloYazopf9wQ0liA/output_1.png"
},
{
"image": "https://replicate.delivery/pbxt/h1XaayGz7f3JRCbFTWRAYOHXp9eLkIoeefKsLFWff8tAMEdpIA/output_2.png"
},
{
"image": "https://replicate.delivery/pbxt/JqtePze7b2laIUpFK5m9ov83WvtKHfLo6ddC8WcokUFxQ0liA/output_3.png"
},
{
"image": "https://replicate.delivery/pbxt/Y1vvxILQdKZNIBCXtlcZd8CRDgfiXHkHoOD6jUyYs7FMEdpIA/output_4.png"
},
{
"image": "https://replicate.delivery/pbxt/2QReTPki9ryYCC2PvgjExUjYJRwz0oTPntkUJfe6LHLxQ0liA/output_5.png"
},
{
"image": "https://replicate.delivery/pbxt/7MO94DHqOMrhMZtEqekbsqZHYE27Z0iD9hCkNlgyrv2MEdpIA/output_6.png"
},
{
"image": "https://replicate.delivery/pbxt/qdCpf7sNZU3XW6SexVzwfVdPuJlOWszCWlxZKq5BZbzzQ0liA/output_7.png"
},
{
"image": "https://replicate.delivery/pbxt/lGdMWXQYdaIzNZ93zAB3h8eF2WhW8ucWOHXVZmZ74rkMEdpIA/output_8.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-24T03:24:29.336213Z",
"started_at": "2023-07-24T03:28:20.46317Z",
"completed_at": "2023-07-24T03:29:29.464878Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/cjglp4zbjn6kwv3pzr7zdwjnje/cancel",
"get": "https://api.replicate.com/v1/predictions/cjglp4zbjn6kwv3pzr7zdwjnje"
},
"metrics": {
"predict_time": 69.001708,
"total_time": 300.128665
}
}