typefile
{
"diffusion_prompt": "a shiny silver robotic wolf",
"fps": 20,
"guidance_scale": 7.5,
"height": 512,
"inversion_prompt": "",
"n_frames": 40,
"negative_diffusion_prompt": "ugly, blurry, low res, unrealistic, unaesthetic",
"num_diffusion_steps": 50,
"num_inversion_steps": 50,
"video": "https://replicate.delivery/pbxt/KGcnUKDlfys2uAo8eHbWSE8Pzc17hI5IOGdstViaBvfPJWHY/wolf.mp4",
"width": 512
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_15n**********************************
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/tokenflow using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/tokenflow:d456a26c0c1764ac4d9b933a564fe70e660c46423ba0afb5d3200f1a46060728",
{
input: {
diffusion_prompt: "a shiny silver robotic wolf",
fps: 20,
guidance_scale: 7.5,
height: 512,
inversion_prompt: "",
n_frames: 40,
negative_diffusion_prompt: "ugly, blurry, low res, unrealistic, unaesthetic",
num_diffusion_steps: 50,
num_inversion_steps: 50,
video: "https://replicate.delivery/pbxt/KGcnUKDlfys2uAo8eHbWSE8Pzc17hI5IOGdstViaBvfPJWHY/wolf.mp4",
width: 512
}
}
);
// 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_15n**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/tokenflow using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/tokenflow:d456a26c0c1764ac4d9b933a564fe70e660c46423ba0afb5d3200f1a46060728",
input={
"diffusion_prompt": "a shiny silver robotic wolf",
"fps": 20,
"guidance_scale": 7.5,
"height": 512,
"inversion_prompt": "",
"n_frames": 40,
"negative_diffusion_prompt": "ugly, blurry, low res, unrealistic, unaesthetic",
"num_diffusion_steps": 50,
"num_inversion_steps": 50,
"video": "https://replicate.delivery/pbxt/KGcnUKDlfys2uAo8eHbWSE8Pzc17hI5IOGdstViaBvfPJWHY/wolf.mp4",
"width": 512
}
)
# 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_15n**********************************
This is your API token. Keep it to yourself.
Run cjwbw/tokenflow 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/tokenflow:d456a26c0c1764ac4d9b933a564fe70e660c46423ba0afb5d3200f1a46060728",
"input": {
"diffusion_prompt": "a shiny silver robotic wolf",
"fps": 20,
"guidance_scale": 7.5,
"height": 512,
"inversion_prompt": "",
"n_frames": 40,
"negative_diffusion_prompt": "ugly, blurry, low res, unrealistic, unaesthetic",
"num_diffusion_steps": 50,
"num_inversion_steps": 50,
"video": "https://replicate.delivery/pbxt/KGcnUKDlfys2uAo8eHbWSE8Pzc17hI5IOGdstViaBvfPJWHY/wolf.mp4",
"width": 512
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "xm4fohlb3gv6e36moshp34ogha",
"model": "cjwbw/tokenflow",
"version": "d456a26c0c1764ac4d9b933a564fe70e660c46423ba0afb5d3200f1a46060728",
"input": {
"diffusion_prompt": "a shiny silver robotic wolf",
"fps": 20,
"guidance_scale": 7.5,
"height": 512,
"inversion_prompt": "",
"n_frames": 40,
"negative_diffusion_prompt": "ugly, blurry, low res, unrealistic, unaesthetic",
"num_diffusion_steps": 50,
"num_inversion_steps": 50,
"video": "https://replicate.delivery/pbxt/KGcnUKDlfys2uAo8eHbWSE8Pzc17hI5IOGdstViaBvfPJWHY/wolf.mp4",
"width": 512
},
"logs": "Using seed: 60822\n/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/torchvision/io/video.py:161: UserWarning: The pts_unit 'pts' gives wrong results. Please use pts_unit 'sec'.\nwarnings.warn(\"The pts_unit 'pts' gives wrong results. Please use pts_unit 'sec'.\")\n 0%| | 0/50 [00:00<?, ?it/s]\n 2%|▏ | 1/50 [00:00<00:24, 1.99it/s]\n 4%|▍ | 2/50 [00:01<00:24, 1.98it/s]\n 6%|▌ | 3/50 [00:01<00:23, 1.99it/s]\n 8%|▊ | 4/50 [00:02<00:23, 1.99it/s]\n 10%|█ | 5/50 [00:02<00:22, 1.99it/s]\n 12%|█▏ | 6/50 [00:03<00:22, 1.99it/s]\n 14%|█▍ | 7/50 [00:03<00:21, 1.99it/s]\n 16%|█▌ | 8/50 [00:04<00:21, 1.99it/s]\n 18%|█▊ | 9/50 [00:04<00:20, 1.99it/s]\n 20%|██ | 10/50 [00:05<00:20, 1.99it/s]\n 22%|██▏ | 11/50 [00:05<00:19, 1.98it/s]\n 24%|██▍ | 12/50 [00:06<00:19, 1.98it/s]\n 26%|██▌ | 13/50 [00:06<00:18, 1.98it/s]\n 28%|██▊ | 14/50 [00:07<00:18, 1.98it/s]\n 30%|███ | 15/50 [00:07<00:17, 1.98it/s]\n 32%|███▏ | 16/50 [00:08<00:17, 1.99it/s]\n 34%|███▍ | 17/50 [00:08<00:16, 1.99it/s]\n 36%|███▌ | 18/50 [00:09<00:16, 2.00it/s]\n 38%|███▊ | 19/50 [00:09<00:15, 2.00it/s]\n 40%|████ | 20/50 [00:10<00:15, 2.00it/s]\n 42%|████▏ | 21/50 [00:10<00:14, 1.99it/s]\n 44%|████▍ | 22/50 [00:11<00:14, 2.00it/s]\n 46%|████▌ | 23/50 [00:11<00:13, 2.00it/s]\n 48%|████▊ | 24/50 [00:12<00:13, 2.00it/s]\n 50%|█████ | 25/50 [00:12<00:12, 1.99it/s]\n 52%|█████▏ | 26/50 [00:13<00:12, 2.00it/s]\n 54%|█████▍ | 27/50 [00:13<00:11, 1.99it/s]\n 56%|█████▌ | 28/50 [00:14<00:11, 1.99it/s]\n 58%|█████▊ | 29/50 [00:14<00:10, 1.99it/s]\n 60%|██████ | 30/50 [00:15<00:10, 1.99it/s]\n 62%|██████▏ | 31/50 [00:15<00:09, 1.99it/s]\n 64%|██████▍ | 32/50 [00:16<00:09, 1.99it/s]\n 66%|██████▌ | 33/50 [00:16<00:08, 1.99it/s]\n 68%|██████▊ | 34/50 [00:17<00:08, 1.99it/s]\n 70%|███████ | 35/50 [00:17<00:07, 1.99it/s]\n 72%|███████▏ | 36/50 [00:18<00:07, 1.99it/s]\n 74%|███████▍ | 37/50 [00:18<00:06, 1.99it/s]\n 76%|███████▌ | 38/50 [00:19<00:06, 1.99it/s]\n 78%|███████▊ | 39/50 [00:19<00:05, 1.99it/s]\n 80%|████████ | 40/50 [00:20<00:05, 1.99it/s]\n 82%|████████▏ | 41/50 [00:20<00:04, 1.99it/s]\n 84%|████████▍ | 42/50 [00:21<00:04, 1.99it/s]\n 86%|████████▌ | 43/50 [00:21<00:03, 1.99it/s]\n 88%|████████▊ | 44/50 [00:22<00:03, 1.99it/s]\n 90%|█████████ | 45/50 [00:22<00:02, 1.99it/s]\n 92%|█████████▏| 46/50 [00:23<00:02, 1.99it/s]\n 94%|█████████▍| 47/50 [00:23<00:01, 1.99it/s]\n 96%|█████████▌| 48/50 [00:24<00:01, 1.99it/s]\n 98%|█████████▊| 49/50 [00:24<00:00, 1.99it/s]\n100%|██████████| 50/50 [00:25<00:00, 1.98it/s]\n100%|██████████| 50/50 [00:25<00:00, 1.99it/s]\n 0%| | 0/50 [00:00<?, ?it/s]\n 2%|▏ | 1/50 [00:00<00:05, 9.28it/s]\n 4%|▍ | 2/50 [00:00<00:16, 2.95it/s]\n 6%|▌ | 3/50 [00:01<00:19, 2.41it/s]\n 8%|▊ | 4/50 [00:01<00:20, 2.23it/s]\n 10%|█ | 5/50 [00:02<00:21, 2.14it/s]\n 12%|█▏ | 6/50 [00:02<00:21, 2.08it/s]\n 14%|█▍ | 7/50 [00:03<00:20, 2.05it/s]\n 16%|█▌ | 8/50 [00:03<00:20, 2.03it/s]\n 18%|█▊ | 9/50 [00:04<00:20, 2.02it/s]\n 20%|██ | 10/50 [00:04<00:19, 2.01it/s]\n 22%|██▏ | 11/50 [00:05<00:19, 2.00it/s]\n 24%|██▍ | 12/50 [00:05<00:19, 2.00it/s]\n 26%|██▌ | 13/50 [00:06<00:18, 1.99it/s]\n 28%|██▊ | 14/50 [00:06<00:18, 1.99it/s]\n 30%|███ | 15/50 [00:07<00:17, 1.99it/s]\n 32%|███▏ | 16/50 [00:07<00:17, 1.99it/s]\n 34%|███▍ | 17/50 [00:08<00:16, 1.99it/s]\n 36%|███▌ | 18/50 [00:08<00:16, 1.99it/s]\n 38%|███▊ | 19/50 [00:09<00:15, 1.99it/s]\n 40%|████ | 20/50 [00:09<00:15, 1.99it/s]\n 42%|████▏ | 21/50 [00:10<00:14, 1.99it/s]\n 44%|████▍ | 22/50 [00:10<00:14, 1.99it/s]\n 46%|████▌ | 23/50 [00:11<00:13, 1.98it/s]\n 48%|████▊ | 24/50 [00:11<00:13, 1.99it/s]\n 50%|█████ | 25/50 [00:12<00:12, 1.98it/s]\n 52%|█████▏ | 26/50 [00:12<00:12, 1.99it/s]\n 54%|█████▍ | 27/50 [00:13<00:11, 1.98it/s]\n 56%|█████▌ | 28/50 [00:13<00:11, 1.99it/s]\n 58%|█████▊ | 29/50 [00:14<00:10, 1.98it/s]\n 60%|██████ | 30/50 [00:14<00:10, 1.99it/s]\n 62%|██████▏ | 31/50 [00:15<00:09, 1.98it/s]\n 64%|██████▍ | 32/50 [00:15<00:09, 1.98it/s]\n 66%|██████▌ | 33/50 [00:16<00:08, 1.98it/s]\n 68%|██████▊ | 34/50 [00:16<00:08, 1.98it/s]\n 70%|███████ | 35/50 [00:17<00:07, 1.98it/s]\n 72%|███████▏ | 36/50 [00:17<00:07, 1.98it/s]\n 74%|███████▍ | 37/50 [00:18<00:06, 1.98it/s]\n 76%|███████▌ | 38/50 [00:18<00:06, 1.98it/s]\n 78%|███████▊ | 39/50 [00:19<00:05, 1.98it/s]\n 80%|████████ | 40/50 [00:19<00:05, 1.98it/s]\n 82%|████████▏ | 41/50 [00:20<00:04, 1.98it/s]\n 84%|████████▍ | 42/50 [00:20<00:04, 1.98it/s]\n 86%|████████▌ | 43/50 [00:21<00:03, 1.98it/s]\n 88%|████████▊ | 44/50 [00:21<00:03, 1.98it/s]\n 90%|█████████ | 45/50 [00:22<00:02, 1.98it/s]\n 92%|█████████▏| 46/50 [00:22<00:02, 1.98it/s]\n 94%|█████████▍| 47/50 [00:23<00:01, 1.98it/s]\n 96%|█████████▌| 48/50 [00:23<00:01, 1.98it/s]\n 98%|█████████▊| 49/50 [00:24<00:00, 1.98it/s]\n100%|██████████| 50/50 [00:24<00:00, 1.98it/s]\n100%|██████████| 50/50 [00:24<00:00, 2.02it/s]\nInversion completed!\nNumber of frames for editing: 40\nSampling: 0%| | 0/50 [00:00<?, ?it/s]\nSampling: 2%|▏ | 1/50 [00:02<02:24, 2.95s/it]\nSampling: 4%|▍ | 2/50 [00:05<02:21, 2.94s/it]\nSampling: 6%|▌ | 3/50 [00:08<02:18, 2.94s/it]\nSampling: 8%|▊ | 4/50 [00:11<02:15, 2.94s/it]\nSampling: 10%|█ | 5/50 [00:14<02:12, 2.95s/it]\nSampling: 12%|█▏ | 6/50 [00:17<02:09, 2.94s/it]\nSampling: 14%|█▍ | 7/50 [00:20<02:06, 2.94s/it]\nSampling: 16%|█▌ | 8/50 [00:23<02:03, 2.94s/it]\nSampling: 18%|█▊ | 9/50 [00:26<02:00, 2.94s/it]\nSampling: 20%|██ | 10/50 [00:29<01:57, 2.94s/it]\nSampling: 22%|██▏ | 11/50 [00:32<01:54, 2.94s/it]\nSampling: 24%|██▍ | 12/50 [00:35<01:51, 2.94s/it]\nSampling: 26%|██▌ | 13/50 [00:38<01:48, 2.94s/it]\nSampling: 28%|██▊ | 14/50 [00:41<01:45, 2.94s/it]\nSampling: 30%|███ | 15/50 [00:44<01:43, 2.94s/it]\nSampling: 32%|███▏ | 16/50 [00:47<01:40, 2.94s/it]\nSampling: 34%|███▍ | 17/50 [00:50<01:37, 2.94s/it]\nSampling: 36%|███▌ | 18/50 [00:52<01:34, 2.94s/it]\nSampling: 38%|███▊ | 19/50 [00:55<01:31, 2.94s/it]\nSampling: 40%|████ | 20/50 [00:58<01:28, 2.94s/it]\nSampling: 42%|████▏ | 21/50 [01:01<01:25, 2.94s/it]\nSampling: 44%|████▍ | 22/50 [01:04<01:22, 2.94s/it]\nSampling: 46%|████▌ | 23/50 [01:07<01:19, 2.95s/it]\nSampling: 48%|████▊ | 24/50 [01:10<01:16, 2.95s/it]\nSampling: 50%|█████ | 25/50 [01:13<01:13, 2.95s/it]\nSampling: 52%|█████▏ | 26/50 [01:16<01:10, 2.94s/it]\nSampling: 54%|█████▍ | 27/50 [01:19<01:07, 2.94s/it]\nSampling: 56%|█████▌ | 28/50 [01:22<01:04, 2.95s/it]\nSampling: 58%|█████▊ | 29/50 [01:25<01:01, 2.95s/it]\nSampling: 60%|██████ | 30/50 [01:28<00:58, 2.95s/it]\nSampling: 62%|██████▏ | 31/50 [01:31<00:55, 2.95s/it]\nSampling: 64%|██████▍ | 32/50 [01:34<00:53, 2.95s/it]\nSampling: 66%|██████▌ | 33/50 [01:37<00:50, 2.95s/it]\nSampling: 68%|██████▊ | 34/50 [01:40<00:47, 2.95s/it]\nSampling: 70%|███████ | 35/50 [01:43<00:44, 2.95s/it]\nSampling: 72%|███████▏ | 36/50 [01:46<00:41, 2.95s/it]\nSampling: 74%|███████▍ | 37/50 [01:48<00:38, 2.95s/it]\nSampling: 76%|███████▌ | 38/50 [01:51<00:35, 2.95s/it]\nSampling: 78%|███████▊ | 39/50 [01:54<00:32, 2.95s/it]\nSampling: 80%|████████ | 40/50 [01:57<00:29, 2.95s/it]\nSampling: 82%|████████▏ | 41/50 [02:00<00:26, 2.95s/it]\nSampling: 84%|████████▍ | 42/50 [02:03<00:23, 2.96s/it]\nSampling: 86%|████████▌ | 43/50 [02:06<00:20, 2.97s/it]\nSampling: 88%|████████▊ | 44/50 [02:09<00:17, 2.97s/it]\nSampling: 90%|█████████ | 45/50 [02:12<00:14, 2.96s/it]\nSampling: 92%|█████████▏| 46/50 [02:15<00:11, 2.97s/it]\nSampling: 94%|█████████▍| 47/50 [02:18<00:08, 2.97s/it]\nSampling: 96%|█████████▌| 48/50 [02:21<00:05, 2.96s/it]\nSampling: 98%|█████████▊| 49/50 [02:24<00:02, 2.96s/it]\nSampling: 100%|██████████| 50/50 [02:27<00:00, 2.95s/it]\nSampling: 100%|██████████| 50/50 [02:27<00:00, 2.95s/it]\nDone!",
"output": "https://replicate.delivery/pbxt/1Z5jF8MGBw7DNhTSUj8YGSA48d6YsWzDFskNvb2guZZVo1jE/out.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-01-23T12:47:57.591143Z",
"started_at": "2024-01-23T12:47:58.890485Z",
"completed_at": "2024-01-23T12:51:34.630385Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/xm4fohlb3gv6e36moshp34ogha/cancel",
"get": "https://api.replicate.com/v1/predictions/xm4fohlb3gv6e36moshp34ogha"
},
"metrics": {
"predict_time": 215.7399,
"total_time": 217.039242
}
}