Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
zeke /haiku-progressive-image:edfd14dd
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run zeke/haiku-progressive-image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"zeke/haiku-progressive-image:edfd14dd31e0d6550528d82c4f61f6988d710ba8920fc2021c3888686012c149",
{
input: {
sleep: 0.1
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run zeke/haiku-progressive-image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"zeke/haiku-progressive-image:edfd14dd31e0d6550528d82c4f61f6988d710ba8920fc2021c3888686012c149",
input={
"sleep": 0.1
}
)
# The zeke/haiku-progressive-image 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/zeke/haiku-progressive-image/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=<paste-your-token-here>
Find your API token in your account settings.
Run zeke/haiku-progressive-image 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": "zeke/haiku-progressive-image:edfd14dd31e0d6550528d82c4f61f6988d710ba8920fc2021c3888686012c149",
"input": {
"sleep": 0.1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{
"completed_at": "2022-03-12T03:57:54.219606Z",
"created_at": "2022-03-12T03:57:48.604305Z",
"data_removed": false,
"error": null,
"id": "rft6m6m3zna5zlhtfikcpvmb3y",
"input": {
"sleep": 0.1
},
"logs": null,
"metrics": {
"predict_time": 5.467007,
"total_time": 5.615301
},
"output": [
"https://replicate.delivery/mgxm/5077b603-07f1-4318-bc2d-44d7ff19d19c/haiku.png",
"https://replicate.delivery/mgxm/61c64d69-5633-4ebb-8fef-b49f22fa9703/haiku.png",
"https://replicate.delivery/mgxm/4b0fc52a-eb0f-4c8e-a1f9-b82cee43c344/haiku.png",
"https://replicate.delivery/mgxm/9c3c1406-fc74-464e-b68c-891173c129d4/haiku.png",
"https://replicate.delivery/mgxm/968e1a0e-ba96-472b-be94-14ae0fc05c85/haiku.png",
"https://replicate.delivery/mgxm/045938c9-e094-4de4-81be-d59cd96d7c9c/haiku.png",
"https://replicate.delivery/mgxm/3d113adf-f2f0-4df8-8907-9c532ba3342e/haiku.png",
"https://replicate.delivery/mgxm/6e277ed1-e43d-4b4c-8007-39561aa72145/haiku.png",
"https://replicate.delivery/mgxm/b84ade38-d941-41c7-90dc-eaa08aba4b80/haiku.png",
"https://replicate.delivery/mgxm/1845017a-ffdc-4f42-b624-091993eb4d18/haiku.png"
],
"started_at": "2022-03-12T03:57:48.752599Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/rft6m6m3zna5zlhtfikcpvmb3y",
"cancel": "https://api.replicate.com/v1/predictions/rft6m6m3zna5zlhtfikcpvmb3y/cancel"
},
"version": "edfd14dd31e0d6550528d82c4f61f6988d710ba8920fc2021c3888686012c149"
}