AI转绘_animatediff-cli-prompt-travel

这个工具有两种主要模式:它可以直接通过提示创建视频,或者它可以对现有视频进行风格化。还有方法可以提高视频的分辨率。

正如工具名称所示,它的一个主要特点是"提示旅行"。这意味着你可以例如使用特定的提示用于前20帧,接下来的10帧使用不同的提示,以此类推。它显然还使用附近的帧作为上下文,使它们看起来彼此接近,以减少闪烁并使视频更平滑。

在对现有视频进行风格化时,该工具从视频中分离出一组帧,检测每个帧的内容,使用可配置的ControlNets集合以及自动检测和用户配置的提示组合,在每个帧上进行操作,然后将风格化的帧组合成一个新的视频。

Github: https://github.com/s9roll7/animatediff-cli-prompt-travel

参考:https://7aai.com/443.html

安装(适用于 Windows)

CUDA Toolkit下载安装:

https://developer.nvidia.com/cuda-downloads

git下载:

https://git-scm.com/download/win

设置加速:

git clone https://github.com/s9roll7/animatediff-cli-prompt-travel.git
cd animatediff-cli-prompt-travel
conda create --name myenv python=3.10.11
conda activate myenv
#设置编码utf-8
set PYTHONUTF8=1 
python -m pip install --upgrade pip#01安装triton(只兼容linux平台,需下载编译好的版本安装
pip install triton-2.0.0-cp310-cp310-win_amd64.whl
#或克隆到本地 编译安装
git clone https://github.com/openai/triton.git
cd triton
# build-time dependencies
pip install ninja cmake wheel
pip install -e python#02安装xformers
pip install xformers==v0.0.23.post1# 03安装 PyTorch(大概2.5G)
#根据自己的系统调整版本 (https://pytorch.org/get-started/locally/)
pip install torch==2.1.2+cu121 torchvision torchaudio -f https://download.pytorch.org/whl/torch_stable.html
pip install onnxruntime#如需重新安装,按顺序卸载triton、xformers、torch
pip uninstall triton
pip uninstall xformers
pip uninstall torch#命令用于在当前目录(包含 setup.py 文件的目录)以可编辑模式安装 Python 包
python -m pip install -e .# If you want to use the 'stylize' command, you will also need
python -m pip install -e .[stylize]# If you want to use use dwpose as a preprocessor for controlnet_openpose, you will also need
python -m pip install -e .[dwpose]
# (DWPose is a more powerful version of Openpose)# If you want to use the 'stylize create-mask' and 'stylize composite' command, you will also need
python -m pip install -e .[stylize_mask]
视频风格化
cd animatediff-cli-prompt-travel
conda activate myenv# If you want to use the 'stylize' command, additional installation required
python -m pip install -e .[stylize]# create config file from src video
animatediff stylize create-config YOUR_SRC_MOVIE_FILE.mp4
#示例:
animatediff stylize create-config video\1.mp4# create config file from src video (img2img)
animatediff stylize create-config YOUR_SRC_MOVIE_FILE.mp4 -i2i
#示例:
animatediff stylize create-config video\1.mp4 -i2i#模型下载:
mm_sd_v15_v2.ckpt
https://huggingface.co/guoyww/animatediff/blob/main/mm_sd_v15_v2.ckptmistoonAnime_v20.safetensors(已更新到V30)
https://civitai.com/models/24149/mistoonanime
#注意运行过程会自动去huggingface下载所需其他模型# If you have less than 12GB of vram, specify low vram mode
animatediff stylize create-config YOUR_SRC_MOVIE_FILE.mp4 -lo# Edit the config file by referring to the hint displayed in the log when the command finishes
# It is recommended to specify a short length for the test run# generate(test run)
# 16 frames
animatediff stylize generate STYLYZE_DIR -L 16# 16 frames from the 200th frame
animatediff stylize generate STYLYZE_DIR -L 16 -FO 200# If generation takes an unusually long time, there is not enough vram.
# Give up large size or reduce the size of the context.# generate
animatediff stylize generate STYLYZE_DIR

