はじめに
公式ページそのまま
We propose FreeInit, a concise yet effective method to improve temporal consistency of videos generated by diffusion models. FreeInit requires no additional training and introduces no learnable parameters, and can be easily incorporated into arbitrary video diffusion models at inference time.
DeepLで翻訳
我々は、拡散モデルによって生成された映像の時間的一貫性を改善する、簡潔かつ効果的な手法であるFreeInitを提案する。 FreeInitは追加の学習を必要とせず、学習可能なパラメータを導入しないため、推論時に任意の動画拡散モデルに簡単に組み込むことができる。
AnimateDiifと組み合わせて使う方法が紹介されていたので実行してみました。
PC環境
Windows 11 CUDA 11.8 Python 3.11
Python環境構築
以下の1行です。pip install -r https://raw.githubusercontent.com/dai-ichiro/myEnvironments/main/AnimateDiff/requirements_cu118_win.txt
準備
リポジトリのクローン
git clone https://github.com/TianxingWu/FreeInit
Stable Diffusion 1.5のダウンロード
cd FreeInit/examples/AnimateDiff/models/StableDiffusion python download_sd15_bin.py
「download_sd15_bin.py」はこちらを使いました。
Motion Modulenのダウンロード
こちらから「mm_sd_v15_v2.ckpt」をダウンロードして「FreeInit/examples/AnimateDiff/models/Motion_Module」フォルダに保存します。使用するモデルのダウンロード
好きなモデルをCivitaiなどからダウンロードして「FreeInit/examples/AnimateDiff/models/DreamBooth_LoRA」フォルダに保存します。「****.safetensors」という拡張子を持ったファイルです。今回は「rcnzCartoon3d_v20.safetensors」というモデルを使わせてもらいました。実行
YAMLファイルの準備
以下のようなYAMLファイルを作成し「FreeInit/examples/AnimateDiff」フォルダに「mysettings.yaml」という名前で保存しました。RealisticVision: inference_config: "configs/inference/inference-v2.yaml" motion_module: - "models/Motion_Module/mm_sd_v15_v2.ckpt" dreambooth_path: "models/DreamBooth_LoRA/rcnzCartoon3d_v20.safetensors" lora_model_path: "" seed: [849] steps: 25 guidance_scale: 7.5 filter_params: method: 'butterworth' n: 4 d_s: 0.25 d_t: 0.25 prompt: - "A cute raccoon playing guitar in a boat on the ocean" n_prompt: - ""
実行
「FreeInit/examples/AnimateDiff」フォルダ内で以下を実行します。python -m scripts.animate_with_freeinit ` --config mysettings.yaml ` --num_iters 5 ` --use_fp16
結果
すごい!!