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:f1973a38
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:f1973a38f17fef0342672a40f80ae79695fdda735a1a9faa49c94f9dbf15b8c3",
{
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:f1973a38f17fef0342672a40f80ae79695fdda735a1a9faa49c94f9dbf15b8c3",
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:f1973a38f17fef0342672a40f80ae79695fdda735a1a9faa49c94f9dbf15b8c3",
"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-12T04:19:02.987987Z",
"created_at": "2022-03-12T04:18:44.171566Z",
"data_removed": false,
"error": null,
"id": "f4jupgdhs5d6pk2huwhyseeu4a",
"input": {
"sleep": 0.1
},
"logs": null,
"metrics": {
"predict_time": 15.688604,
"total_time": 18.816421
},
"output": [
"https://replicate.delivery/mgxm/1dcb446a-4c3a-43ec-bc35-777e5ee25ca2/haiku.png",
"https://replicate.delivery/mgxm/ad95a3d5-0f49-435d-bc8d-89a488d04fe1/haiku.png",
"https://replicate.delivery/mgxm/67b6d71a-63d9-4e4f-95c5-829144aa6ec7/haiku.png",
"https://replicate.delivery/mgxm/acd0837f-bdcc-4933-b578-ab8c07dcc384/haiku.png",
"https://replicate.delivery/mgxm/45527811-c72d-406b-8796-747d3661e481/haiku.png",
"https://replicate.delivery/mgxm/86f68666-be90-44cb-b654-566373f97de8/haiku.png",
"https://replicate.delivery/mgxm/a41ea2cc-ba81-4013-8faf-c0a556755ed1/haiku.png"
],
"started_at": "2022-03-12T04:18:47.299383Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/f4jupgdhs5d6pk2huwhyseeu4a",
"cancel": "https://api.replicate.com/v1/predictions/f4jupgdhs5d6pk2huwhyseeu4a/cancel"
},
"version": "f1973a38f17fef0342672a40f80ae79695fdda735a1a9faa49c94f9dbf15b8c3"
}