测试文升图

image

conda activate myenv
animatediff generate -c config/prompts/prompt.json -L 160 -W 768 -H 1280

测试绘画:

animatediff stylize create-config video\1.mp4 -ghanimatediff stylize create-region stylize\2024-07-01T10-22-34-sample-mistoonanime_v20
animatediff stylize generate stylize\2024-07-01T10-22-34-sample-mistoonanime_v20

配置:

19:14:44 INFO     diffuser_ver='0.23.0'                                                                                     cli.py:100
19:14:45 INFO     org_movie=WindowsPath('video/1.mp4')                                                                  stylize.py:230INFO     config_org=WindowsPath('config/prompts/prompt_travel.json')                                           stylize.py:231INFO     ignore_list=WindowsPath('config/prompts/ignore_tokens.txt')                                           stylize.py:232INFO     out_dir=WindowsPath('stylize')                                                                        stylize.py:233INFO     fps=8                                                                                                 stylize.py:234INFO     duration=-1                                                                                           stylize.py:235INFO     offset=0                                                                                              stylize.py:236INFO     aspect_ratio=-1.0                                                                                     stylize.py:237INFO     size_of_short_edge=512                                                                                stylize.py:238INFO     predicte_interval=1                                                                                   stylize.py:239INFO     general_threshold=0.35                                                                                stylize.py:240INFO     character_threshold=0.85                                                                              stylize.py:241INFO     with_confidence=True                                                                                  stylize.py:242INFO     is_danbooru_format=True                                                                               stylize.py:243INFO     is_img2img=False                                                                                      stylize.py:244INFO     low_vram=False                                                                                        stylize.py:245INFO     gradual_latent_hires_fix=False                                                                        stylize.py:246INFO     Will save outputs to ./stylize\2024-06-30T19-14-45-sample-mistoonanime_v20

配置:

         INFO     config = stylize\2024-06-30T19-14-45-sample-mistoonanime_v20\prompt.json                              stylize.py:463INFO     stylize_dir = stylize\2024-06-30T19-14-45-sample-mistoonanime_v20                                     stylize.py:464INFO     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                          stylize.py:466INFO     Hint. Edit the config file before starting the generation                                             stylize.py:467INFO     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                          stylize.py:468INFO     1. Change 'path' and 'motion_module' as needed                                                        stylize.py:469INFO     2. Enter the 'head_prompt' or 'tail_prompt' with your preferred prompt, quality prompt, lora trigger  stylize.py:470word, or any other prompt you wish to add.INFO     3. Change 'n_prompt' as needed                                                                        stylize.py:471INFO     4. Add the lora you need to 'lora_map'                                                                stylize.py:472INFO     5. If you do not like the default settings, edit 'ip_adapter_map' or 'controlnet_map'.                stylize.py:473If you want to change the controlnet type, you need to replace the input image.INFO     6. Change 'stylize_config' as needed. By default, it is generated twice: once for normal generation   stylize.py:474and once for upscaling.If you don't need upscaling, delete the whole '1'.INFO     7. Change 'output' as needed. Changing the 'fps' at this timing is not recommended as it will change  stylize.py:475the playback speed.If you want to change the fps, specify it with the create-config option
t recommended as it will change  stylize.py:475the playback speed.If you want to change the fps, specify it with the create-config option

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/3225079.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

个人标准流程管理系统

个人标准流程管理系统(Personal Standard Operating Procedure System, PSOPS)是一种帮助个人组织和优化日常任务、项目管理、学习计划和其他重复性活动的工具。它旨在提升个人效率,确保各项事务按照预设的标准流程执行。以下是设计这样一个系…

计算给定数字的阶乘

