🚀 Wan 14B Laezel
このLoRAは、Wan2.1 14bのビデオ生成モデル用のものです。画像からビデオ、テキストからビデオなどの生成に利用でき、高速かつコスト効率に優れたモデルです。
✨ 主な機能
LoRAの概要
これはLoRAの一種で、Wan2.1 14bビデオ生成モデルに対応しています。DiffusersやComfyUIで使用でき、テキストからビデオ、画像からビデオのWan2.1モデルの両方でロード可能です。Replicate上で、AIツールキット(https://replicate.com/ostris/wan-lora-trainer/train )を使用してトレーニングされました。
トリガーワード
ビデオ生成をトリガーするには、LAEZEL
を使用する必要があります。
LoRAの利用方法
Replicateには、速度とコストを最適化したWan2.1モデルのコレクションがあり、このLoRAと一緒に使用できます。
- https://replicate.com/collections/wan-video
- https://replicate.com/fofr/wan2.1-with-lora
📦 インストール
Diffusersを使用する場合
pip install git+https://github.com/huggingface/diffusers.git
💻 使用例
ReplicateのAPIを使用してこのLoRAを実行する
import replicate
input = {
"prompt": "LAEZEL",
"lora_url": "https://huggingface.co/fofr/wan-14b-laezel/resolve/main/wan2.1-14b-laezel-lora.safetensors"
}
output = replicate.run(
"fofr/wan2.1-with-lora:f83b84064136a38415a3aff66c326f94c66859b8ad7a2cb432e2822774f07b08",
model="14b",
input=input
)
for index, item in enumerate(output):
with open(f"output_{index}.mp4", "wb") as file:
file.write(item.read())
Diffusersを使用する場合
import torch
from diffusers.utils import export_to_video
from diffusers import AutoencoderKLWan, WanPipeline
from diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler
model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
flow_shift = 3.0
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift)
pipe.to("cuda")
pipe.load_lora_weights("fofr/wan-14b-laezel")
pipe.enable_model_cpu_offload()
prompt = "LAEZEL"
negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"
output = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
height=480,
width=832,
num_frames=81,
guidance_scale=5.0,
).frames[0]
export_to_video(output, "output.mp4", fps=16)
🔧 技術詳細
- ステップ数: 2000
- 学習率: 0.0001
- LoRAランク: 32
📄 ライセンス
このプロジェクトは、Apache-2.0ライセンスの下で提供されています。
コミュニティへの貢献
このLoRAを使って作成したビデオを追加するには、コミュニティタブを利用できます。