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:55:56.408716Z",
"created_at": "2022-03-12T03:55:49.115902Z",
"data_removed": false,
"error": null,
"id": "tti4zrhheras7d4yhl6uersdnq",
"input": {
"sleep": 0.1
},
"logs": null,
"metrics": {
"predict_time": 4.159725,
"total_time": 7.292814
},
"output": [
"https://replicate.delivery/mgxm/4d2991e3-c837-44d0-ae12-86e0072822d4/haiku.png",
"https://replicate.delivery/mgxm/22bfa0f1-08dd-4684-83a7-1a07803613cf/haiku.png",
"https://replicate.delivery/mgxm/5f6ce938-751b-4d23-bf68-71702993c771/haiku.png",
"https://replicate.delivery/mgxm/86ddb9d2-277e-4747-9ad3-664e05811733/haiku.png",
"https://replicate.delivery/mgxm/6fce674d-da0d-4309-8805-a9be853e5462/haiku.png",
"https://replicate.delivery/mgxm/edbdbbc8-92bd-4ca0-8087-bce866b0c682/haiku.png",
"https://replicate.delivery/mgxm/a5fd31d7-5773-4fdf-83f2-a4402716a576/haiku.png",
"https://replicate.delivery/mgxm/3b66927d-8514-43e7-8555-3cba9eab4e72/haiku.png",
"https://replicate.delivery/mgxm/7438db8a-60e3-4078-89ce-845370c94e9c/haiku.png"
],
"started_at": "2022-03-12T03:55:52.248991Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/tti4zrhheras7d4yhl6uersdnq",
"cancel": "https://api.replicate.com/v1/predictions/tti4zrhheras7d4yhl6uersdnq/cancel"
},
"version": "edfd14dd31e0d6550528d82c4f61f6988d710ba8920fc2021c3888686012c149"
}