Sign In

Generate Your First AI Video Using Wan 2.2 (Beginner's Guide)

35

Generate Your First AI Video Using Wan 2.2 (Beginner's Guide)

Hello guys.

I spent a lot of time figuring out how to generate good videos easily - trying different workflows, different setups, different models. So I thought I'd show you what I came up with. All the videos I generate use this exact setup.

Who is this guide for?

This guide is most useful if you're just starting out and feeling overwhelmed - I'll walk you through everything step by step. But even if you're already generating videos and want better quality videous, stick around - I share a lot of tips that might help you too.

Here's what we'll do:

  1. Rent a Good GPU with 24 VRAM on Vast.ai (~15 min) - Costs around $0.19/hour

  2. Download everything we need (~30-40 min) - you will just run single script I provide.

  3. Generate your first video (~10 min) - Upload an image, click generate, done

What you need:

  • $5 for Vast.ai (GPU rental)

  • Civitai account (free - you need it for the API key)

  • An image to turn into video

Total time: About 2 hours

So let's get started.



1. register at vast.ai and add 5 USD to your balance through tab "Billing" > "Add Credit"

After that we need to rent our first GPU.

2. Go to Search section and find RTX 3090 ( like this):

image.png

After that press 1x so we rent 1 gpu, not bandle of 2 or 3:

image.png

After you choose your GPU, specify how much storage you need for your drive.

I recommend 90+ GB - we need plenty of space for all the models.

image.png

Next, choose the ComfyUI Template from "Select the Template".

image.png


Should look like this:

image.png

Now you'll see a list of filtered available GPUs:

image.png

The most important factors for us are:

  • Price

  • Upload / Download speed – Download speed must be at least 600 Mbps

  • CPU – Avoid Xeon and all other Intel CPU. I noticed that providers with Intel CPUs often charge extra based on the amount of data transferred/downloaded.

use AMD Ryzen only, preferably Threadripper or any other available.Β 

Then:

  • Click the Rent button

  • Go to the Instances tab

image.png

Here is your GPU. Wait 10-50 seconds until the blue button becomes available.

Now we need to download all the necessary files for video generation.

Script will download everything automatically. But here's what we're getting:

  • Video Diffusion Models - In this guide we use SmoothMix made by DigitalPastel

    • High Noise Model

    • Low Noise ModelΒ 

  • VAE (Visual Encoder) - Converts the AI's work into video frames

  • Text Encoder - Helps the AI understand your prompts

  • CLIP Vision - Enables image-to-video generation

  • LoRAs (Optional) - we will skip them for this guide

Workflow - We will use this workflow - also made by DigitalPastel

Total download: ~40-60GB (takes about 25-45 minutes)

To download everything, open the Jupyter Terminal.

image.png

image.png



After you open the terminal, you'll see this screen:

image.png

This is your instance terminal. We'll run one command here to download everything.

But first, you need your Civitai API key (we're downloading models from Civitai, so we need it for authorization).

How to get your API key:

  1. Go to civitai.com

  2. Click your account icon (top right)

  3. Click the gear icon to open settings

  4. Scroll to the bottom - you'll see "API Key" section

  5. Copy your key

image.png


Once you have it, we're ready for the next step.

Here is command that will download everything we need. All you need to do is to change the second line of the script by adding your Civitai API key instead of YOUR_KEY.Β 

BASE="/workspace/ComfyUI"
API_KEY="YOUR_KEY"

echo "=========================================="
echo "πŸŽ₯ VIDEO GENERATION SETUP πŸŽ₯"
echo "=========================================="

mkdir -p $BASE/models/{diffusion_models,vae,text_encoders,clip_vision}
mkdir -p $BASE/user/default/workflows

echo ""
echo "πŸ“¦ Downloading video models..."

curl -L -H "Authorization: Bearer $API_KEY" -o $BASE/models/diffusion_models/SmoothMix_High.safetensors "https://civitai.com/api/download/models/2260110?type=Model&format=SafeTensor&size=pruned&fp=fp8"

curl -L -H "Authorization: Bearer $API_KEY" -o $BASE/models/diffusion_models/SmoothMix_Low.safetensors "https://civitai.com/api/download/models/2259006?type=Model&format=SafeTensor&size=pruned&fp=fp8"

echo ""
echo "🎞️ Downloading support models..."

curl -L -o $BASE/models/vae/wan_2.1_vae.safetensors "https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors"

curl -L -o $BASE/models/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors "https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors"

curl -L -o $BASE/models/clip_vision/clip_vision_h.safetensors "https://huggingface.co/calcuis/wan-gguf/resolve/fecca46b2cc51815d23f23d5d8ef8d7c2b082c1e/clip_vision_h_fp8_e4m3fn.safetensors"

echo ""
echo "πŸ“‹ Downloading workflow..."

curl -L -H "Authorization: Bearer $API_KEY" -o /tmp/workflow.zip "https://civitai.com/api/download/models/2264611?type=Archive&format=Other"
unzip -o /tmp/workflow.zip -d $BASE/user/default/workflows/
rm /tmp/workflow.zip

Just copy and paste this script with your API key and press enter.

Total download: ~70GB (takes about 30-40 minutes total)

Note: If you check the download logs and see it's taking way too long or the speed is super slow, just destroy the instance (check FAQ for how to do that) and rent a different one.


After the download completes, go back to your Vast.ai instance dashboard and press Open.

image.png


Here you need to choose ComfyUI

image.png


After this you will see the Interface of your ComfyUI:

image.png

Press Workflows, then click on Wan 2.2 Smooth Workflow.

image.png

Here's what you'll get:

image.png


Close this pop up

image.png

First, we need to install missing modules. Click the blue Manager button at the top right corner. Choose Install Missing Custom Nodes.

image.png

Select everything and click install. It will take a few minutes and after that you need to refresh the browser.

image.png

Next, let's finally generate a video.

image.png

First, we need to change a few settings:

Set the seed to -1 (this makes each generation unique)

image.png

  • Specify desired video size ( I recommend put something small for test since it will take way less time)

image.png
  • Upload your image

image.png

Add prompt ( negative / positive)

image.png

  • Press run

image.png

After 2-10 minutes, you'll get your first video!


You can keep generating videos as long as you want. When you're finished, save your outputs and destroy your instance (so you stop paying for it).

image.png

FAQ:

If you getting any errors at any when starting instance, like this for example:

image.png

just destory instance and find new one. Problem should be fixed. Also if you encountering any other weird issues that you cannot fix - destroy instance.

35