defaultAn astronaut riding a horse
typetext
{
"fps": 8,
"num_frames": 50,
"num_inference_steps": 50,
"prompt": "A panda eating bamboo on a rock."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_UMv**********************************
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 cjwbw/damo-text-to-video using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/damo-text-to-video:1e205ea73084bd17a0a3b43396e49ba0d6bc2e754e9283b2df49fad2dcf95755",
{
input: {
fps: 8,
num_frames: 50,
num_inference_steps: 50,
prompt: "A panda eating bamboo on a rock."
}
}
);
// 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_UMv**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/damo-text-to-video using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/damo-text-to-video:1e205ea73084bd17a0a3b43396e49ba0d6bc2e754e9283b2df49fad2dcf95755",
input={
"fps": 8,
"num_frames": 50,
"num_inference_steps": 50,
"prompt": "A panda eating bamboo on a rock."
}
)
# 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_UMv**********************************
This is your API token. Keep it to yourself.
Run cjwbw/damo-text-to-video 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": "cjwbw/damo-text-to-video:1e205ea73084bd17a0a3b43396e49ba0d6bc2e754e9283b2df49fad2dcf95755",
"input": {
"fps": 8,
"num_frames": 50,
"num_inference_steps": 50,
"prompt": "A panda eating bamboo on a rock."
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "kfg5ftkjmzbt3jfpajv4r4bz6m",
"model": "cjwbw/damo-text-to-video",
"version": "1e205ea73084bd17a0a3b43396e49ba0d6bc2e754e9283b2df49fad2dcf95755",
"input": {
"fps": 8,
"num_frames": 50,
"num_inference_steps": 50,
"prompt": "A panda eating bamboo on a rock."
},
"logs": "Using seed: 8502\n 0%| | 0/50 [00:00<?, ?it/s]\n 2%|▏ | 1/50 [00:04<03:29, 4.27s/it]\n 4%|▍ | 2/50 [00:07<02:46, 3.47s/it]\n 6%|▌ | 3/50 [00:10<02:31, 3.23s/it]\n 8%|▊ | 4/50 [00:13<02:23, 3.12s/it]\n 10%|█ | 5/50 [00:16<02:17, 3.06s/it]\n 12%|█▏ | 6/50 [00:19<02:13, 3.03s/it]\n 14%|█▍ | 7/50 [00:22<02:10, 3.03s/it]\n 16%|█▌ | 8/50 [00:25<02:07, 3.02s/it]\n 18%|█▊ | 9/50 [00:28<02:03, 3.02s/it]\n 20%|██ | 10/50 [00:31<02:00, 3.02s/it]\n 22%|██▏ | 11/50 [00:34<01:57, 3.01s/it]\n 24%|██▍ | 12/50 [00:37<01:54, 3.00s/it]\n 26%|██▌ | 13/50 [00:40<01:50, 2.99s/it]\n 28%|██▊ | 14/50 [00:43<01:47, 2.99s/it]\n 30%|███ | 15/50 [00:45<01:44, 2.99s/it]\n 32%|███▏ | 16/50 [00:48<01:41, 2.98s/it]\n 34%|███▍ | 17/50 [00:51<01:38, 2.97s/it]\n 36%|███▌ | 18/50 [00:54<01:34, 2.96s/it]\n 38%|███▊ | 19/50 [00:57<01:31, 2.95s/it]\n 40%|████ | 20/50 [01:00<01:28, 2.94s/it]\n 42%|████▏ | 21/50 [01:03<01:25, 2.94s/it]\n 44%|████▍ | 22/50 [01:06<01:22, 2.93s/it]\n 46%|████▌ | 23/50 [01:09<01:19, 2.93s/it]\n 48%|████▊ | 24/50 [01:12<01:16, 2.92s/it]\n 50%|█████ | 25/50 [01:15<01:13, 2.92s/it]\n 52%|█████▏ | 26/50 [01:18<01:10, 2.92s/it]\n 54%|█████▍ | 27/50 [01:21<01:07, 2.92s/it]\n 56%|█████▌ | 28/50 [01:24<01:04, 2.92s/it]\n 58%|█████▊ | 29/50 [01:26<01:01, 2.92s/it]\n 60%|██████ | 30/50 [01:29<00:58, 2.92s/it]\n 62%|██████▏ | 31/50 [01:32<00:55, 2.93s/it]\n 64%|██████▍ | 32/50 [01:35<00:52, 2.93s/it]\n 66%|██████▌ | 33/50 [01:38<00:49, 2.93s/it]\n 68%|██████▊ | 34/50 [01:41<00:47, 2.94s/it]\n 70%|███████ | 35/50 [01:44<00:44, 2.95s/it]\n 72%|███████▏ | 36/50 [01:47<00:41, 2.95s/it]\n 74%|███████▍ | 37/50 [01:50<00:38, 2.95s/it]\n 76%|███████▌ | 38/50 [01:53<00:35, 2.96s/it]\n 78%|███████▊ | 39/50 [01:56<00:32, 2.96s/it]\n 80%|████████ | 40/50 [01:59<00:29, 2.96s/it]\n 82%|████████▏ | 41/50 [02:02<00:26, 2.97s/it]\n 84%|████████▍ | 42/50 [02:05<00:23, 2.98s/it]\n 86%|████████▌ | 43/50 [02:08<00:20, 2.98s/it]\n 88%|████████▊ | 44/50 [02:11<00:17, 2.98s/it]\n 90%|█████████ | 45/50 [02:14<00:14, 2.98s/it]\n 92%|█████████▏| 46/50 [02:17<00:11, 2.97s/it]\n 94%|█████████▍| 47/50 [02:20<00:08, 2.97s/it]\n 96%|█████████▌| 48/50 [02:23<00:05, 2.96s/it]\n 98%|█████████▊| 49/50 [02:26<00:02, 2.95s/it]\n100%|██████████| 50/50 [02:29<00:00, 2.95s/it]\n100%|██████████| 50/50 [02:29<00:00, 2.98s/it]",
"output": "https://replicate.delivery/pbxt/0KtGrmSHZM5eGy2kXndo7DmKfg5MS9pPf7TaM9iIKVxN1QVhA/out.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-03-23T22:32:07.478436Z",
"started_at": "2023-03-23T22:34:51.742948Z",
"completed_at": "2023-03-23T22:37:27.583925Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/kfg5ftkjmzbt3jfpajv4r4bz6m/cancel",
"get": "https://api.replicate.com/v1/predictions/kfg5ftkjmzbt3jfpajv4r4bz6m"
},
"metrics": {
"predict_time": 155.840977,
"total_time": 320.105489
}
}