模型部署arrowPic ComfyUI-tPonynai 模型部署教程
ComfyUI-tPonynai 模型部署教程
发布时间:2025-02-08 09:57:29

一、介绍

image.png

tPonynai是在C站上开源的动漫风格扩散模型,与其他基础大模型一样,只需要输入适当的正面和负面提示词就能够实现动漫图片的生成。截至目前已经有12.9k的下载量,生成效果也非常不错。

二、部署

本检查点模型通过ComfyUI的工作流进行实现,因此需要提前部署ComfyUI。

1. 部署ComfyUI

本篇的模型部署是在ComfyUI的基础上进行,如果没有部署过ComfyUI,请按照下面流程先进行部署,如已安装请跳过该步:

(1)使用命令克隆 ComfyUI

git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI

(2)安装 conda(如已安装则跳过)

下面需要使用 Anaconda 或 Mimiconda 创建虚拟环境,可以输入 conda --version 进行检查。下面是 Mimiconda 的安装过程:

  • 下载 Miniconda 安装脚本
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
  • 运行安装脚本
bash Miniconda3-latest-Linux-x86_64.sh
  • 遵循安装提示并初始化

按 Enter 键查看许可证条款,阅读完毕后输入 yes 接受条款,安装完成后,脚本会询问是否初始化 conda 环境,输入 yes 并按 Enter 键。

  • 运行 source ~/.bashrc 命令激活 conda 环境
  • 再次输入 conda --version 命令来验证是否安装成功,如果出现类似 conda 4.10.3 这样的输出就成功了。

(3)创建虚拟环境

输入下面的命令:

conda create -n comfyui
conda activate comfyui

(4)安装 pytorch

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121

(5)安装项目依赖

pip install -r requirements.txt

此时所需环境就已经搭建完成,通过下面命令进行启动:

python main.py

访问网址得到类似下图界面即表示成功启动:

image.png

到这里Comfy UI就初步搭建好了(这里只是简单实现ComfyUI的基础功能,如果想要安装更多细节,请看我“Comfy UI”部署教程)

2. 部署tPonynai3模型

(1)下载检查点模型

C站搜索栏搜索”T-ponynai3“,点击进去将该模型下载到 /ComfyUI/models/checkpoints/文件夹下:
image.png

(2)下载lora模型

lora模型可以根据自己喜欢的下载并更替,甚至于不下载,直接使用基础大模型也可以。只是使用lora能更好的控制图片的生成,提高生成图片的质量。我使用了”STYLES | PONY & XL“模型,在C站搜索下载后将其放到 /ComfyUI/models/loras/路径下即可。

(3)开始绘画

启动comfyui,然后你会得到下面一个基础工作流(类似下图):

image.png

输入提示词,点击运行即可生成图片,上图我的提示词为:

正面提示词:

score_9, score_8_up, score_7_up, 1girl, short hair, blonde hair, green eyes, hair bun, pale skin, medium breasts, collarbone, oversized white shirt, off-shoulder, short sleeves, sitting, [table, chair, book, lamp, bookcase, plant, pond, mountains, tatami, wallpaper, the sky is on the side of the screen, blue sky], in the living room, (close-up of the face: 1.6), looking at viewer, perfect lighting

负面提示词:

score_4, score_3, score_2, score_1, embedding:easynegative,(low quality, worst quality:1.4), ((muscle)), face mask, disfigured, kitsch, ugly, oversaturated, grain, low-res, Deformed, blurry, black and white, greyscale, bad anatomy, poorly drawn face, mutation, mutated, extra limb, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, long body, disgusting, poorly drawn, childish, mutilated, mangled, surreal, text, disfigured palms, extra joints, asymmetrical hands, poorly drawn hands, missing fingers, embedding:negative_hand-neg,embedding:bad-hands-5,embedding:BadNegAnatomyV1-neg,embedding:badhandv4, embedding:NegfeetV2, embedding:verybadimagenegative_v1.3, embedding:fcNeg-neg, embedding:BadDream

当然我们可以加入Lora模型来进行调整出图效果,工作流如下:

image.png

使用效果如上,快开启你的探索之旅吧!

点击此处,立即体验ComfyUI-tPonynai!

bg-circle
算力加速·赋能科研
2026闲时计算资源公益助研活动进行中
2026年1月1日-2026年12月31
立即申请
新人好礼
客服中心