1 问题 计算给定数字的阶乘. 2 方法 使用while循环。使用for循环。使用函数。 通过实验、实践等证明提出的方法是有效的&#xff0c;是能够解决开头提出的问题。 代码清单 1 使用while循环numberint(input(请输入一个数字:))factorial1i1while i<number: factorialfactor…

PTrade常见问题系列6

执行k_start.sh脚本发现没有生成日志&#xff1f; 执行k_start.sh脚本发现没有生成日志&#xff1f; 1、检查k_start.sh脚本发现执行downloader前需要检查是否有已存在的downloader进程&#xff0c;ps -ef|grep downloader 发现有很多历史的僵尸进程&#xff0c;所以下载进程…

Mosh|内连接、外连接、左连接、右连接(未完)

下图取自菜鸟教程&#xff0c;侵权删&#xff5e; 一、内连接&#xff1a;Inner Joins 模版&#xff1a;SELECT * FROM A JOIN B ON 条件 含义&#xff1a;返回A与B的交集&#xff0c;列为AB列之和 练习&#xff1a;将order_items表和products表连接&#xff0c;返回产品id和…

鸿蒙语言基础类库:【@ohos.util (util工具函数)】

util工具函数 说明&#xff1a; 本模块首批接口从API version 7开始支持。后续版本的新增接口&#xff0c;采用上角标单独标记接口的起始版本。开发前请熟悉鸿蒙开发指导文档&#xff1a;gitee.com/li-shizhen-skin/harmony-os/blob/master/README.md点击或者复制转到。 该模块…

【论文阅读笔记】Meta 3D AssetGen

【论文阅读笔记】Meta 3D AssetGen: Text-to-Mesh Generation with High-Quality Geometry, Texture, and PBR Materials Info摘要引言创新点 相关工作T23D基于图片的3d 重建使用 PBR 材料的 3D 建模。 方法文本到图像:从文本中生成阴影和反照率图像Image-to-3D:基于pbr的大型重…

hdfs大规模数据存储底层原理详解(第31天)

系列文章目录 一、HDFS设计原理 二、HDFS系统架构 三、HDFS关键技术 四、HDFS应用实例 五、解决HDFS不能处理小文件详解问题 文章目录 系列文章目录前言一、设计原理二、系统架构三、关键技术四、应用实例五、解决HDFS不能处理小文件详解问题1. 合并小文件2. 优化Hive配置3. 使…

计算机的错误计算(二十六)

摘要 结合计算机的错误计算&#xff08;二十四&#xff09;中的 Maple 环境下的计算过程&#xff0c;&#xff08;二十五&#xff09;讨论了&#xff08;不&#xff09;停机问题。事实上&#xff0c;其它数学软件比如 Mathematica 也存在该问题。 &#xff08;不&#xff09;停…

操作系统:信号究竟是什么?如何产生?

OS信号 一、信号的概念二、信号的产生1&#xff09;终端按键产生信号1、 前台进程、后台进程2、验证终端按键是否产生信号 2&#xff09;调用系统函数向进程发信号3&#xff09;硬件异常产生信号1、浮点数溢出&#xff0c;CPU产生信号2 浮点数溢出&#xff0c;产生信号原理3. 空…

基于与STM32的加湿器之雾化片驱动

基于与STM32的加湿器之雾化片驱动 加湿器是一种由电力驱动&#xff0c;用于增加环境湿度的家用电器。加湿器通过特定的方式&#xff08;如蒸发、超声波振动或加热&#xff09;将水转化为水蒸气&#xff0c;并将这些水蒸气释放到空气中&#xff0c;从而增加空气中的湿度。主要功…

Spin Image(旋转图像)

Spin Image特征描述子原理 Spin Image是Johnson于1999年提出&#xff0c;Lazebnik于2005年完善的基于点云空间分布的特征描述方法&#xff0c;其思想是将一定区域的点云分布转换成二维的Spin Image&#xff0c;然后对场景和模型的Spin Image进行相似性度量。Spin Image方法与通…

