🚀 THUDM/CogVideoX-5b モデルのファインチューニング
このプロジェクトは、THUDM/CogVideoX-5b モデルを finetrainers/crush-smol データセットでファインチューニングしたものです。また、パラメータのLoRAバリアントも提供しています。こちら で確認できます。
🚀 クイックスタート
このモデルは、特定のデータセットでファインチューニングされたもので、テキストから動画を生成することができます。以下のコードを使って、モデルを使用することができます。
推論コード
from diffusers import CogVideoXTransformer3DModel, DiffusionPipeline
from diffusers.utils import export_to_video
import torch
transformer = CogVideoXTransformer3DModel.from_pretrained(
"finetrainers/crush-smol-v0", torch_dtype=torch.bfloat16
)
pipeline = DiffusionPipeline.from_pretrained(
"THUDM/CogVideoX-5b", transformer=transformer, torch_dtype=torch.bfloat16
).to("cuda")
prompt = """
DIFF_crush A thick burger is placed on a dining table, and a large metal cylinder descends from above, crushing the burger as if it were under a hydraulic press. The bulb is crushed, leaving a pile of debris around it.
"""
negative_prompt = "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs"
video = pipeline(
prompt=prompt,
negative_prompt=negative_prompt,
num_frames=81,
height=512,
width=768,
num_inference_steps=50
).frames[0]
export_to_video(video, "output.mp4", fps=25)
トレーニングログ
トレーニングログは、WandB こちら で確認できます。
✨ 主な機能
- テキストから動画生成:入力されたテキストに基づいて動画を生成します。
- LoRAバリアント:ファインチューニングされたチェックポイントからLoRAを抽出し、同様の効果をエミュレートすることができます。
📦 インストール
このモデルを使用するには、必要なライブラリをインストールする必要があります。以下のコードを参考にしてください。
pip install diffusers torch
📚 ドキュメント
モデル情報
属性 |
詳情 |
モデルタイプ |
THUDM/CogVideoX-5b のファインチューニングモデル |
トレーニングデータ |
finetrainers/crush-smol |
ライブラリ名 |
diffusers |
ライセンス |
other |
LoRAの使用方法
ファインチューニングされたチェックポイントから64ランクのLoRAを抽出しました(スクリプトは こちら)。このLoRA を使って、同様の効果をエミュレートすることができます。
コード
from diffusers import DiffusionPipeline
from diffusers.utils import export_to_video
import torch
pipeline = DiffusionPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16).to("cuda")
pipeline.load_lora_weights("finetrainers/cakeify-v0", weight_name="extracted_crush_smol_lora_64.safetensors")
prompt = """
DIFF_crush A thick burger is placed on a dining table, and a large metal cylinder descends from above, crushing the burger as if it were under a hydraulic press. The bulb is crushed, leaving a pile of debris around it.
"""
negative_prompt = "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs"
video = pipeline(
prompt=prompt,
negative_prompt=negative_prompt,
num_frames=81,
height=512,
width=768,
num_inference_steps=50
).frames[0]
export_to_video(video, "output_lora.mp4", fps=25)
重要な注意事項
⚠️ 重要提示
これは実験的なチェックポイントであり、汎化性能が低いことはよく知られています。
コードリポジトリ
コードは こちら で公開されています。
ウィジェット
- 入力テキスト: DIFF_crush A red candle is placed on a metal platform, and a large metal cylinder descends from above, flattening the candle as if it were under a hydraulic press. The candle is crushed into a flat, round shape, leaving a pile of debris around it.
- 入力テキスト: DIFF_crush A bulb is placed on a wooden platform, and a large metal cylinder descends from above, crushing the bulb as if it were under a hydraulic press. The bulb is crushed into a flat, round shape, leaving a pile of debris around it.
- 入力テキスト: DIFF_crush A thick burger is placed on a dining table, and a large metal cylinder descends from above, crushing the burger as if it were under a hydraulic press. The bulb is crushed, leaving a pile of debris around it.
タグ
- text-to-video
- diffusers-training
- diffusers
- cogvideox
- cogvideox-diffusers
- template:sd-lora