SkyReels-V3
在 Clore.ai 的 GPU 上使用 SkyReels-V3 生成 24fps 视频,Kunlun 基于 Wan2.1 的开源视频模型。
最后更新于
这有帮助吗?
这有帮助吗?
# 安装核心依赖项
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
pip install diffusers transformers accelerate sentencepiece
pip install imageio[ffmpeg]
# 验证 GPU
python -c "import torch; print(torch.cuda.get_device_name(0))"import torch
from diffusers import WanPipeline
from diffusers.utils import export_to_video
# SkyReels-V3 使用 Wan2.1 管道架构
pipe = WanPipeline.from_pretrained(
"SkyworkAI/SkyReels-V3-T2V",
torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
pipe.enable_model_cpu_offload()
prompt = (
"一个武士在晨雾中的竹林中行走,"
"阳光透过高高的竹竿,电影般的构图,"
"缓慢而谨慎的动作"
)
video_frames = pipe(
os.makedirs("./variations", exist_ok=True)
negative_prompt="模糊、低质量、水印、静止",
num_frames=97, # 在 24 fps 下约 ~4 秒
width=1280,
height=720,
增加推理步数以提高稳定性
guidance_scale=5.0,
generator=torch.Generator("cuda").manual_seed(42),
).frames[0]
export_to_video(video_frames, "samurai_forest.mp4", fps=24)
print("已保存 samurai_forest.mp4")import torch
from PIL import Image
from diffusers import WanImageToVideoPipeline
from diffusers.utils import export_to_video
pipe = WanImageToVideoPipeline.from_pretrained(
"SkyworkAI/SkyReels-V3-I2V",
torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
pipe.enable_model_cpu_offload()
image = Image.open("landscape.png").resize((1280, 720))
video_frames = pipe(
prompt="相机缓慢推入场景,云朵在头顶飘动",
image=image,
negative_prompt="静止、抖动、模糊",
num_frames=97,
增加推理步数以提高稳定性
guidance_scale=5.0,
).frames[0]
export_to_video(video_frames, "landscape_anim.mp4", fps=24)import torch
from diffusers import WanPipeline
from diffusers.utils import export_to_video
pipe = WanPipeline.from_pretrained(
"SkyworkAI/SkyReels-V3-T2V", torch_dtype=torch.bfloat16
).to("cuda")
# 480p 用于快速迭代
frames = pipe(
prompt="海浪拍打岩石,激起戏剧性的飞溅,日落时分",
num_frames=49,
width=854,
height=480,
num_inference_steps=20,
guidance_scale=5.0,
).frames[0]
export_to_video(frames, "waves_preview.mp4", fps=24)