defaultsunset over a lake in the mountains
typetext
{
"n_predictions": 9,
"prompt": "illustration of a baby shark swimming through corals"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Qtb**********************************
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: "illustration of a baby shark swimming through corals"
}
}
);
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_Qtb**********************************
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": "illustration of a baby shark swimming through corals"
}
)
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_Qtb**********************************
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": "illustration of a baby shark swimming through corals"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "k4vfq7bbswnwyjmlj2ar73f46a",
"model": "borisdayma/dalle-mini",
"version": "2e3975b1692cd6aecac28616dba364cc9f1e30c610c6efd62dbe9b9c7d1d03ea",
"input": {
"n_predictions": 9,
"prompt": "illustration of a baby shark swimming through corals"
},
"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/KzmToPivpRZLBVwP0fMVDkDF6FMNh5HFUMLgp7AUrzzpEdpIA/output_0.png"
},
{
"image": "https://replicate.delivery/pbxt/tmo7lYfnNOyvYCfL9Ak6zbM2g9ryItSlnwNlPEK8f0DmS0liA/output_1.png"
},
{
"image": "https://replicate.delivery/pbxt/pCP1I6cOg8onCdeAATYeZEtUTTTQsEGrTex9Wq3fyfzfUiuUE/output_2.png"
},
{
"image": "https://replicate.delivery/pbxt/Krnn3hY2syZ5GFelPTeNCSAf6VlVNQOoGjme5miz571NloLFB/output_3.png"
},
{
"image": "https://replicate.delivery/pbxt/ZffzHDSeV7MlXIxpaAeZ6qffr9WG4mwSeex6zQ1r0iRSTJ6SRA/output_4.png"
},
{
"image": "https://replicate.delivery/pbxt/mserA3ZzRI3ddS1qkewRIIBMSjKG6iGTaJ4yIejfmdlMloLFB/output_5.png"
},
{
"image": "https://replicate.delivery/pbxt/bZbO27ptigp2OxoffP1oBhpYK7kvKkCYiSNB5dL6vvNTJ6SRA/output_6.png"
},
{
"image": "https://replicate.delivery/pbxt/Me1d5GiuF6X2fkgFdQdGT3r46TfYX0a8EbSZEffXxUEmKRXKC/output_7.png"
},
{
"image": "https://replicate.delivery/pbxt/0EZ5VUeiHetXzE7DEhm45Bixee5XHPShxwQlfkHaLlbiKRXKC/output_8.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-24T03:26:56.322359Z",
"started_at": "2023-07-24T03:29:29.495047Z",
"completed_at": "2023-07-24T03:30:28.431405Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/k4vfq7bbswnwyjmlj2ar73f46a/cancel",
"get": "https://api.replicate.com/v1/predictions/k4vfq7bbswnwyjmlj2ar73f46a"
},
"metrics": {
"predict_time": 58.936358,
"total_time": 212.109046
}
}