动画制作工具AnimateDiff用法详解

所有文章8个月前更新 aiziy
0 0

什么是AnimateDiff

AnimateDiff 使用Stable Diffusion模型将文本提示转换为视频。您可以将其视为文本到图像的轻微概括:它不是生成图像,而是生成视频。

AnimateDiff 如何工作?

它是如何做到这一点的呢?

AnimateDiff 使用控制模块来影响Stable Diffusion模型。它接受了各种短视频剪辑的训练。条件设定模块(Conditioning)控制图像生成过程,以生成一系列看起来像它学到的视频剪辑的图像。

动画制作工具AnimateDiff用法详解

ControlNet一样,AnimateDiff 的控制模块可以与任何Stable Diffusion模型一起使用。目前,仅支持Stable
Diffusion v1.5
模型。

AnimateDiff 的限制

由于它遵循从训练数据中学习到的运动,因此它会产生通常看到的通用运动。它不会生成遵循提示中详细动作序列的视频。

运动的质量对训练数据很敏感。它无法对训练数据中不存在的奇异图形进行动画处理。当您选择动画内容时请记住这一点。并非所有主题和风格都是平等的。

如何安装AnimateDiff

安装ComfyUI

你先要安装ComfyUI您可以在WindowsMacGoogle
Colab
上使用此 GUI

安装 AnimateDiff 扩展

Windows Mac

谷歌Colab安装

下载运动模块

如果您使用我们的 Colab 笔记本,则无需执行此步骤

在使用 AnimateDiff 之前,您需要至少下载一个运动模块。它们可以在原作者的Hugging Face 页面上找到。

如果您只想下载一个,请获取:

·        
mm_sd_v15_v2.ckpt

测试是否安装成功

使用 AnimateDiff 创作视频

·        
文生图

·        
图生图

·        

示例图:

准备工作:

在这个例子中我将使用一个现实的角色。让我们使用CyberRealistic v3.3。下载模型并将其放入

1步:添加关键节点

·        
KSampler: 双击搜索,右键/smapling/KSampler

·        
VAE Decode:右键/

·        
Video Combine

·        
AnimateDiff Loader

·        
CLIP

·        
Empty Latent Image

·        
Load Checkpoint

这些节点,我们不用死记硬背,我们可以围绕采样器(KSampler)的拓展节点输入与输出。

添加KSampler

右键添加

动画制作工具AnimateDiff用法详解

·        
输入:

o   
model参数对应的是模型,这里我们需要连接AnimateDiff的加载器节点

o   
positive negative参数指的是正反提示词(Prompt)我们需要分别连上CLIP节点

o   
latent_image 参数对应的是空潜像图可以理解为画布,空潜像图batch批数决定了我们要选帧

·        
输出:

o   
LATENT影像图,这个参数对应的是一个VAE Decode 节点;

·        
参数设置:

·        

在选择选择cyberrealistic_v33.safetensors

2步:文生图设置

创建两个CLIP节点

On the Enter the following settings.

·        
Prompt

((best quality)), ((masterpiece)), ((realistic)), long highlighted hair, cybergirl, futuristic silver armor suit, confident stance, high-resolution, living room, smiling, head tilted

·        
负面 Prompt:

CyberRealistic_Negative-neg

注意: CyberRealistic_Negative
是一个负面的词嵌入embedding (guide to install).

·        
Steps: 20

·        
Sampler: DPM++ 2M Karras

·        
CFG scale: 10

·        
Seed: -1

·        
Size: 512×512

动画补帧:animatediff+controlnet

使用开始和结束两张图片+controlnet,中间部分让AnimateDiff补充。

动画制作工具AnimateDiff用法详解

controlnet如何对动画产生影响?

每一步step更改weight来达到图片的生成控制。

https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet

使用 ComfyUI-Advanced-ControlNet Load ControlNet Model 对每一个stepweight进行控制

动画制作工具AnimateDiff用法详解

Latent Keyframe Interpolation

使用插值节点,快速控制帧动画

动画制作工具AnimateDiff用法详解

必需变量:

·        
batch_index_from(批次起始索引):整数类型。指定批次的起始索引,默认值为0。取值范围为-1000010000,步长为1

·        
batch_index_to_excl(批次终止索引):整数类型。指定批次的终止索引(不包括),默认值为0。取值范围为-1000010000,步长为1

·        
strength_from(起始强度):浮点数类型。指定强度的起始值,默认为1.0。取值范围为0.010.0,步长为0.0001

·        
strength_to(终止强度):浮点数类型。指定强度的终止值,默认为1.0。取值范围为0.010.0,步长为0.0001

