ComfyUI - 配置 AIGC 绘画的 ComfyUI 工具

embedded/2024/9/25 4:57:05/

欢迎关注我的CSDN:https://spike.blog.csdn.net/
本文地址:https://spike.blog.csdn.net/article/details/141140498

免责声明:本文来源于个人知识与公开资料,仅用于学术交流,欢迎讨论,不支持转载。


<a class=ComfyUI" />

ComfyUI 是功能强大且高度模块化的 AI 绘画工具,基于 Stable Diffusion 技术,采用节点式工作流界面,使用户能够更直观地控制图像生成过程。特点是模块化设计,允许用户通过拖放节点来创建和调整工作流,极大地提高了灵活性和可定制性。速度更快,灵活的组建工作流,专业团队的需求,节点式编辑。

GitHub: https://github.com/comfyanonymous/ComfyUI

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

配置 conda 环境

conda create -n comfyui python=3.9
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
pip install numpy==1.26.4

Numpy 必须是 1.x 版本,否则报错:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.

安装其他库:

pip install -r requirements.txt

启动任务,默认端口是 8188:

python3 main.py --listen 0.0.0.0
# nohup python3 -u main.py --listen 0.0.0.0 > nohup.run_main.out &
# ps -aux | grep "main.py"
# kill -9 [pid]

启动成功的日志,例如 http://[your ip]:8188/:

Total VRAM 81052 MB, total RAM 1031523 MB
pytorch version: 1.13.1+cu117
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA A100-SXM4-80GB : 
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: workspace_comfyui/ComfyUI/webImport times for custom nodes:0.0 seconds: workspace_comfyui/ComfyUI/custom_nodes/websocket_image_save.pyStarting serverTo see the GUI go to: http://0.0.0.0:8188

ComfyUI 启动成功:

<a class=ComfyUI" />

ComfyUI 支持复用 Stable Diffusion WebUI 的配置,修改 extra_model_paths.yaml

a111:base_path: workspace/stable_diffusion_webui/checkpoints: models/Stable-diffusionconfigs: models/Stable-diffusionvae: models/VAEloras: |models/Loramodels/LyCORISupscale_models: |models/ESRGANmodels/RealESRGANmodels/SwinIRembeddings: embeddingshypernetworks: models/hypernetworkscontrolnet: extensions/sd-webui-controlnet/models

注意:需要修改 controlnet 的默认模型路径,这个部分与默认不一致,其他逐个验证即可。

workspace_comfyui/ComfyUI/custom_nodes 文件夹中,安装自定义 ComfyUI-Manager 插件:

custom_nodes

第 1 次启动时,需要等待安装配置,## ComfyUI-Manager: installing dependencies. (GitPython)

安装翻译插件:AIGODLIKE-ComfyUI-Translation,重启服务即可:

cd custom_nodes
git clone https://github.com/AIGODLIKE/AIGODLIKE-ComfyUI-Translation.git

ComfyUI 页面翻译成中文:

<a class=ComfyUI" />

点击 Queue Prompt,即可运行程序。

Queue Prompt

提示词:

  • beautiful scenery nature glass bottle landscape, purple galaxy bottle,
  • 美丽的风景自然玻璃瓶景观,紫色银河瓶。

如图所示:

Image

运行报错:

  File "workspace_comfyui/ComfyUI/custom_nodes/ComfyUI-Manager/glob/manager_server.py", line 1710, in <lambda>threading.Thread(target=lambda: asyncio.run(default_cache_update())).start()File "envs/comfyui/lib/python3.9/asyncio/runners.py", line 44, in runreturn loop.run_until_complete(main)File "aiohttp/client_reqrep.py", line 1014, in startself._continue = NoneFile "aiohttp/helpers.py", line 713, in __exit__raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

原因是 GitHub 国内访问异常,使用代理即可,参考源码 ComfyUI-Manager/glob/manager_server.py#1688,即:

