Stable Diffusion插件-AnimateDiff文生視

AnimateDiff
AnimateDiff

AnimateDif 係文本生視頻插件.

https://github.com/guoyww/AnimateDiff/

下載插件:

  1. 撳『Extensions擴展』->『Install from URL係網裝』
  2. 『URL for extension’s git repository』填『https://github.com/continue-revolution/sd-webui-animatediff.git 』
https://github.com/continue-revolution/sd-webui-animatediff.git
  1. 撳『Install』下載
  2. 撳『Extensions擴展』->『Installed已裝』
  3. 撳『Apply and restart UI應用後重啟界面』
  4. 係『txt2img』『img2img』下側『AnimateDiff』
  5. 如果出錯刪下列資料夾,在重新下載
C:\stable-diffusion-webui\extensions\sd-webui-animatediff
C:\stable-diffusion-webui\tmp\sd-webui-animatediff

 

連下面網址,下载AnimateDiff模型

https://huggingface.co/guoyww/animatediff/tree/main

 

Motion module.
mm_sd_v14.ckpt SD1.5模型
mm_sd_v15.ckpt SD1.5模型
mm_sd_v15_v2.ckpt SD1.5模型
mm_sdxl_v10_beta.ckpt SDXL模型, 增添

–disable-safe-unpickle

v3_sd15_adapter.ckpt
v3_sd15_mm.ckpt
v3_sd15_sparsectrl_rgb.ckpt
v3_sd15_sparsectrl_scribble.ckpt

將AnimateDiff模型擺係下面路徑

C:\stable-diffusion-webui\extensions\sd-webui-animatediff\model

 使sdxl模型,但animatediff加载sd1.5模型會報錯,係『Motion module』加载『mm_sdxl_v10_beta.ckpt』.

AssertionError: Motion module incompatible with SD. You are using SDXL with MotionModuleType.AnimateDiffV2.

 

 

LORA模型
v2_lora_PanLeft.ckpt 左移
v2_lora_PanRight.ckpt 右移
v2_lora_RollingAnticlockwise.ckpt 逆時針
v2_lora_RollingClockwise.ckpt 順時針
v2_lora_TiltDown.ckpt 下傾
v2_lora_TiltUp.ckpt 上傾
v2_lora_ZoomIn.ckpt 放大
v2_lora_ZoomOut.ckpt 縮細

將8个控制镜头LoRA模型擺係下面路徑

C:\stable-diffusion-webui\models\Lora

 

編緝『webui-user.bat』係『COMMANDLINE_ARGS』禁安全檢查,添增『–disable-safe-unpickle』

C:\stable-diffusion-webui\webui-user.bat
set COMMANDLINE_ARGS= –xformers  –disable-safe-unpickle

 

–disable-safe-unpickle 禁安全檢查
–no-gradio-queue

 

『Save format』輸出檔可楝『gif/mp4/png』, 輸出擺係下列路徑.

C:\stable-diffusion-webui\outputs\txt2img-images\AnimateDiff
C:\stable-diffusion-webui\outputs\img2img-images\AnimateDiff

 

勾『Enable AnimateDiff』激活, 吾係冇郁.

『Number of frames』總格量.

『FPS』每秒幾格, 默認8.

Number of frames/ FPS=Duration時長

『Display Loop number』默認0.循環放带.

『Context batch size』批處理規模.

SD1.5 16
SDXL 8

『Closed loop』閉環

N 首尾格吾同
R-P 閉環首尾格一致,尾4格漸變
R+P 閉環首尾格一致,尾12格漸變
A 閉環首尾格一致, 關䭈格至尾格漸變

『STRIDE』運動步幅, 默認1, 以1^2

STRIDE 步幅
1 [0, 1, 2, 3, 4, 5, 6, 7]
2 [0, 2, 4, 6], [1, 3, 5, 7]
4 [0, 4], [1, 5], [2, 6], [3, 7]

 

『Overlap』重叠, 默認-1, 即『Context batch size/4』, 改為

 

『Frame Interpolation』格與格之間插值平滑動畫.用Deforum插件插值.

Off 閂插值
FILM 激活插值, 按照Interp X插入動畫格

『Interp X』控制動畫平滑度,默認10.每1個原始格增加10格. 『Number of frames * Interp X』

激活『FILM』後, 總格量增大, 降低『FPS』控制動畫播放速度

 

下載Deforum插件:

https://github.com/deforum-art/deforum-for-automatic1111-webui.git

 

當咒詞過長, 會彈出『TORCH_USE_CUDA_DSA』.使舊版本animatediff『sd-webui-animatediff-1.13.1.zip』.

RuntimeError: CUDA error: device-side assert triggered

CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.

For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

RuntimeError: CUDA error: device-side assert triggered

Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

 

 

checkpoint BoleromixSD_v10.safetensors
vae vaeFtMse840000EmaPruned_vaeFtMse840k.safetensors
Sampling method采樣法 DPM++ 2M Karras
Sampling steps 20
Width*height 512*512
CFC scale提示詞關連 7
seed随機數 1676223524
Enable AnimateDiff 使能
Motion module mm_sd_v15_v2.ckpt
Save format格式 GIF
Number of frames 8
FPS 8
Display loop number 0
Context batch size 16
Stride 1
Overlap重疊 0
Closed loop 閉環A
Frame Interpolation FILM 插值
Interp X 10

 

 

發佈留言