怎么制作gif动图,视频制作GIF动画更简单

在社交媒体和网络交流中&#xff0c;GIF动画以其生动活泼的表现形式成为了表达情感、幽默和创意的热门媒介。无论是分享日常趣事&#xff0c;还是制作专业演示&#xff0c;一个恰到好处的GIF动图总能吸引目光&#xff0c;传递信息。 但你知道吗&#xff1f;即使没有专业的设计背…

FastReport 指定sql 和修改 数据库连接地址的 工具类 :FastReportHelper

FastReport 指定sql 和修改 数据库连接地址的 工具类 &#xff1a;FastReportHelper 介绍核心代码&#xff1a;完整代码&#xff1a; 介绍 在FastReport中&#xff0c;经常会遇到需要给 sql 加条件的情况&#xff0c;或者给数据库地址做更换。 &#xff08;废话不多说&#x…

Qt:12.输入类控件(QSpinBox-整数值输入的小部件、QDateEdit、QTimeEdit、QDateTimeEdit- 日期和时间输入的控件)

目录 一、QSpinBox-整数值输入的小部件&#xff1a; 1.1QSpinBox介绍&#xff1a; 1.2属性介绍&#xff1a; 1.3通用属性介绍&#xff1a; 1.4信号介绍&#xff1a; 二、QDateEdit、QTimeEdit、QDateTimeEdit- 日期和时间输入的控件&#xff1a; 2.1QDateEdit、QTimeEdit…

从生物学到机械:人眼如何为机器人视觉系统提供无尽灵感?

人眼激发了相机机制的发展&#xff0c;该机制改善了机器人对周围世界的观察和反应方式。 该摄像头系统由马里兰大学&#xff08;UMD&#xff09;计算机科学家领导的团队开发&#xff0c;模仿人眼用于保持清晰稳定的视力的不自主运动。 该团队对相机的原型设计和测试称为…

第三期书生大模型实战营 第1关 Linux 基础知识

第三期书生大模型实战营 第1关 Linux 基础知识 第三期书生大模型实战营 第1关 Linux 基础知识InternStudio开发机创建SSH密钥配置通过本地客户端连接远程服务器通过本地VSCode连接远程服务器运行一个Python程序总结 第三期书生大模型实战营 第1关 Linux 基础知识 Hello大家好&a…

C++证道之路第三章字符串、向量和数组

一、命名空间的using声明 在C中&#xff0c;命名空间是一种将标识符&#xff08;如变量、函数、类等&#xff09;组织到一个单独的作用域中的机制。当我们在大型项目中工作时&#xff0c;可能会遇到命名冲突的问题&#xff0c;这时命名空间就非常有用。 然而&#xff0c;在使…

使用linux的mail命令发送html格式的邮件

1、关闭本机的sendmail服务或者postfix服务 #执行下面的命令&#xff0c;各位大侠都对号入座吧 #sendmial service sendmail stop chkconfig sendmail off #postfix service postfix stop chkconfig postfix off#再狠一点就直接卸载吧.. yum remove sendmail yum remove postf…

一句话彻底搞懂Java的编译和执行过程

编译和运行可以在不同的计算机上实现。 编译阶段&#xff1a;由Javac编译器将 .Java 的源文件编译为 .class 的字节码文件&#xff1b; 运行阶段&#xff1a; jvm中Java编译器运行 .class 的字节码文件&#xff0c;运行过程中&#xff0c;类加载器从硬盘中找到该字节码文件并…

C语言 | Leetcode C语言题解之第226题翻转二叉树

题目&#xff1a; 题解&#xff1a; struct TreeNode* invertTree(struct TreeNode* root) {if (root NULL) {return NULL;}struct TreeNode* left invertTree(root->left);struct TreeNode* right invertTree(root->right);root->left right;root->right le…