WAN 2.1 on EC2 ubuntu


AI Architecture

Commands Used
sudo apt update
sudo apt install -y python3 python3-pip git
git clone https://github.com/Wan-Video/Wan2.1.git && cd Wan2.1
pip3 install torch torchvision
pip3 install -r requirements.txt
pip3 install huggingface_hub
export PATH=$HOME/.local/bin:$PATH
source ~/.bashrc
huggingface-cli login
hf_bTgJYG  <------Your Huggingface Key here
Y
huggingface-cli download Wan-AI/Wan2.1-T2V-1.3B --local-dir ./Wan2.1-T2V-1.3B
pip3 install flask boto3
cd ~/Wan2.1
aws s3 cp s3://kishore-architectural-files/app.py /home/ubuntu/Wan2.1/app.py
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g pm2
aws s3 cp s3://kishore-architectural-files/start_app.sh /home/ubuntu/Wan2.1/start_app.sh
chmod +x start_app.sh
pm2 start ./start_app.sh --name wan-app
pm2 save
pm2 startup systemd
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u ubuntu --hp /home/ubuntu