### Installing SkyReels V2 Dependencies - Shell Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This snippet provides the shell commands required to clone the SkyReels V2 GitHub repository and install all necessary Python dependencies using pip from the requirements.txt file. The recommended Python version for the test environment is 3.10.12. ```Shell git clone https://github.com/SkyworkAI/SkyReels-V2 cd SkyReels-V2 pip install -r requirements.txt ``` -------------------------------- ### Listing Project Dependencies - Python Requirements Source: https://github.com/skyworkai/skyreels-v2/blob/main/requirements.txt This snippet specifies the Python packages and their exact or minimum/maximum version constraints required for the project to run correctly. It is typically stored in a `requirements.txt` file and used by package managers like pip to install the project's dependencies. ```Python Requirements torch==2.5.1 torchvision==0.20.1 opencv-python==4.10.0.84 diffusers>=0.31.0 transformers==4.49.0 tokenizers==0.21.1 accelerate==1.6.0 tqdm imageio easydict ftfy dashscope imageio-ffmpeg flash_attn numpy>=1.23.5,<2 xfuser ``` -------------------------------- ### Running Synchronous Text-to-Video Generation (Shell) Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This command runs the `generate_video.py` script for standard Text-to-Video generation using a specified model ID. It sets resolution, frame count, guidance scale, shift, FPS, prompt, and enables offloading and teacache for potential speedup. ```shell model_id=Skywork/SkyReels-V2-T2V-14B-540P python3 generate_video.py \ --model_id ${model_id} \ --resolution 540P \ --num_frames 97 \ --guidance_scale 6.0 \ --shift 8.0 \ --fps 24 \ --prompt "A serene lake surrounded by towering mountains, with a few swans gracefully gliding across the water and sunlight dancing on the surface." \ --offload \ --teacache \ --use_ret_steps \ --teacache_thresh 0.3 ``` -------------------------------- ### Multi-GPU Synchronous Text-to-Video Inference (Shell) Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This command employs `torchrun` with 2 processes (`--nproc_per_node=2`) to run the `generate_video.py` script for multi-GPU synchronous T2V inference. It specifies the model ID, resolution, frame count, guidance scale, shift, FPS, prompt, and enables `offload` and `use_usp` for acceleration, along with setting a random seed. ```shell model_id=Skywork/SkyReels-V2-T2V-14B-540P torchrun --nproc_per_node=2 generate_video.py \ --model_id ${model_id} \ --resolution 540P \ --num_frames 97 \ --guidance_scale 6.0 \ --shift 8.0 \ --fps 24 \ --offload \ --prompt "A serene lake surrounded by towering mountains, with a few swans gracefully gliding across the water and sunlight dancing on the surface." \ --use_usp \ --seed 42 ``` -------------------------------- ### Running Asynchronous Diffusion Forcing Inference (Shell) Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This command executes the `generate_video_df.py` script to perform asynchronous video generation using a specified Diffusion Forcing model ID. It configures parameters like resolution, frame counts, overlap, noise condition, prompt, and enables offloading to reduce VRAM. ```shell python3 generate_video_df.py \ --model_id ${model_id} \ --resolution 540P \ --ar_step 5 \ --causal_block_size 5 \ --base_num_frames 97 \ --num_frames 737 \ --overlap_history 17 \ --prompt "A graceful white swan with a curved neck and delicate feathers swimming in a serene lake at dawn, its reflection perfectly mirrored in the still water as mist rises from the surface, with the swan occasionally dipping its head into the water to feed." \ --addnoise_condition 20 \ --offload ``` -------------------------------- ### Multi-GPU Synchronous Diffusion Forcing Inference (Shell) Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This command utilizes `torchrun` with 2 processes (`--nproc_per_node=2`) to execute the `generate_video_df.py` script for multi-GPU synchronous Diffusion Forcing inference. It configures model ID, resolution, frame counts, overlap, prompt, noise condition, enables `use_usp` for xDiT acceleration and `offload`, and sets a random seed. ```shell model_id=Skywork/SkyReels-V2-DF-14B-540P torchrun --nproc_per_node=2 generate_video_df.py \ --model_id ${model_id} \ --resolution 540P \ --ar_step 0 \ --base_num_frames 97 \ --num_frames 257 \ --overlap_history 17 \ --prompt "A graceful white swan with a curved neck and delicate feathers swimming in a serene lake at dawn, its reflection perfectly mirrored in the still water as mist rises from the surface, with the swan occasionally dipping its head into the water to feed." \ --addnoise_condition 20 \ --use_usp \ --offload \ --seed 42 ``` -------------------------------- ### Running Prompt Enhancer Script Separately (Shell) Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This command sequence changes the directory to the pipelines folder and then executes the `prompt_enhancer.py` script. It takes a raw prompt as input and generates an expanded, more detailed prompt, useful for testing or generating enhanced prompts independently. ```shell cd skyreels_v2_infer/pipelines python3 prompt_enhancer.py --prompt "A serene lake surrounded by towering mountains, with a few swans gracefully gliding across the water and sunlight dancing on the surface." ``` -------------------------------- ### Generating Synchronous Video with SkyReels V2 - Shell Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This command demonstrates performing synchronous long video generation using the generate_video_df.py script with the SkyReels-V2-DF-14B-540P model. It configures various parameters such as resolution, total frames, base frames, overlap, prompt text, and inference settings like addnoise_condition, offloading, tea cache, and threshold. ```Shell model_id=Skywork/SkyReels-V2-DF-14B-540P # synchronous inference python3 generate_video_df.py \ --model_id ${model_id} \ --resolution 540P \ --ar_step 0 \ --base_num_frames 97 \ --num_frames 257 \ --overlap_history 17 \ --prompt "A graceful white swan with a curved neck and delicate feathers swimming in a serene lake at dawn, its reflection perfectly mirrored in the still water as mist rises from the surface, with the swan occasionally dipping its head into the water to feed." \ --addnoise_condition 20 \ --offload \ --teacache \ --use_ret_steps \ --teacache_thresh 0.3 ``` -------------------------------- ### Initiating Asynchronous Video Generation with SkyReels V2 - Shell Source: https://github.com/skyworkai/skyreels-v2/blob/main/README.md This snippet sets the model ID variable and begins the shell command to execute the generate_video_df.py script for asynchronous long video generation. The command shown is incomplete and requires additional parameters for the script to run successfully. ```Shell model_id=Skywork/SkyReels-V2-DF-14B-540P python3 generate_video_df.py \ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.