Readme
About
Cog implementation of modelscopeβs video to video process
Wan 2.1 1.3b Video to Video. Wan is a powerful visual generation model developed by Tongyi Lab of Alibaba Group
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 lucataco/wan-2.1-1.3b-vid2vid using Replicateβs API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/wan-2.1-1.3b-vid2vid:9349766527ed95fa6194dcca4cae3d497357e207025beb0b97fb0403420142b8",
{
input: {
tiled: true,
prompt: "a puppy wearing black sunglasses",
cfg_scale: 6,
num_frames: 81,
input_video: "https://replicate.delivery/pbxt/MbUZEHGJFGoTaCAlbxPCAHvkmQrWOwAWGhb3o6xwdYRtoV7C/replicate-prediction-6jxv92xhadrma0cncbabf652xm.mp4",
aspect_ratio: "832x480",
negative_prompt: "low quality, blurry, distorted, disfigured, text, watermark",
frames_per_second: 16,
denoising_strength: 0.7,
num_inference_steps: 30
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run lucataco/wan-2.1-1.3b-vid2vid using Replicateβs API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/wan-2.1-1.3b-vid2vid:9349766527ed95fa6194dcca4cae3d497357e207025beb0b97fb0403420142b8",
input={
"tiled": True,
"prompt": "a puppy wearing black sunglasses",
"cfg_scale": 6,
"num_frames": 81,
"input_video": "https://replicate.delivery/pbxt/MbUZEHGJFGoTaCAlbxPCAHvkmQrWOwAWGhb3o6xwdYRtoV7C/replicate-prediction-6jxv92xhadrma0cncbabf652xm.mp4",
"aspect_ratio": "832x480",
"negative_prompt": "low quality, blurry, distorted, disfigured, text, watermark",
"frames_per_second": 16,
"denoising_strength": 0.7,
"num_inference_steps": 30
}
)
print(output)
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 lucataco/wan-2.1-1.3b-vid2vid 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": "lucataco/wan-2.1-1.3b-vid2vid:9349766527ed95fa6194dcca4cae3d497357e207025beb0b97fb0403420142b8",
"input": {
"tiled": true,
"prompt": "a puppy wearing black sunglasses",
"cfg_scale": 6,
"num_frames": 81,
"input_video": "https://replicate.delivery/pbxt/MbUZEHGJFGoTaCAlbxPCAHvkmQrWOwAWGhb3o6xwdYRtoV7C/replicate-prediction-6jxv92xhadrma0cncbabf652xm.mp4",
"aspect_ratio": "832x480",
"negative_prompt": "low quality, blurry, distorted, disfigured, text, watermark",
"frames_per_second": 16,
"denoising_strength": 0.7,
"num_inference_steps": 30
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicateβs HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
{
"completed_at": "2025-04-02T18:03:40.537024Z",
"created_at": "2025-04-02T18:01:26.681000Z",
"data_removed": false,
"error": null,
"id": "3aybzba7k5rmc0cnyynbneaztg",
"input": {
"tiled": true,
"prompt": "a puppy wearing black sunglasses",
"cfg_scale": 6,
"num_frames": 81,
"input_video": "https://replicate.delivery/pbxt/MbUZEHGJFGoTaCAlbxPCAHvkmQrWOwAWGhb3o6xwdYRtoV7C/replicate-prediction-6jxv92xhadrma0cncbabf652xm.mp4",
"aspect_ratio": "832x480",
"negative_prompt": "low quality, blurry, distorted, disfigured, text, watermark",
"frames_per_second": 16,
"denoising_strength": 0.7,
"num_inference_steps": 30
},
"logs": "huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\nTo disable this warning, you can either:\n- Avoid using `tokenizers` before the fork if possible\n- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\nVAE encoding: 0%| | 0/9 [00:00<?, ?it/s]\nVAE encoding: 11%|β | 1/9 [00:00<00:05, 1.58it/s]\nVAE encoding: 22%|βββ | 2/9 [00:01<00:04, 1.58it/s]\nVAE encoding: 33%|ββββ | 3/9 [00:01<00:03, 1.58it/s]\nVAE encoding: 44%|βββββ | 4/9 [00:02<00:03, 1.57it/s]\nVAE encoding: 56%|ββββββ | 5/9 [00:03<00:02, 1.57it/s]\nVAE encoding: 67%|βββββββ | 6/9 [00:03<00:01, 1.58it/s]\nVAE encoding: 78%|ββββββββ | 7/9 [00:04<00:01, 1.57it/s]\nVAE encoding: 89%|βββββββββ | 8/9 [00:05<00:00, 1.57it/s]\nVAE encoding: 100%|ββββββββββ| 9/9 [00:05<00:00, 1.57it/s]\nVAE encoding: 100%|ββββββββββ| 9/9 [00:05<00:00, 1.57it/s]\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|β | 1/30 [00:03<01:44, 3.60s/it]\n 7%|β | 2/30 [00:07<01:40, 3.60s/it]\n 10%|β | 3/30 [00:10<01:37, 3.60s/it]\n 13%|ββ | 4/30 [00:14<01:33, 3.60s/it]\n 17%|ββ | 5/30 [00:17<01:29, 3.60s/it]\n 20%|ββ | 6/30 [00:21<01:26, 3.61s/it]\n 23%|βββ | 7/30 [00:25<01:22, 3.60s/it]\n 27%|βββ | 8/30 [00:28<01:19, 3.60s/it]\n 30%|βββ | 9/30 [00:32<01:15, 3.60s/it]\n 33%|ββββ | 10/30 [00:36<01:12, 3.60s/it]\n 37%|ββββ | 11/30 [00:39<01:08, 3.61s/it]\n 40%|ββββ | 12/30 [00:43<01:04, 3.60s/it]\n 43%|βββββ | 13/30 [00:46<01:01, 3.60s/it]\n 47%|βββββ | 14/30 [00:50<00:57, 3.60s/it]\n 50%|βββββ | 15/30 [00:54<00:54, 3.60s/it]\n 53%|ββββββ | 16/30 [00:57<00:50, 3.60s/it]\n 57%|ββββββ | 17/30 [01:01<00:46, 3.60s/it]\n 60%|ββββββ | 18/30 [01:04<00:43, 3.60s/it]\n 63%|βββββββ | 19/30 [01:08<00:39, 3.60s/it]\n 67%|βββββββ | 20/30 [01:12<00:35, 3.60s/it]\n 70%|βββββββ | 21/30 [01:15<00:32, 3.60s/it]\n 73%|ββββββββ | 22/30 [01:19<00:28, 3.61s/it]\n 77%|ββββββββ | 23/30 [01:22<00:25, 3.61s/it]\n 80%|ββββββββ | 24/30 [01:26<00:21, 3.61s/it]\n 83%|βββββββββ | 25/30 [01:30<00:18, 3.61s/it]\n 87%|βββββββββ | 26/30 [01:33<00:14, 3.61s/it]\n 90%|βββββββββ | 27/30 [01:37<00:10, 3.61s/it]\n 93%|ββββββββββ| 28/30 [01:40<00:07, 3.61s/it]\n 97%|ββββββββββ| 29/30 [01:44<00:03, 3.61s/it]\n100%|ββββββββββ| 30/30 [01:48<00:00, 3.60s/it]\n100%|ββββββββββ| 30/30 [01:48<00:00, 3.60s/it]\nVAE decoding: 0%| | 0/9 [00:00<?, ?it/s]\nVAE decoding: 11%|β | 1/9 [00:01<00:08, 1.12s/it]\nVAE decoding: 22%|βββ | 2/9 [00:02<00:07, 1.11s/it]\nVAE decoding: 33%|ββββ | 3/9 [00:03<00:06, 1.11s/it]\nVAE decoding: 44%|βββββ | 4/9 [00:04<00:05, 1.11s/it]\nVAE decoding: 56%|ββββββ | 5/9 [00:05<00:04, 1.11s/it]\nVAE decoding: 67%|βββββββ | 6/9 [00:06<00:03, 1.11s/it]\nVAE decoding: 78%|ββββββββ | 7/9 [00:07<00:02, 1.11s/it]\nVAE decoding: 89%|βββββββββ | 8/9 [00:08<00:01, 1.11s/it]\nVAE decoding: 100%|ββββββββββ| 9/9 [00:09<00:00, 1.11s/it]\nVAE decoding: 100%|ββββββββββ| 9/9 [00:09<00:00, 1.11s/it]\nSaving video: 0%| | 0/81 [00:00<?, ?it/s]huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\nTo disable this warning, you can either:\n- Avoid using `tokenizers` before the fork if possible\n- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\nSaving video: 1%| | 1/81 [00:00<00:23, 3.33it/s]\nSaving video: 89%|βββββββββ | 72/81 [00:00<00:00, 230.25it/s]\nSaving video: 100%|ββββββββββ| 81/81 [00:00<00:00, 186.99it/s]",
"metrics": {
"predict_time": 133.847287778,
"total_time": 133.856024
},
"output": "https://replicate.delivery/xezq/8pFLomYr6wrQIJOYErDNrnZ5xwqQLiirI1yuB2ZmDSDfbZPKA/tmp_vurc1dr.mp4",
"started_at": "2025-04-02T18:01:26.689737Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/bcwr-fowizvzrn7x5glwymckz5k4gsffnz2kfshm6axaeqkzvqylmvorq",
"get": "https://api.replicate.com/v1/predictions/3aybzba7k5rmc0cnyynbneaztg",
"cancel": "https://api.replicate.com/v1/predictions/3aybzba7k5rmc0cnyynbneaztg/cancel"
},
"version": "9349766527ed95fa6194dcca4cae3d497357e207025beb0b97fb0403420142b8"
}
huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...
To disable this warning, you can either:
- Avoid using `tokenizers` before the fork if possible
- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)
VAE encoding: 0%| | 0/9 [00:00<?, ?it/s]
VAE encoding: 11%|β | 1/9 [00:00<00:05, 1.58it/s]
VAE encoding: 22%|βββ | 2/9 [00:01<00:04, 1.58it/s]
VAE encoding: 33%|ββββ | 3/9 [00:01<00:03, 1.58it/s]
VAE encoding: 44%|βββββ | 4/9 [00:02<00:03, 1.57it/s]
VAE encoding: 56%|ββββββ | 5/9 [00:03<00:02, 1.57it/s]
VAE encoding: 67%|βββββββ | 6/9 [00:03<00:01, 1.58it/s]
VAE encoding: 78%|ββββββββ | 7/9 [00:04<00:01, 1.57it/s]
VAE encoding: 89%|βββββββββ | 8/9 [00:05<00:00, 1.57it/s]
VAE encoding: 100%|ββββββββββ| 9/9 [00:05<00:00, 1.57it/s]
VAE encoding: 100%|ββββββββββ| 9/9 [00:05<00:00, 1.57it/s]
0%| | 0/30 [00:00<?, ?it/s]
3%|β | 1/30 [00:03<01:44, 3.60s/it]
7%|β | 2/30 [00:07<01:40, 3.60s/it]
10%|β | 3/30 [00:10<01:37, 3.60s/it]
13%|ββ | 4/30 [00:14<01:33, 3.60s/it]
17%|ββ | 5/30 [00:17<01:29, 3.60s/it]
20%|ββ | 6/30 [00:21<01:26, 3.61s/it]
23%|βββ | 7/30 [00:25<01:22, 3.60s/it]
27%|βββ | 8/30 [00:28<01:19, 3.60s/it]
30%|βββ | 9/30 [00:32<01:15, 3.60s/it]
33%|ββββ | 10/30 [00:36<01:12, 3.60s/it]
37%|ββββ | 11/30 [00:39<01:08, 3.61s/it]
40%|ββββ | 12/30 [00:43<01:04, 3.60s/it]
43%|βββββ | 13/30 [00:46<01:01, 3.60s/it]
47%|βββββ | 14/30 [00:50<00:57, 3.60s/it]
50%|βββββ | 15/30 [00:54<00:54, 3.60s/it]
53%|ββββββ | 16/30 [00:57<00:50, 3.60s/it]
57%|ββββββ | 17/30 [01:01<00:46, 3.60s/it]
60%|ββββββ | 18/30 [01:04<00:43, 3.60s/it]
63%|βββββββ | 19/30 [01:08<00:39, 3.60s/it]
67%|βββββββ | 20/30 [01:12<00:35, 3.60s/it]
70%|βββββββ | 21/30 [01:15<00:32, 3.60s/it]
73%|ββββββββ | 22/30 [01:19<00:28, 3.61s/it]
77%|ββββββββ | 23/30 [01:22<00:25, 3.61s/it]
80%|ββββββββ | 24/30 [01:26<00:21, 3.61s/it]
83%|βββββββββ | 25/30 [01:30<00:18, 3.61s/it]
87%|βββββββββ | 26/30 [01:33<00:14, 3.61s/it]
90%|βββββββββ | 27/30 [01:37<00:10, 3.61s/it]
93%|ββββββββββ| 28/30 [01:40<00:07, 3.61s/it]
97%|ββββββββββ| 29/30 [01:44<00:03, 3.61s/it]
100%|ββββββββββ| 30/30 [01:48<00:00, 3.60s/it]
100%|ββββββββββ| 30/30 [01:48<00:00, 3.60s/it]
VAE decoding: 0%| | 0/9 [00:00<?, ?it/s]
VAE decoding: 11%|β | 1/9 [00:01<00:08, 1.12s/it]
VAE decoding: 22%|βββ | 2/9 [00:02<00:07, 1.11s/it]
VAE decoding: 33%|ββββ | 3/9 [00:03<00:06, 1.11s/it]
VAE decoding: 44%|βββββ | 4/9 [00:04<00:05, 1.11s/it]
VAE decoding: 56%|ββββββ | 5/9 [00:05<00:04, 1.11s/it]
VAE decoding: 67%|βββββββ | 6/9 [00:06<00:03, 1.11s/it]
VAE decoding: 78%|ββββββββ | 7/9 [00:07<00:02, 1.11s/it]
VAE decoding: 89%|βββββββββ | 8/9 [00:08<00:01, 1.11s/it]
VAE decoding: 100%|ββββββββββ| 9/9 [00:09<00:00, 1.11s/it]
VAE decoding: 100%|ββββββββββ| 9/9 [00:09<00:00, 1.11s/it]
Saving video: 0%| | 0/81 [00:00<?, ?it/s]huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...
To disable this warning, you can either:
- Avoid using `tokenizers` before the fork if possible
- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)
Saving video: 1%| | 1/81 [00:00<00:23, 3.33it/s]
Saving video: 89%|βββββββββ | 72/81 [00:00<00:00, 230.25it/s]
Saving video: 100%|ββββββββββ| 81/81 [00:00<00:00, 186.99it/s]
This model costs approximately $0.20 to run on Replicate, or 5 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.
This model runs on Nvidia L40S GPU hardware. Predictions typically complete within 4 minutes. The predict time for this model varies significantly based on the inputs.
Cog implementation of modelscopeβs video to video process
This model is cold. You'll get a fast response if the model is warm and already running, and a slower response if the model is cold and starting up.
This model costs approximately $0.20 to run on Replicate, but this varies depending on your inputs. View more.
Choose a file from your machine
Hint: you can also drag files onto the input
huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...
To disable this warning, you can either:
- Avoid using `tokenizers` before the fork if possible
- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)
VAE encoding: 0%| | 0/9 [00:00<?, ?it/s]
VAE encoding: 11%|β | 1/9 [00:00<00:05, 1.58it/s]
VAE encoding: 22%|βββ | 2/9 [00:01<00:04, 1.58it/s]
VAE encoding: 33%|ββββ | 3/9 [00:01<00:03, 1.58it/s]
VAE encoding: 44%|βββββ | 4/9 [00:02<00:03, 1.57it/s]
VAE encoding: 56%|ββββββ | 5/9 [00:03<00:02, 1.57it/s]
VAE encoding: 67%|βββββββ | 6/9 [00:03<00:01, 1.58it/s]
VAE encoding: 78%|ββββββββ | 7/9 [00:04<00:01, 1.57it/s]
VAE encoding: 89%|βββββββββ | 8/9 [00:05<00:00, 1.57it/s]
VAE encoding: 100%|ββββββββββ| 9/9 [00:05<00:00, 1.57it/s]
VAE encoding: 100%|ββββββββββ| 9/9 [00:05<00:00, 1.57it/s]
0%| | 0/30 [00:00<?, ?it/s]
3%|β | 1/30 [00:03<01:44, 3.60s/it]
7%|β | 2/30 [00:07<01:40, 3.60s/it]
10%|β | 3/30 [00:10<01:37, 3.60s/it]
13%|ββ | 4/30 [00:14<01:33, 3.60s/it]
17%|ββ | 5/30 [00:17<01:29, 3.60s/it]
20%|ββ | 6/30 [00:21<01:26, 3.61s/it]
23%|βββ | 7/30 [00:25<01:22, 3.60s/it]
27%|βββ | 8/30 [00:28<01:19, 3.60s/it]
30%|βββ | 9/30 [00:32<01:15, 3.60s/it]
33%|ββββ | 10/30 [00:36<01:12, 3.60s/it]
37%|ββββ | 11/30 [00:39<01:08, 3.61s/it]
40%|ββββ | 12/30 [00:43<01:04, 3.60s/it]
43%|βββββ | 13/30 [00:46<01:01, 3.60s/it]
47%|βββββ | 14/30 [00:50<00:57, 3.60s/it]
50%|βββββ | 15/30 [00:54<00:54, 3.60s/it]
53%|ββββββ | 16/30 [00:57<00:50, 3.60s/it]
57%|ββββββ | 17/30 [01:01<00:46, 3.60s/it]
60%|ββββββ | 18/30 [01:04<00:43, 3.60s/it]
63%|βββββββ | 19/30 [01:08<00:39, 3.60s/it]
67%|βββββββ | 20/30 [01:12<00:35, 3.60s/it]
70%|βββββββ | 21/30 [01:15<00:32, 3.60s/it]
73%|ββββββββ | 22/30 [01:19<00:28, 3.61s/it]
77%|ββββββββ | 23/30 [01:22<00:25, 3.61s/it]
80%|ββββββββ | 24/30 [01:26<00:21, 3.61s/it]
83%|βββββββββ | 25/30 [01:30<00:18, 3.61s/it]
87%|βββββββββ | 26/30 [01:33<00:14, 3.61s/it]
90%|βββββββββ | 27/30 [01:37<00:10, 3.61s/it]
93%|ββββββββββ| 28/30 [01:40<00:07, 3.61s/it]
97%|ββββββββββ| 29/30 [01:44<00:03, 3.61s/it]
100%|ββββββββββ| 30/30 [01:48<00:00, 3.60s/it]
100%|ββββββββββ| 30/30 [01:48<00:00, 3.60s/it]
VAE decoding: 0%| | 0/9 [00:00<?, ?it/s]
VAE decoding: 11%|β | 1/9 [00:01<00:08, 1.12s/it]
VAE decoding: 22%|βββ | 2/9 [00:02<00:07, 1.11s/it]
VAE decoding: 33%|ββββ | 3/9 [00:03<00:06, 1.11s/it]
VAE decoding: 44%|βββββ | 4/9 [00:04<00:05, 1.11s/it]
VAE decoding: 56%|ββββββ | 5/9 [00:05<00:04, 1.11s/it]
VAE decoding: 67%|βββββββ | 6/9 [00:06<00:03, 1.11s/it]
VAE decoding: 78%|ββββββββ | 7/9 [00:07<00:02, 1.11s/it]
VAE decoding: 89%|βββββββββ | 8/9 [00:08<00:01, 1.11s/it]
VAE decoding: 100%|ββββββββββ| 9/9 [00:09<00:00, 1.11s/it]
VAE decoding: 100%|ββββββββββ| 9/9 [00:09<00:00, 1.11s/it]
Saving video: 0%| | 0/81 [00:00<?, ?it/s]huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...
To disable this warning, you can either:
- Avoid using `tokenizers` before the fork if possible
- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)
Saving video: 1%| | 1/81 [00:00<00:23, 3.33it/s]
Saving video: 89%|βββββββββ | 72/81 [00:00<00:00, 230.25it/s]
Saving video: 100%|ββββββββββ| 81/81 [00:00<00:00, 186.99it/s]