async def default_cache_update():async def get_cache(filename):# uri = 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/' + filenameuri = 'https://mirror.ghproxy.com/https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/' + filenamecache_uri = str(core.simple_hash(uri)) + '_' + filenamecache_uri = os.path.join(core.cache_dir, cache_uri)json_obj = await core.get_data(uri, True)with core.cache_lock:with open(cache_uri, "w", encoding='utf-8') as file:json.dump(json_obj, file, indent=4, sort_keys=True)print(f"[ComfyUI-Manager] default cache updated: {uri}")a = get_cache("custom-node-list.json")b = get_cache("extension-node-map.json")c = get_cache("model-list.json")d = get_cache("alter-list.json")e = get_cache("github-stats.json")await asyncio.gather(a, b, c, d, e)threading.Thread(target=lambda: asyncio.run(default_cache_update())).start()

修改 uri,增加 https://mirror.ghproxy.com/ 前缀,即可

参考:https://github.com/runningcheese/MirrorSite


http://www.ppmy.cn/embedded/94276.html

相关文章

食品龙头数字化:Fortinet平台化方案筑牢安全防线

在数字化转型征途中&#xff0c;某食品龙头企业直面多重网络安全挑战。物联网等数据洪流汹涌而至&#xff0c;对其防御体系构成严峻考验。全球化业务的广泛拓展&#xff0c;使数据流动与远程访问的安全性成为焦点问题。同时&#xff0c;内部网络结构的复杂化及线上线下业务的深…

【Impala】学习笔记

Impala学习笔记 【一】Impala介绍【1】简介&#xff08;1&#xff09;简介&#xff08;2&#xff09;优点&#xff08;3&#xff09;缺点 【2】架构&#xff08;1&#xff09;Impalad&#xff08;守护进程&#xff09;&#xff08;2&#xff09;Statestore&#xff08;存储状态…

开源免费前端地图开发组件xdh-map

xdh-map是一个基于Openlayers的地图应用Vue组件&#xff0c;具有多方面的功能和特点。以下是对xdh-map的详细介绍&#xff1a; 一、功能与特性 内置多种地图瓦片&#xff1a;xdh-map内置了百度、高德、天地图等地图瓦片&#xff0c;使得开发者可以方便地在应用中集成多种地图…

培训第二十四天(python基础学习)

上午 python开发工具: 1、安装自带的ide 2、pycharm&#xff08;付费&#xff09; 3、anaconda 1、环境 python2内置&#xff0c;需要换为python3 [root3 ~]# pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ some-package //切换国内下载[root3 ~]# yum lis…

Oracle: oracle大小写敏感问题

oracle大小写敏感含义&#xff1a;比如创建表A和a&#xff0c;A和a是两个不同的表&#xff08;表名不同&#xff09;。 oracle大小写不敏感含义&#xff1a;比如创建了A表就不能创建a表&#xff0c;将A和a看成是相同的表&#xff08;表名相同&#xff09;。 1、查询用户是否存…

Centos7如何更换yum源

Centos7默认的yum源是国外的&#xff0c;所以我们使用的时候就很慢&#xff0c;有时候甚至还会下载失败&#xff0c;所以我们要选择更换yum源&#xff08;我用的是阿里云的&#xff09; 备份原有的 YUM 源配置文件&#xff1a; sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc…

白骑士的Matlab教学基础篇 1.4 函数与脚本

系列目录 上一篇&#xff1a;白骑士的Matlab教学基础篇 1.3 控制流 函数和脚本是 MATLAB 编程中的基本组成部分&#xff0c;它们使得代码更加模块化、可重用和组织化。通过理解函数的定义与调用、参数与返回值&#xff0c;以及 MATLAB 脚本与批处理&#xff0c;可以显著提高编…

matlab实现红绿灯识别

在MATLAB中实现红绿灯识别通常涉及图像处理技术&#xff0c;包括颜色分割、形态学操作、边缘检测等步骤。下面我将给出一个基本的框架和示例代码&#xff0c;用于在MATLAB中识别图像中的红绿灯。 步骤 1: 读取图像 首先&#xff0c;你需要有一张包含红绿灯的图像。 img imr…