defaultsunset over a lake in the mountains
typetext
{
"n_predictions": 9,
"prompt": "cartoon carrot with big eyes"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dOW**********************************
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: "cartoon carrot with big eyes"
}
}
);
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_dOW**********************************
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": "cartoon carrot with big eyes"
}
)
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_dOW**********************************
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": "cartoon carrot with big eyes"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "dlr6gfzbmgx47d7cah63apuxuy",
"model": "borisdayma/dalle-mini",
"version": "2e3975b1692cd6aecac28616dba364cc9f1e30c610c6efd62dbe9b9c7d1d03ea",
"input": {
"n_predictions": 9,
"prompt": "cartoon carrot with big eyes"
},
"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/ylWtarwimR6aPJytWSKQLRg43fMDxZbJ0ubA56JLDIraEdpIA/output_0.png"
},
{
"image": "https://replicate.delivery/pbxt/sUgipPeNnkU1YqhLCjuLUfHXbH8Re4xy4lfAtJIB3wJbjoLFB/output_1.png"
},
{
"image": "https://replicate.delivery/pbxt/RYH73Qjb8mbUCNRJ7VY0stXH6EjxWmTPIANGweKLezF2I6SRA/output_2.png"
},
{
"image": "https://replicate.delivery/pbxt/fv6kSfpeTzNLHIBFK9N1eBPaFnqPBUxGApxxOovYPAcajoLFB/output_3.png"
},
{
"image": "https://replicate.delivery/pbxt/PmZVfnRPo92WbS0ZxWs02wSbGJWKAD9EsyjPqbLMT5XbEdpIA/output_4.png"
},
{
"image": "https://replicate.delivery/pbxt/ZEkQefjsuHseQoAKiCmlrylWr91WjTLA4422hxSJYwVsR0liA/output_5.png"
},
{
"image": "https://replicate.delivery/pbxt/5BjCCuXNofQRXqLzavahN0cTKPRBfBm28apNfptHB5eZjoLFB/output_6.png"
},
{
"image": "https://replicate.delivery/pbxt/ueu3p1xx1sXFTqYYLlW8RIcBJ3NBDH2PF05rAOpezO62I6SRA/output_7.png"
},
{
"image": "https://replicate.delivery/pbxt/YfYrjmMcUJWtYSRSxD5qwGMeuxiZoyVjROYIee1IBN1eGRXKC/output_8.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-24T03:25:08.651736Z",
"started_at": "2023-07-24T03:28:48.864938Z",
"completed_at": "2023-07-24T03:29:59.187051Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dlr6gfzbmgx47d7cah63apuxuy/cancel",
"get": "https://api.replicate.com/v1/predictions/dlr6gfzbmgx47d7cah63apuxuy"
},
"metrics": {
"predict_time": 70.322113,
"total_time": 290.535315
}
}