Prediction
hexiaochun/video2img:bbdd539be788f2f31e9b52ab2bf1e1122b5f8248daba017ba6925a2519a98d68ID
fhk0a86xtdrge0cheehth2c31w
Status
Succeeded
Source
Web
Hardware
CPU
Total duration
Created
Input
- video
- percentage
- 64
{
"video": "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4",
"percentage": 64
}
Install Replicate’s Node.js client library:
npm install replicate
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run hexiaochun/video2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"hexiaochun/video2img:bbdd539be788f2f31e9b52ab2bf1e1122b5f8248daba017ba6925a2519a98d68",
{
input: {
video: "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4",
percentage: 64
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:
pip install replicate
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:
import replicate
Run hexiaochun/video2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"hexiaochun/video2img:bbdd539be788f2f31e9b52ab2bf1e1122b5f8248daba017ba6925a2519a98d68",
input={
"video": "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4",
"percentage": 64
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run hexiaochun/video2img 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": "hexiaochun/video2img:bbdd539be788f2f31e9b52ab2bf1e1122b5f8248daba017ba6925a2519a98d68",
"input": {
"video": "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4",
"percentage": 64
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{
"completed_at": "2024-08-21T06:34:19.361711Z",
"created_at": "2024-08-21T06:33:24.691000Z",
"data_removed": false,
"error": null,
"id": "fhk0a86xtdrge0cheehth2c31w",
"input": {
"video": "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4",
"percentage": 64
},
"logs": null,
"metrics": {
"predict_time": 3.255977772,
"total_time": 54.670711
},
"output": "https://replicate.delivery/czjl/j9mjSMew7TyzOaTYGcZUvfy3zZUDXoFWDhlzkxyeIdbWjnpmA/0cd2fe2c-d884-4b68-a4af-7d32ffcdb714.jpg",
"started_at": "2024-08-21T06:34:16.105733Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/fhk0a86xtdrge0cheehth2c31w",
"cancel": "https://api.replicate.com/v1/predictions/fhk0a86xtdrge0cheehth2c31w/cancel"
},
"version": "bbdd539be788f2f31e9b52ab2bf1e1122b5f8248daba017ba6925a2519a98d68"
}