typetext
{
"guidance_scale": 1.5,
"num_frames": 151,
"num_inference_steps": 8,
"prompt": "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes wide with interest. The playful yet serene atmosphere is complemented by soft natural light filtering through the petals. Mid-shot, warm and cheerful tones.",
"seed": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ffw**********************************
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 jzhang38/fast-mochi using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jzhang38/fast-mochi:518162c93efc747d0a57a447db3f97a49e8d93f1c484dc2b7e3dadfacb1112db",
{
input: {
guidance_scale: 1.5,
num_frames: 151,
num_inference_steps: 8,
prompt: "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes wide with interest. The playful yet serene atmosphere is complemented by soft natural light filtering through the petals. Mid-shot, warm and cheerful tones.",
seed: 1024
}
}
);
// 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.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ffw**********************************
This is your API token. Keep it to yourself.
import replicate
Run jzhang38/fast-mochi using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jzhang38/fast-mochi:518162c93efc747d0a57a447db3f97a49e8d93f1c484dc2b7e3dadfacb1112db",
input={
"guidance_scale": 1.5,
"num_frames": 151,
"num_inference_steps": 8,
"prompt": "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes wide with interest. The playful yet serene atmosphere is complemented by soft natural light filtering through the petals. Mid-shot, warm and cheerful tones.",
"seed": 1024
}
)
# 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.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ffw**********************************
This is your API token. Keep it to yourself.
Run jzhang38/fast-mochi 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": "jzhang38/fast-mochi:518162c93efc747d0a57a447db3f97a49e8d93f1c484dc2b7e3dadfacb1112db",
"input": {
"guidance_scale": 1.5,
"num_frames": 151,
"num_inference_steps": 8,
"prompt": "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes wide with interest. The playful yet serene atmosphere is complemented by soft natural light filtering through the petals. Mid-shot, warm and cheerful tones.",
"seed": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "2khzfa8zcsrme0ckv2xab6tjrg",
"model": "jzhang38/fast-mochi",
"version": "518162c93efc747d0a57a447db3f97a49e8d93f1c484dc2b7e3dadfacb1112db",
"input": {
"guidance_scale": 1.5,
"num_frames": 151,
"num_inference_steps": 8,
"prompt": "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes wide with interest. The playful yet serene atmosphere is complemented by soft natural light filtering through the petals. Mid-shot, warm and cheerful tones.",
"seed": 1024
},
"logs": "Using seed: 1024\n 0%| | 0/8 [00:00<?, ?it/s]\n 12%|█▎ | 1/8 [00:23<02:45, 23.59s/it]\n 25%|██▌ | 2/8 [00:32<01:29, 14.94s/it]\n 38%|███▊ | 3/8 [00:41<01:01, 12.26s/it]\n 50%|█████ | 4/8 [00:50<00:43, 10.99s/it]\n 62%|██████▎ | 5/8 [00:59<00:30, 10.31s/it]\n 75%|███████▌ | 6/8 [01:08<00:19, 9.88s/it]\n 88%|████████▊ | 7/8 [01:17<00:09, 9.62s/it]\n100%|██████████| 8/8 [01:26<00:00, 9.44s/it]\n100%|██████████| 8/8 [01:26<00:00, 10.86s/it]",
"output": "https://replicate.delivery/xezq/MbBivDvuld71DZ19cX1tO1HxF3Gm84Dmmn8lqMeezZ5xAD8TA/output.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-18T07:44:56.678Z",
"started_at": "2024-12-18T07:45:55.638621Z",
"completed_at": "2024-12-18T07:48:01.433077Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/2khzfa8zcsrme0ckv2xab6tjrg/cancel",
"get": "https://api.replicate.com/v1/predictions/2khzfa8zcsrme0ckv2xab6tjrg",
"stream": "https://stream.replicate.com/v1/files/bcwr-ub2vozr4jts4aczhttqs2zbm7liqmozmsmqd43hjc5hevd2n2p5q",
"web": "https://replicate.com/p/2khzfa8zcsrme0ckv2xab6tjrg"
},
"metrics": {
"predict_time": 125.794456267,
"total_time": 184.755077
}
}