defaultDali painting of WALL·E
typetext
{
"grid_size": "5",
"progressive_outputs": true,
"supercondition_factor": "16",
"temperature": "1",
"text": "Moai statue giving a TED talk",
"top_k": "128"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_4ay**********************************
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 kuprel/min-dalle using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"kuprel/min-dalle:888c72d60932bca21344efcfdaecb3f0fbeb4bf40ee9ec601cc8fda806b5bfd9",
{
input: {
grid_size: "5",
progressive_outputs: true,
supercondition_factor: "16",
temperature: "1",
text: "Moai statue giving a TED talk",
top_k: "128"
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_4ay**********************************
This is your API token. Keep it to yourself.
import replicate
Run kuprel/min-dalle using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"kuprel/min-dalle:888c72d60932bca21344efcfdaecb3f0fbeb4bf40ee9ec601cc8fda806b5bfd9",
input={
"grid_size": "5",
"progressive_outputs": True,
"supercondition_factor": "16",
"temperature": "1",
"text": "Moai statue giving a TED talk",
"top_k": "128"
}
)
# The kuprel/min-dalle model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/kuprel/min-dalle/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_4ay**********************************
This is your API token. Keep it to yourself.
Run kuprel/min-dalle 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": "kuprel/min-dalle:888c72d60932bca21344efcfdaecb3f0fbeb4bf40ee9ec601cc8fda806b5bfd9",
"input": {
"grid_size": "5",
"progressive_outputs": true,
"supercondition_factor": "16",
"temperature": "1",
"text": "Moai statue giving a TED talk",
"top_k": "128"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "drkg55flvjet3ooohc524kvfg4",
"model": "kuprel/min-dalle",
"version": "888c72d60932bca21344efcfdaecb3f0fbeb4bf40ee9ec601cc8fda806b5bfd9",
"input": {
"grid_size": "5",
"progressive_outputs": true,
"supercondition_factor": "16",
"temperature": "1",
"text": "Moai statue giving a TED talk",
"top_k": "128"
},
"logs": "tokenizing text\n['Ġmo', 'ai']\n['Ġstatue']\n['Ġgiving']\n['Ġa']\n['Ġted']\n['Ġtalk']\n9 text tokens [0, 924, 336, 4039, 8658, 58, 5678, 2727, 2]\nencoding text tokens\ndetokenizing image\ndetokenizing image\ndetokenizing image\ndetokenizing image\ndetokenizing image\ndetokenizing image\ndetokenizing image\ndetokenizing image",
"output": [
"https://replicate.delivery/mgxm/7d78edb7-c91a-4ccc-9734-125953840fac/moai-statue-giving-a-ted-talk-iter-1.jpg",
"https://replicate.delivery/mgxm/8644d51a-c196-4896-89f0-9b8f04779e2f/moai-statue-giving-a-ted-talk-iter-2.jpg",
"https://replicate.delivery/mgxm/9e1c9724-d8b5-429a-aaad-90288d1ac4ab/moai-statue-giving-a-ted-talk-iter-3.jpg",
"https://replicate.delivery/mgxm/3ae242e9-5d5e-4784-bfc7-79c0051d902f/moai-statue-giving-a-ted-talk-iter-4.jpg",
"https://replicate.delivery/mgxm/e48cd201-4260-40bb-8632-21da067246b8/moai-statue-giving-a-ted-talk-iter-5.jpg",
"https://replicate.delivery/mgxm/0eb4d55e-e427-4db4-92e1-682f07563076/moai-statue-giving-a-ted-talk-iter-6.jpg",
"https://replicate.delivery/mgxm/04bc6fb5-c1c4-4f3f-9ee9-f140a9f62412/moai-statue-giving-a-ted-talk-iter-7.jpg",
"https://replicate.delivery/mgxm/b5ecd545-efca-46ae-8496-786ad16be61b/moai-statue-giving-a-ted-talk.jpg"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-07-25T00:37:05.490728Z",
"started_at": "2022-07-25T00:37:05.69284Z",
"completed_at": "2022-07-25T00:37:21.840787Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/drkg55flvjet3ooohc524kvfg4/cancel",
"get": "https://api.replicate.com/v1/predictions/drkg55flvjet3ooohc524kvfg4"
},
"metrics": {
"predict_time": 16.147947,
"total_time": 16.350059
}
}