Welcome to the ComfyUI Community Docs!¶
欢迎来到 ComfyUI 社区文档! ¶
This is the community-maintained repository of documentation related to ComfyUI, a powerful and modular stable diffusion GUI and backend.
这是社区维护的与 ComfyUI 相关的文档存储库,ComfyUI 是一个强大且模块化的稳定扩散 GUI 和后端。
The aim of this page is to get you up and running with ComfyUI, running your first gen, and providing some suggestions for the next steps to explore.
此页面的目的是帮助您启动并运行 ComfyUI、运行您的第一代,并为下一步探索提供一些建议。
Installation¶ 安装 ¶
We won't be covering the installation of ComfyUI in detail, as the project is under active development, which tends to change the installation instructions. Instead, refer to the README on GitHub and find the sections that are relevant to your install (Linux, macOS or Windows).
我们不会详细介绍 ComfyUI 的安装,因为该项目正在积极开发中,这往往会更改安装说明。相反,请参阅 GitHub 上的自述文件并查找与您的安装(Linux、macOS 或 Windows)相关的部分。
Downloading a Model¶ 下载模型 ¶
If you're entirely new to anything Stable Diffusion-related, the first thing you'll want to do is grab a model checkpoint that you will use to generate your images.
如果您对任何与稳定扩散相关的东西完全陌生,那么您要做的第一件事就是获取将用于生成图像的模型检查点。
Experienced Users 经验丰富的用户
If you already have files (model checkpoints, embeddings etc), there's no need to re-download those. You can keep them in the same location and just tell ComfyUI where to find them. To do this, locate the file called extra_model_paths.yaml.example
, rename it to extra_model_paths.yaml
, then edit the relevant lines and restart Comfy. Once that's done, skip to the next section.
如果您已经有文件(模型检查点、嵌入等),则无需重新下载这些文件。您可以将它们保存在同一位置,只需告诉 ComfyUI 在哪里可以找到它们。为此,找到名为 extra_model_paths.yaml.example
的文件,将其重命名为 extra_model_paths.yaml
,然后编辑相关行并重新启动 Comfy。完成后,跳到下一部分。
You can find a large variety of models on websites like CivitAI or HuggingFace. To start, grab a model checkpoint that you like and place it in models/checkpoints
(create the directory if it doesn't exist yet), then re-start ComfyUI.
您可以在 CivitAI 或 HuggingFace 等网站上找到各种各样的模型。首先,获取您喜欢的模型检查点并将其放置在 models/checkpoints
中(如果尚不存在则创建该目录),然后重新启动 ComfyUI。
First Steps With Comfy¶
舒适的第一步 ¶
At this stage, you should have ComfyUI up and running in a browser tab. The default flow that's loaded is a good starting place to get familiar with. To navigate the canvas, you can either drag the canvas around, or hold Space and move your mouse. You can zoom by scrolling.
在此阶段,您应该已在浏览器选项卡中启动并运行 ComfyUI。加载的默认流程是熟悉的一个很好的起点。要导航画布,您可以拖动画布,或按住 Space 并移动鼠标。您可以通过滚动来缩放。
Accidents happen 意外发生
If you mess something up, just hit Load Default
in the menu to reset it to the inital state.
如果你搞砸了,只需点击菜单中的 Load Default
即可将其重置为初始状态。
ComfyUI默认启动工作流程(在新选项卡中打开图像以便更好地查看)
Before we run our default workflow, let's make a small modification to preview the generated images without saving them:
在运行默认工作流程之前,让我们进行一些小修改以预览生成的图像而不保存它们:
- Right-click on the
Save Image
node, then selectRemove
.
右键单击Save Image
节点,然后选择Remove
。 - Double-click on an empty part of the canvas, type in
preview
, then click on thePreviewImage
option.
双击画布的空白部分,输入preview
,然后单击PreviewImage
选项。 - Locate the
IMAGE
output of theVAE Decode
node and connect it to theimages
input of thePreview Image
node you just added.
找到VAE Decode
节点的IMAGE
输出,并将其连接到刚刚添加的Preview Image
节点的images
输入。
This modification will preview your results without immediately saving them to disk. Don't worry, if you really like a particular result you can still right-click the image and choose Save Image
此修改将预览您的结果,而不立即将其保存到磁盘。不用担心,如果您确实喜欢某个特定结果,您仍然可以右键单击该图像并选择 Save Image
Create your first image by clicking Queue Prompt
in the menu, or hitting Cmd+Enter or Ctrl+Enter on your keyboard, and that's it!
通过单击菜单中的 Queue Prompt
或单击 Cmd + Enter 或 Ctrl + Enter 创建第一张图像在你的键盘上,就是这样!
Loading Other Flows¶ 加载其他流程 ¶
To make sharing easier, many Stable Diffusion interfaces, including ComfyUI, store the details of the generation flow inside the generated PNG. Many of the workflow guides you will find related to ComfyUI will also have this metadata included. To load the associated flow of a generated image, simply load the image via the Load
button in the menu, or drag and drop it into the ComfyUI window. This will automatically parse the details and load all the relevant nodes, including their settings.
为了使共享更容易,许多 Stable Diffusion 界面(包括 ComfyUI)将生成流的详细信息存储在生成的 PNG 中。您会发现许多与 ComfyUI 相关的工作流程指南也包含此元数据。要加载生成图像的关联流程,只需通过菜单中的 Load
按钮加载图像,或将其拖放到 ComfyUI 窗口中。这将自动解析详细信息并加载所有相关节点,包括它们的设置。
No flow is displayed
不显示流量
If you load an image but no flow is displayed, it likely means that the metadata was stripped from the file. If you know the original source of the image, try asking the author to re-upload it on a site that does not strip metadata.
如果加载图像但没有显示流程,则可能意味着元数据已从文件中删除。如果您知道图像的原始来源,请尝试要求作者将其重新上传到不剥离元数据的网站上。
Next Steps¶ 下一步 ¶
This page should have given you a good initial overview of how to get started with Comfy. Thanks to the node-based interface, you can build workflows consisting of dozens of nodes, all doing different things, allowing for some really neat image generation pipelines.
此页面应该已经为您提供了如何开始使用 Comfy 的良好初步概述。借助基于节点的界面,您可以构建由数十个节点组成的工作流程,所有节点都执行不同的操作,从而允许一些非常简洁的图像生成管道。
It's also likely that you now have a lot of questions of what just happened, what each node does, and "how do I do X thing"-type questions. These should hopefully be answered in the rest of these docs.
您现在也可能对刚刚发生的事情、每个节点的作用以及“我如何做 X 件事”类型的问题有很多疑问。这些问题有望在这些文档的其余部分得到解答。
Further support¶ 进一步支持 ¶
Have additional questions that aren't answered by the manual? Check out the ComfyUI Matrix space!
还有手册未解答的其他问题吗?查看 ComfyUI Matrix 空间!