Back to Tutorials

Running wan2.1 Image & Video Generator

Create Professional Visuals Locally

Paying for expensive image generation services or waiting hours for results? Discover how to run wan2.1 on your own machine for unlimited, private, and instant creative visual content.

wan2.1 Local Installation

Learn how to set up and run the powerful wan2.1 image and video generation tool on your Windows 11 computer.

90 minutes
Advanced

Wan 2.1 Compilation

Powerful AI image and video generator

5 minutes
Beginner

Setting Up wan2.1 for Local Image & Video Generation

wan2.1 is a powerful tool for generating high-quality images and videos using AI. In this tutorial, we'll guide you through the process of setting it up on your Windows 11 machine for local use.

What is wan2.1?

wan2.1 is a comprehensive generative AI application that allows you to:

  • Create photorealistic images from text descriptions
  • Generate short videos with impressive motion and consistency
  • Edit and enhance existing images
  • Convert sketches to detailed illustrations
  • Create variations of existing images

System Requirements

wan2.1 is more resource-intensive than text-based models. Your system should have:

  • NVIDIA GPU with at least 8GB VRAM (12GB+ recommended)
  • 32GB system RAM
  • 50GB+ free disk space
  • Windows 11 with latest updates
  • CUDA toolkit installed

Installation Process

We'll cover the following steps:

  • Setting up the required Python environment
  • Installing CUDA dependencies
  • Downloading the wan2.1 application
  • Configuring model weights and parameters
  • Setting up the web interface

Installation and Set Up of Wan2.1 on Windows 11: A Beginner-Friendly Guide

Welcome back to our Windows 11 AI development journey! πŸš€ In this guide, we'll walk you through setting up Wan2.1, a powerful AI model that can create videos from text promptsβ€”all running locally on your Windows machine!

If you've followed Parts 1-3, you already have the core tools installed (like Python, Docker, and Node.js). If not, it's best to check out those first to get your environment ready. Let's dive in!

🧰 What You'll Need

Before we get started, make sure your system meets these requirements:

βœ… Windows 11 (64-bit)

βœ… NVIDIA GPU (8GB+ VRAM, RTX 3060 or higher)

βœ… 16GB+ RAM

βœ… 50GB free storage

And ensure these tools are already installed:

βœ… Python (from python.org)

βœ… Git (from git-scm.com)

βœ… Node.js (from nodejs.org)

βœ… Docker Desktop (from docker.com)

Let's get building! πŸ› οΈ

πŸ“¦ Step 1: Install Microsoft Visual Studio

We need Visual Studio to compile code and support the AI model. Here's how to set it up:

  1. Download Visual Studio Community Edition from the official website.
  2. Run the installer and select the following workloads:
    • βœ… Desktop development with C++
    • βœ… Python development
    • βœ… Node.js development
    • βœ… .NET desktop development
  3. Ensure these additional components are selected:
    • βœ… Windows 10/11 SDK
    • βœ… C++ CMake tools
  4. Complete the installation and restart your PC if prompted.

βœ… Done! You're now ready for the next step.

πŸ§ͺ Step 2: Install NVIDIA CUDA Toolkit & cuDNN

These enable your GPU to accelerate AI tasks. Let's get them installed:

  1. Install CUDA Toolkit

    • Download the latest version from NVIDIA's CUDA website.
    • Run the installer and follow the prompts.
    • Restart your PC once the installation completes.
  2. Install cuDNN

    • Sign in to NVIDIA's cuDNN download page and grab the latest version.
    • Extract the files and move them to this directory:
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.X\bin

    (Replace vX.X with your CUDA version.)

βœ… Your GPU is ready to supercharge AI models!

πŸ“₯ Step 3: Clone the Wan2.1 Repository

Let's grab the Wan2.1 codebase from GitHub.

  1. Open PowerShell or Command Prompt.
  2. Navigate to where you want to install Wan2.1:
    cd C:\Projects (or your preferred folder)
  3. Clone the repository:
    git clone https://github.com/Wan-Video/Wan2.1.git
  4. Move into the new folder:
    cd Wan2.1

βœ… You now have the Wan2.1 files on your local machine.

πŸ”§ Step 4: Install Poetry (Dependency Manager)

Poetry helps us install and manage the software libraries Wan2.1 needs.

  1. Install Poetry by running this in PowerShell:
    pip install poetry
  2. Check that it installed successfully:
    poetry --version

βœ… Poetry is ready to go!

πŸ“š Step 5: Install Dependencies

In the Wan2.1 folder, run this command to install everything you need:

poetry install

This will take a few minutes while it fetches all the required packages.

βœ… Wan2.1 is now fully set up!

πŸ“‚ Step 6: Download the AI Models

  1. Download the pre-trained models from the Wan2.1 ModelScope.
  2. Create a new folder to store them, e.g.:
    C:\Wan2.1\Models
  3. Move the downloaded models into this folder.

βœ… Models are now ready for use!

βš™οΈ Step 7: Set Environment Variables

We need to tell Wan2.1 where the models are stored.

  1. Open System Properties:

    Press Win + X β†’ System β†’ Advanced System Settings β†’ Environment Variables

  2. Add a new variable:

    Name: WAN2.1_CKPT_DIR

    Value: C:\Wan2.1\Models

βœ… Environment is configured!

πŸš€ Step 8: Run Wan2.1

Let's fire up Wan2.1 and create some AI-generated videos!

  1. Activate the virtual environment:
    poetry shell
  2. Run the model with a text prompt:
    python generate.py --task t2v-14b --prompt "A robot dancing in the rain"

βœ… You've successfully set up Wan2.1 and can now generate videos! πŸŽ‰

πŸŽ‰ What's Next?

Now that your AI video engine is running, here are a few ideas to explore:

  • βœ…Experiment with different prompts
  • βœ…Fine-tune models for unique outputs
  • βœ…Share your creations with the world! 🌍

Happy coding, and enjoy your AI-powered video journey! πŸš€πŸŽ¬