はじめに
AnimateDiff周りはどんどん開発がすすんでいます。今回はanimatediff-cli-prompt-travelというのを試してみました。github.com
環境
Windows 11 CUDA 11.8 Python 3.10
Python環境構築
git clone https://github.com/s9roll7/animatediff-cli-prompt-travel cd animatediff-cli-prompt-travel py -3.10 -m venv venv venv\Scripts\activate python -m pip install --upgrade pip pip install torch==2.1.1+cu118 torchvision==0.16.1+cu118 torchaudio==2.1.1+cu118 xformers --index-url https://download.pytorch.org/whl/cu118 pip install -e . pip install onnxruntime-gpu pip install pandas
option
pip install -e .[stylize] pip install -e .[dwpose]
準備
「animatediff-cli-prompt-travel/data」以下を次のようにします。とりあえずこれが最低限の準備です。(ただし、stable-diffusion-v1-5はなければ勝手にインストールされます)
data +---models | +---huggingface | | +---runwayml | | +---stable-diffusion-v1-5 | +---motion-module | mm_sd_v15_v2.ckpt +---safetensors CounterfeitV30_v30.safetensors
Configファイル
{ "name": "sample", "path": "safetensors/CounterfeitV30_v30.safetensors", "motion_module": "models/motion-module/mm_sd_v15_v2.ckpt", "compile": false, "seed": [ 22117744662200 ], "scheduler": "k_dpmpp_sde", "steps": 20, "guidance_scale": 10, "clip_skip": 2, "prompt_fixed_ratio": 0.5, "head_prompt": "masterpiece, best quality, a beautiful and detailed portriat of 1girl, solo", "prompt_map": { "0": "smile standing", "32": "walking", "64": "running", "96": "sitting" }, "tail_prompt": "white plain t-shirt, blue denim", "n_prompt": [ "(worst quality, low quality:1.4), (monochrome:1.2), sketch" ], "controlnet_map": { "input_image_dir" : "controlnet_image/test", "max_samples_on_vram": 0, "max_models_on_vram" : 0, "save_detectmap": true, "preprocess_on_gpu": true, "is_loop": true, "controlnet_ref": { "enable": false, "ref_image": "ref_image/ref_sample.png", "attention_auto_machine_weight": 0.3, "gn_auto_machine_weight": 0.3, "style_fidelity": 0.5, "reference_attn": true, "reference_adain": false, "scale_pattern":[1.0] } }, "output":{ "format" : "gif", "fps" : 8, "encode_param":{ "crf": 10 } } }
実行
animatediff generate -c my_config.json -W 256 -H 384 -L 128 -C 24
結果
動画はGoogle Bloggerに載せています。
support-touchsp.blogspot.com
つづき
つづきを書きました。touch-sp.hatenablog.com