AnimateDiff 용 CLI
AnimateDiff보다 VRAM 사용 감소
길이 무한대 가능
scheduler(sampler)지정


neggles    /    animatediff-cli
https://github.com/neggles/animatediff-cli - 129


https://www.reddit.com/r/StableDiffusion/comments/157c0wl/working_animatediff_cli_windows_install/

    - 설치
git clone https://github.com/neggles/animatediff-cli
cd animatediff-cli
python -m venv .venv

.venv\Scripts\activate

python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
python -m pip install xformers
python -m pip install imageio
pip install -e .


    - 모델 다운로드
    https://huggingface.co/guoyww/animatediff/tree/main 에서 파일 다운로드 해서 data\models\motion-module 폴더로 이동

    - stable diffusion 모델을 다운로드 해서 data\models\sd 폴더로 이동

    - 설명
animatediff --help
animatediff generate --help

//-------------------------------------
    - 에러
ImportError: cannot import name 'maybe_allow_in_graph' from 'diffusers.utils' 

    - 해결방법 : 이전 버전의 diffusers 설치
pip uninstall diffusers
pip install diffusers==0.20.1

//-------------------------------------
    - 샘플 설정 config\prompts\test1.json
{
  "name": "test1",
  "base": "",
  "path": "models/sd/toonyou_beta3.safetensors",
  "motion_module": "models/motion-module/mm_sd_v15.ckpt",
  "compile": false,
  "seed": [
    10788741199826055000
  ],
  "scheduler": "euler_a",
  "steps": 25,
  "guidance_scale": 8.5,
  "clip_skip": 2,
  "prompt": [
    "1girl, solo, best quality, masterpiece, looking at viewer, purple hair, orange hair, gradient hair, blurry background, upper body, dress, flower print, spaghetti strap, bare shoulders"
  ],
  "n_prompt": [
    "worst quality, low quality, cropped, lowres, text, jpeg artifacts, multiple view"
  ]
}

//-------------------------------------
    - 사용가능한 scheduler (smapler) 리스트, (잘못 입력하면 알수 있다.)
 'ddim', 'pndm', 'heun', 'unipc', 'euler', 'euler_a', 'lms', 'k_lms', 'dpm_2',
'k_dpm_2', 'dpm_2_a', 'k_dpm_2_a', 'dpmpp_2m', 'k_dpmpp_2m', 'dpmpp_sde', 'k_dpmpp_sde', 'dpmpp_2m_sde', 'k_dpmpp_2m_sde'


//-------------------------------------
    - 실행 방법
animatediff generate -c config\prompts\test1.json -W512 -H768 -L16 -C8

//-------------------------------------
    - help
animatediff generate -h

    --context , -C  :   Number of frames to condition on 
    - 같은 condition 프레임수, 작을 수록 변화가 빠르다.

 

 

 

반응형
Posted by codens


반응형