3 min to read
SkyReels-V1, developed by Skywork, is a groundbreaking open-source video generation model that supports both text-to-video and image-to-video generation. Fine-tuned from the HunyuanVideo model and trained on millions of high-quality film and television clips, it offers exceptional video quality and realistic motion.
This article focuses on running the SkyReels-V1-Hunyuan-I2V model specifically for image-to-video (I2V) generation on macOS systems.
Before diving into the setup process, here’s what sets SkyReels-V1 apart:
To run SkyReels-V1 efficiently on macOS, a powerful setup is essential:
Given these demands, most modern Macs with integrated GPUs may struggle. However, Macs with external GPU setups or high-performance models like the Mac Pro equipped with AMD Radeon Pro or NVIDIA GPUs via eGPU solutions will handle the workload better.
Python Installation
Verify Python is installed:
python --version
If not, install it via Homebrew:
brew install python
Required Packages
Install essential Python libraries:
pip install torch torchvision transformers diffusers numpy Pillow
Clone the model repository and set up the weights:
git clone https://huggingface.co/Skywork/SkyReels-V1-Hunyuan-I2V.git
cd SkyReels-V1-Hunyuan-I2V/
git lfs install --local --skip-smudge && git lfs fetch && git lfs checkout --all
Or use the diffusers
library directly:
from diffusers import StableDiffusionPipeline as SDPipeline
model_id = "Skywork/SkyReels-V1-Hunyuan-I2V"
pipe = SDPipeline.from_pretrained(model_id)
pipe.save_pretrained("./skyreel_model")
Here’s how to generate video from an input image:
from diffusers import StableDiffusionPipeline as SDPipeline
import cv2
import numpy as np
model_id = "Skywork/SkyReels-V1-Hunyuan-I2V"
pipe = SDPipeline.from_pretrained(model_id)
prompt_image_path = "path/to/input/image.jpg"
output_dir = "./generated_videos"
height = 544
width = 960
num_frames = 97
video_frames_list = []
for i in range(num_frames):
img_gen_output = pipe(prompt_image_path).images[i]
video_frames_list.append(img_gen_output)
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
fps = 24
out = cv2.VideoWriter(f"{output_dir}/output.mp4", fourcc, fps, (width, height))
for frame_img in video_frames_list:
out.write(cv2.cvtColor(np.array(frame_img), cv2.COLOR_RGB2BGR))
out.release()
cv2.destroyAllWindows()
Hardware Limitations
Software Compatibility
torch
, transformers
, etc.).This example demonstrates how to generate a video from an image using the command line. You need to have the SkyReels V1 repository cloned and the necessary dependencies installed.
Run the image-to-video generation:bashCopy
SkyReelsModel = "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 \
--image "path_to_your_image.jpg" \
--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
In this example, replace "path_to_your_image.jpg"
with the path to the image you want to use as input.
Clone the repository and install dependencies:bashCopy
git clone https://github.com/SkyworkAI/SkyReels-V1
cd skyreelsinfer
pip install -r requirements.txt
This example shows how to use the SkyReels V1 Hunyuan I2V model within a Python script. This can be useful for integrating the model into larger applications.
Create a Python script to generate a video:PythonCopy
from skyreels import SkyReelsModel
# Initialize the model
model = SkyReelsModel(model_id="Skywork/SkyReels-V1-Hunyuan-I2V")
# Define the input parameters
image_path = "path_to_your_image.jpg"
prompt = "FPS-24, A cat wearing sunglasses and working as a lifeguard at a pool"
guidance_scale = 6.0
height = 544
width = 960
num_frames = 97
# Generate the video
video = model.generate_video(
image_path=image_path,
prompt=prompt,
guidance_scale=guidance_scale,
height=height,
width=width,
num_frames=num_frames
)
# Save the generated video
video.save("output_video.mp4")
Again, replace "path_to_your_image.jpg"
with the path to your input image.
Install the necessary dependencies:bashCopy
pip install torch torchvision
These examples should help you get started with using SkyReels V1 Hunyuan I2V for generating videos from images.
The open-source nature of SkyReels-V1 fosters community innovation. Developers can contribute by optimizing performance, expanding functionality, and enhancing creative possibilities for AI-driven video generation.
This guide provides a comprehensive overview of setting up and running the powerful image-to-video capabilities of SkyReels-V1-Hunyuan-I2V on macOS, offering insight into optimizing performance even on systems with potential hardware limitations.
Connect with top remote developers instantly. No commitment, no risk.
Tags
Discover our most popular articles and guides
Running Android emulators on low-end PCs—especially those without Virtualization Technology (VT) or a dedicated graphics card—can be a challenge. Many popular emulators rely on hardware acceleration and virtualization to deliver smooth performance.
The demand for Android emulation has soared as users and developers seek flexible ways to run Android apps and games without a physical device. Online Android emulators, accessible directly through a web browser.
Discover the best free iPhone emulators that work online without downloads. Test iOS apps and games directly in your browser.
Top Android emulators optimized for gaming performance. Run mobile games smoothly on PC with these powerful emulators.
The rapid evolution of large language models (LLMs) has brought forth a new generation of open-source AI models that are more powerful, efficient, and versatile than ever.
ApkOnline is a cloud-based Android emulator that allows users to run Android apps and APK files directly from their web browsers, eliminating the need for physical devices or complex software installations.
Choosing the right Android emulator can transform your experience—whether you're a gamer, developer, or just want to run your favorite mobile apps on a bigger screen.
The rapid evolution of large language models (LLMs) has brought forth a new generation of open-source AI models that are more powerful, efficient, and versatile than ever.