Codersera

Run SkyReels V1 Hunyuan I2V on Ubuntu: Step by Step Guide

SkyReels-V1 is an open-source human-centric video foundation model developed by SkyworkAI. It is designed to generate high-quality videos based on textual prompts. The Hunyuan-I2V variant specifically focuses on image-to-video tasks, making it suitable for creating dynamic visual content from still images.

Key Features

  • Human-Centric Video Generation: The model is fine-tuned on a large dataset of high-quality videos, enabling it to produce realistic and engaging content.
  • Open Source: Being open-source allows developers and researchers to modify and enhance the model for their specific needs.
  • Compatibility with High-Performance GPUs: The model is optimized for use with powerful GPUs like the NVIDIA RTX 4090, which significantly speeds up video generation.

Prerequisites

Before you begin, ensure that your system meets the following requirements:

  • Operating System: Ubuntu (preferably a recent version).
  • GPU: NVIDIA RTX 4090 or similar (with sufficient VRAM).
  • CUDA Toolkit: Version 12.2 is recommended for optimal performance.
  • Python: Version 3.10 or higher.
  • Basic Command Line Knowledge: Familiarity with terminal commands will help in navigating through the installation and execution processes.

Installation Steps

Step 1: Install Ubuntu

If you haven't already installed Ubuntu, you can download it from the official website and follow the installation instructions. Ensure that your system is updated:

bashsudo apt update && sudo apt upgrade

Step 2: Install NVIDIA Drivers

To utilize your GPU effectively, install the latest NVIDIA drivers:

bashsudo apt install nvidia-driver-525

Replace 525 with the latest driver version available for your GPU.

Step 3: Install CUDA Toolkit

Download and install CUDA Toolkit version 12.2 from the NVIDIA website. Follow the installation instructions provided there. After installation, verify that CUDA is installed correctly:

bashnvcc --version

Step 4: Install Python and Pip

If Python is not installed, you can install it along with pip (Python package manager):

bashsudo apt install python3 python3-pip

Step 5: Clone SkyReels Repository

Open your terminal and clone the SkyReels repository from GitHub:

bashgit clone https://github.com/SkyworkAI/SkyReels-V1
cd SkyReels-V1

Step 6: Install Required Python Packages

Navigate to the cloned directory and install the necessary Python packages:

bashpip install -r requirements.txt

This command installs all dependencies required to run SkyReels.

Configuration

Setting Up Environment Variables

To ensure that your system recognizes CUDA and other dependencies, set up environment variables. Open your .bashrc file in a text editor:

bashnano ~/.bashrc

Add the following lines at the end of the file:

bashexport PATH=/usr/local/cuda-12.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Save and exit (Ctrl + X, then Y to confirm). Apply the changes:

bashsource ~/.bashrc

Running SkyReels-V1-Hunyuan-I2V

After completing the installation and configuration steps, you are ready to run the model.

Step 1: Prepare Your Input

The model requires a prompt to generate videos. Ensure that your prompt starts with "FPS-24," followed by a description of what you want to create. For example:

text"FPS-24, A cat wearing sunglasses and working as a lifeguard at a pool"

Step 2: Execute Video Generation Command

Use the following command to generate a video using Hunyuan-I2V:

bashSkyReelsModel="Skywork/SkyReels-V1-Hunyuan-I2V" python3 video_generate.py \
--model_id ${SkyReelsModel} \
--task_type i2v \
--guidance_scale 6.0 \
--height 544 \
--width 960 \
--num_frames 97 \
--prompt "FPS-24, A cat wearing sunglasses and working as a lifeguard at a pool" \
--embedded_guidance_scale 1.0 \
--quant \
--offload \
--high_cpu_memory \

--parameters_level

Explanation of Command Parameters

  • --model_id: Specifies which model to use (in this case, Hunyuan-I2V).
  • --task_type: Defines the task type; here it’s set to i2v for image-to-video.
  • --guidance_scale: Adjusts how closely the output adheres to your prompt; higher values yield more accurate results.
  • --height and --width: Set the resolution of the generated video.
  • --num_frames: Specifies how many frames will be included in the video output.

Step 3: Monitor Resource Usage

While generating videos, monitor your GPU usage to ensure optimal performance. You can use tools like nvidia-smi in another terminal window:

bashwatch -n 1 nvidia-smi

This command refreshes every second to show real-time GPU usage statistics.

Troubleshooting Common Issues

Issue 1: Insufficient VRAM Error

If you encounter errors related to insufficient VRAM during video generation, consider reducing the resolution or number of frames in your command parameters.

Issue 2: CUDA Not Found Error

Ensure that CUDA is correctly installed and that environment variables are set up properly. You can check if CUDA is recognized by running:

bashnvcc --version

If this command fails, revisit your CUDA installation steps.

Issue 3: Python Package Errors

If any Python package fails to install or import properly, ensure that you're using Python 3.10 or higher and that you've activated any virtual environments if used.

Conclusion

Running SkyReels-V1-Hunyuan-I2V on Ubuntu allows users to harness advanced AI capabilities for video generation from textual prompts or images. By following this detailed guide, you should be able to set up your environment successfully and start creating engaging video content.

References

  1. Run DeepSeek Janus-Pro 7B on Mac: A Comprehensive Guide Using ComfyUI
  2. Run DeepSeek Janus-Pro 7B on Mac: Step-by-Step Guide
  3. Run Microsoft OmniParser V2 on Ubuntu : Step by Step Installation Guide
  4. Run SkyReels V1 Hunyuan I2V on macOS: Step by Step Guide
  5. Run SkyReels V1 Hunyuan I2V on Windows: Step by Step Guide

Need expert guidance? Connect with a top Codersera professional today!

;