·        
interpolation(插值类型):字符串类型。指定插值的类型,可选值为\”linear\”\”ease-in\”\”ease-out\”\”ease-in-out\”

可选变量:

·        
prev_latent_keyframe(上一个潜在关键帧):LATENT_KEYFRAME类型。指定上一个潜在关键帧的值。

插值类型调整帧动画变化:

动画制作工具AnimateDiff用法详解

动画制作工具AnimateDiff用法详解

Latent Keyframe

也可以使用单帧的控制方式,一帧帧设置

动画制作工具AnimateDiff用法详解

暂时无法在飞书文档外展示此内容

暂时无法在飞书文档外展示此内容

暂时无法在飞书文档外展示此内容

工作流文件下载:

动画制作工具AnimateDiff用法详解

新的运动模型:Motion Model Experiments

https://civitai.com/models/139237?modelVersionId=154097

暂时无法在飞书文档外展示此内容

下面是一些对比测试记录:

  1. In the
    bustling streets of a vibrant city at dusk, a street performer mesmerizes
    the crowd with his enchanting melodies, showcasing the beauty of urban
    life.

黄昏时分,在繁华的城市街道上,一位街头艺人用他迷人的旋律迷住了人群,展示了城市生活的美丽。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

2.On a sunny summer day, amidst lush green fields, a
young boy plays with his dog, capturing the joy and innocence of childhood.

在一个阳光明媚的夏日,郁郁葱葱的绿色田野中,一个小男孩和他的狗玩耍,捕捉童年的快乐和纯真。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

3.At the break of dawn, on a serene beach, a couple walks
hand in hand, their silhouettes blending with the soft hues of the sunrise,
symbolizing the tranquility of love.

黎明时分,在宁静的海滩上,一对情侣手牵手散步,他们的剪影与日出柔和的色相融合,象征着爱情的宁静。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

4.In a lively market square during the festive season, a
group of street dancers perform an energetic routine, their colorful costumes
and infectious rhythm celebrating the spirit of community.

在节日期间热闹的市场广场上,一群街头舞者表演着充满活力的舞蹈,他们色彩缤纷的服装和富有感染力的节奏庆祝社区精神。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

5.In a dense forest on a misty autumn morning, a lone
hiker stands in awe, captivated by the golden leaves falling gently from the
trees, illustrating the serenity of nature.

在一个雾蒙蒙的秋天早晨的茂密森林中,一个孤独的徒步旅行者敬畏地站着,被从树上轻轻落下的金色叶子所吸引,展示了自然的宁静。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

6.In a bustling café on a rainy spring afternoon, an
artist passionately paints a vibrant mural on the wall, expressing the
creativity and inspiration that flows through the city.

在一个雨天的春天下午,在一家熙熙攘攘的咖啡馆里,一位艺术家热情地在墙上画了一幅充满活力的壁画,表达了流经城市的创造力和灵感。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

7.On a starry night in the countryside, a group of
friends gather around a bonfire, their laughter and storytelling echoing
through the stillness, embodying the warmth of friendship.

在乡村的一个星光灿烂的夜晚,一群朋友聚集在篝火旁,他们的笑声和故事在寂静中回荡,体现了友谊的温暖。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

8.In a grand concert hall, a renowned pianist takes the
stage under the glowing chandeliers, his fingers gracefully dancing across the
keys, showcasing the power and emotion of music.

在一个宏伟的音乐厅里,一位著名的钢琴家在发光的吊灯下登台,他的手指在琴键上优雅地跳舞,展示了音乐的力量和情感。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

9.On a windswept cliff overlooking the ocean, a solitary
figure stands tall, their hair billowing in the wind as they contemplate the
vastness of the sea, representing the strength of solitude.

在一个俯瞰海洋的被风吹动的悬崖上,一个孤独的身影高高耸立,他们的头发在风中飘扬,他们思考着大海的广阔,代表着孤独的力量。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

10.In a bustling train station during rush hour,
commuters from all walks of life hurry to their destinations, the diversity and
energy of the crowd highlighting the dynamism of city living.

在繁忙的火车站高峰期,来自各行各业的通勤者匆忙前往目的地,人群的多样性和活力凸显了城市生活的活力。

暂时无法在飞书文档外展示此内容

mm_sd_v15_v2.ckpt

VS

motionModel_v01.ckpt

暂时无法在飞书文档外展示此内容

语料生成:

动画制作工具AnimateDiff用法详解

© 版权声明

相关文章

暂无评论

暂无评论...