Generators & UtilitiesChinese & English

ComfyUI Image Generation

ComfyUI Image Generation (menu title ComfyUI Image Generation...) is a native, dockable Dragonfly panel plugin: it generates images with a local or remote ComfyUI server directly inside Dragonfly, supporting both text-to

Updated 2026-07-07User manual

ComfyUI 图像生成插件用户手册

ComfyUI Image Generation - User Manual

Dragonfly Prototype Apps · ComfyUI Image Generation...

版本 Version 1.0 · 2026-07-04


第一部分 中文手册

目录

1. 简介

2. 适用场景

3. 安装与启用

4. 运行环境与首次配置

5. 界面说明

6. 使用步骤

7. 参数说明

8. 输出结果

9. 常见问题与故障排除

10. 注意事项与已知限制

11. 参考资料

1. 简介

ComfyUI 图像生成(菜单名 ComfyUI Image Generation...)是 Dragonfly 的一个原生可停靠面板插件:它直接在 Dragonfly 内部,通过本机或远程的 ComfyUI 服务器生成图像,支持文生图(txt2img)和图生图(img2img)两种模式,全程无需浏览器、无需 web 服务器、无需访问令牌(token)。

由于面板运行在 Dragonfly 进程内部,它可以做到两件 web 页面无法直接做到的事:其一,图生图的初始图像可以一键截取当前 Dragonfly 视图(通过 ReportHelper.captureSnapshot 在进程内截图);其二,任意一张生成结果都可以一键导入 Dragonfly,成为已发布的 Channel(通过 createChannelFromNumpyArray + publish 完成)。

底层引擎是 ComfyUI——一个独立的开源节点式 Stable Diffusion 前端。插件本身不包含也不捆绑 ComfyUI 的任何代码,只通过其标准 HTTP API(提交工作流、轮询历史、下载结果)与之通信;通信协议实现位于共享模块 comfyui_client.py(纯 Python 标准库,与 web 版 ComfyUI 面板共用同一实现)。插件内置的生成工作流是标准的 ComfyUI txt2img / img2img 图(采样器 euler,调度器 normal,每次生成 1 张图)。

许可证要点:插件只是 ComfyUI 的客户端。ComfyUI 本身及您加载的各 checkpoint 模型分别遵循其各自的开源许可 / 模型许可条款,请在部署前自行确认;插件不分发任何模型。

2. 适用场景

  • 坐在 Dragonfly 前的本机用户:免浏览器、免 web 服务器直接出图,并把结果一键拉进 Dragonfly 做后续分析(分割、测量、合成数据等)。
  • 把当前三维渲染视图或切片视图截取为参考图,做图生图风格化 / 变体生成,用去噪(Denoise)滑块控制与原图的接近程度。
  • 为算法演示、报告插图或合成测试数据快速生成图像素材,导入为 Channel 后可继续使用 Dragonfly 的全部工具链。
  • 与 web 版 ComfyUI 面板互补:web 版面向远程浏览器用户(需要 Prototype Labs Server、网页和 token),本插件面向本机 Dragonfly 用户(只需要 Dragonfly 本身)。

3. 安装与启用

本插件通过 Prototype Labs & Apps Full Package(完整安装包) 安装:

1. 把完整安装包 zip 解压到任意较短路径(如 C:\PL\,避免过深的目录导致 Windows 260 字符路径限制)。

2. 双击 `Install_FullPackage.bat`。

3. 在弹出的安装对话框中勾选想要的 Prototype Apps。注意:所有插件默认不勾选,请手动勾选 ComfyUI Image Generation...;同时保持 Prototype Labs 核心(嵌入式包)一并安装——本插件依赖它提供的 comfyui_client.py 通信模块。

4. 点 Install,等待控制台完成。安装是按用户的(%LOCALAPPDATA%),不需要管理员权限。

5. 完全重启 Dragonfly(彻底退出后重开)。菜单只在 Dragonfly 启动时扫描,任何启用/停用改动都需要重启一次才生效。

6. 重启后,菜单出现在 Prototype Apps > ComfyUI Image Generation...(位于 Generators & Utilities 组、Image Generation 区段)。

以后想启用或停用本插件,最方便的方式是在 Dragonfly 里打开 Developer > Prototype Labs... > Menu Item Manager,在底部 "Prototype Apps (Full Package)" 列表中勾选或取消 ComfyUI Image Generation...,再重启 Dragonfly。停用从不删除任何已有配置,重新启用立即可用。也可以随时重跑安装器(上次的选择就是默认值):%LOCALAPPDATA%\DragonflyPrototypeLabs\FullPackage\installer\Install_FullPackage.bat。

卸载:双击 `Uninstall_FullPackage.bat`(同一 installer 目录中有备份)。它移除所有 Full Package 菜单项与插件,但保留 Prototype Labs 核心。

4. 运行环境与首次配置

本插件没有 Setup Environment 按钮,也不建任何 venv:它直接运行在 Dragonfly 自带的 Python 里(截图与导入 Channel 使用其自带的 numpy / Pillow)。插件本身不需要联网、不需要 GPU、不需要 WSL。真正需要准备的是一个可访问的 ComfyUI 服务器和至少一个 checkpoint 模型:

4.1 方式一:在本机启动 ComfyUI(推荐)

打开 Prototype Apps > Server Management,在 "ComfyUI Server" 分组里有两种启动方式,二者服务同一端口(默认 8188),请只运行其中一种:

  • Start ComfyUI Desktop —— 启动已安装的官方 ComfyUI Desktop(Electron 应用)。它自带后端并可能自动更新,API 就绪可能需要一段时间 / 需要其窗口保持打开。
  • Start Git ComfyUI (headless) —— 首次点击会自动安装一份自包含的 git 版 ComfyUI(建 venv 并下载 PyTorch 及依赖,约需 10-30 分钟,需联网,默认装到 %LOCALAPPDATA%\DragonflyPrototypeLabs\ComfyUI),之后无窗口地运行在 8188 端口——稳定、不自动更新。
  • 两种方式启动的 ComfyUI 在关闭 Dragonfly 后都会继续运行;用同组的 Stop 按钮停止。

启动后还需要给 ComfyUI 准备至少一个 checkpoint 模型(放入 ComfyUI 的 checkpoints 模型目录)。生成速度取决于运行 ComfyUI 那台机器的硬件:有 CUDA GPU 时快得多,纯 CPU 也能出图但很慢——这是 ComfyUI 侧的要求,不是本插件的要求。

4.2 方式二:连接已有的本机 / 远程 ComfyUI

如果本机或局域网内已经有一个在运行的 ComfyUI,直接把面板顶部的 ComfyUI URL 改为它的地址(例如 http://192.168.1.10:8188)再点 Connect / Refresh 即可。URL 输入框的默认值取自环境变量 COMFYUI_URL(或 COMFYUI_HOST / COMFYUI_PORT,以及对应的 DF_PROTOTYPE_LABS_COMFYUI_* 变量),否则为 http://127.0.0.1:8188。

4.3 依赖:Prototype Labs 嵌入式包

面板的 ComfyUI 通信模块 comfyui_client.py 由 Prototype Labs 嵌入式包提供(安装后位于 Dragonfly 用户扩展目录的 GenericMenuItems\Prototype_Labs 下)。若打开面板时状态栏显示 "Could not find comfyui_client.py",请安装 Prototype Labs 嵌入式包(Full Package 核心),或设置环境变量 DF_PROTOTYPE_LABS_DIR 指向包含该文件的目录。

5. 界面说明

菜单点开后出现标题为 ComfyUI Image Generation 的面板(默认浮动窗口,可自由停靠 / 拖动 / 浮动,布局可随会话保存)。自上而下依次为:

5.1 服务器行

  • ComfyUI URL 文本框 —— ComfyUI 服务器地址,默认 http://127.0.0.1:8188(见 4.2 的环境变量)。
  • Connect / Refresh 按钮 —— 测试服务器可达性(访问 /system_stats,4 秒超时)并刷新 checkpoint 列表;成功时状态栏显示 "ComfyUI connected — N checkpoint(s).",失败时红字提示去 Server Management 启动或改 URL。

5.2 模式与模型行

  • Mode 下拉框 —— 两个选项:Text → Image (txt2img)(默认)和 Image → Image (img2img)。切到 img2img 时下方的初始图像区才会显示。
  • Checkpoint 下拉框(可手动输入)—— 列出服务器上的 checkpoint 模型;也可以直接键入名称。留空时生成会自动使用服务器上的第一个 checkpoint。

5.3 提示词区

  • Prompt 多行文本框 —— 正向提示词,占位提示 "Describe the image to generate"。生成时必填。
  • Negative prompt 多行文本框 —— 负向提示词,占位示例 "low quality, blurry",可留空。

5.4 数值参数行

一行五个数字框:Width、Height、Steps、CFG、Seed(取值范围与默认值见第 7 章参数表)。

5.5 初始图像区(仅 img2img 模式显示)

  • Use current Dragonfly view 按钮 —— 在进程内截取当前 Dragonfly 视图作为初始图像,截图尺寸取 Width × Height 的当前值;成功后显示缩略图预览。
  • Load file… 按钮 —— 从磁盘选择一张图片(支持 *.png *.jpg *.jpeg *.bmp *.webp)作为初始图像。
  • 预览标签 —— 未设置时显示 "(no init image)",设置后显示缩略图(高约 160 像素)。
  • Denoise 滑块 + 数值 —— 范围 0.10-1.00,默认 0.60;值越低越接近初始图像,越高越自由发挥。

5.6 生成按钮与状态栏

  • Generate 按钮 —— 按当前参数提交一次生成;生成在后台线程运行,期间界面不冻结,按钮暂时置灰,状态栏显示 "Generating… (this can take a while)"。单次生成最长等待 15 分钟(900 秒)。
  • Generate samples 按钮 —— 一键运行 6 条内置示例提示词(txt2img、随机种子、内置负向提示词),结果每完成一张就流式追加到下方画廊,鼠标悬停卡片可查看对应提示词。无需自己写提示词,适合快速验证连通性和模型效果。
  • 状态栏 —— 灰色小字显示进度和结果信息,出错时变红并显示错误摘要。

5.7 Results 结果区

  • Import as RGB (3 channels) 复选框 —— 默认不勾选(按灰度导入为 1 个 Channel);勾选后按 R/G/B 拆成 3 个 Channel 导入。
  • 结果画廊(可滚动)—— 每张生成结果一张卡片:左侧缩略图,右侧 Import as Channel 按钮,一键把该图导入 Dragonfly。

6. 使用步骤

6.1 文生图(txt2img)

1. 确保有一个可访问的 ComfyUI(见第 4 章),在面板顶部确认 ComfyUI URL,点 Connect / Refresh,等待状态栏显示 "ComfyUI connected — N checkpoint(s)."。

2. Mode 保持 Text → Image (txt2img),在 Checkpoint 里选择(或键入)一个模型;留空则自动用服务器上第一个。

3. 在 Prompt 里描述要生成的图像,按需填写 Negative prompt。

4. 按需调整 Width / Height / Steps / CFG / Seed(Seed 填 -1 表示每次随机)。

5. 点 Generate。状态栏显示进度;完成后状态栏报告 "Generated N image(s) with <模型> (seed <种子>).",结果出现在下方画廊。

6.2 图生图(img2img)

1. 把 Mode 切到 Image → Image (img2img),面板中部出现 "Init image (img2img)" 区域。

2. 设置初始图像:点 Use current Dragonfly view 直接截取当前视图(先把 Dragonfly 视图调整到想要的画面;截图尺寸取 Width × Height),或点 Load file… 选择一张本地图片。预览缩略图出现即成功。

3. 调整 Denoise 滑块:想保留原图构图就调低(如 0.30-0.50),想大幅重绘就调高(如 0.70 以上)。

4. 填写 Prompt(描述期望的风格 / 内容,必填)与其它参数,点 Generate。

5. 注意:img2img 模式下输出图像的尺寸由初始图像决定(工作流对初始图像做 VAE 编码),Width / Height 只影响 "Use current Dragonfly view" 的截图大小。

6.3 一键样例(Generate samples)

1. 连接成功后直接点 Generate samples,无需填写提示词。

2. 面板依次生成 6 张内置示例(状态栏显示 "Generated sample i/6…"),每完成一张即追加到画廊;悬停卡片可看到该图用的提示词。

6.4 把结果导入 Dragonfly

1. 决定导入方式:默认灰度(1 个 Channel);若想保留颜色信息,勾选 Import as RGB (3 channels)。

2. 在目标结果卡片上点 Import as Channel。

3. 状态栏显示 "Imported into Dragonfly as a Channel (<GUID>).",新 Channel 已发布到当前会话,可在对象列表中找到(命名为 ComfyUI <文件名>,RGB 方式则为 3 个带 (R) (G) (B) 后缀的 Channel),像普通数据集一样查看和处理。

7. 参数说明

参数

默认值

说明

ComfyUI URL

http://127.0.0.1:8188

ComfyUI 服务器地址;默认值可被环境变量 COMFYUI_URL / COMFYUI_HOST / COMFYUI_PORT 覆盖。

Mode

Text → Image (txt2img)

生成模式:txt2img(纯文本出图)或 img2img(基于初始图像重绘)。

Checkpoint

(服务器列表首项)

使用的 checkpoint 模型;可下拉选择或手动键入;留空时自动取服务器上的第一个,若服务器一个都没有则报错。

Prompt

(空)

正向提示词,描述要生成的内容;必填,为空时生成会报 "Prompt is required."。

Negative prompt

(空)

负向提示词,描述要避免的内容;可留空。

Width

512

输出宽度(像素),范围 64-2048,步进 64;img2img 模式下仅决定视图截图尺寸,输出尺寸随初始图像。

Height

512

输出高度(像素),范围 64-2048,步进 64;img2img 说明同上。

Steps

20

采样步数,范围 1-150;步数越多细节越精细但越慢。

CFG

7.0

提示词遵从度(classifier-free guidance),范围 0.0-30.0,步进 0.5;越高越贴合提示词。

Seed

-1

随机种子,范围 -1 至 2,000,000,000;-1 表示每次随机;填固定值可复现结果(实际使用的种子会显示在完成状态里)。

Denoise(仅 img2img)

0.60

去噪强度,滑块范围 0.10-1.00;越低越接近初始图像,越高越偏离。

Import as RGB (3 channels)

不勾选

导入方式:不勾选=转灰度导入为 1 个 Channel;勾选=按 R/G/B 拆成 3 个 Channel 导入。

内置工作流固定使用采样器 euler + 调度器 normal,每次生成 1 张图;单次生成的等待上限为 900 秒。

8. 输出结果

插件产生两类输出:

  • 面板内的结果画廊 —— 每次 Generate / Generate samples 的成品以缩略图卡片显示在 Results 区(Generate 会先清空画廊,samples 逐张追加)。
  • Dragonfly Channel(点 Import as Channel 后) —— 灰度方式:图像转为亮度图,导入为 1 个单切片二维 Channel(命名 ComfyUI <文件名>)并自动 publish 发布;RGB 方式:拆成 R/G/B 三个分量,发布 3 个 Channel(名称带 (R) (G) (B) 后缀)。这是因为 Dragonfly 的 Channel 是标量场,一个 Channel 无法承载彩色。发布后的 Channel 出现在对象列表中,可拖入视图查看、参与任何后续处理;状态栏会显示新对象的 GUID。

此外,ComfyUI 服务器自身也会按其常规行为把成品保存在其输出目录(文件名前缀 DragonflyPrototypeLabs),需要原始 PNG 文件时可去那里找。

9. 常见问题与故障排除

问:状态栏红字 "ComfyUI not reachable...",连接不上怎么办?

答:说明填写的 URL 上没有响应的 ComfyUI。本机使用时先到 Prototype Apps > Server Management 启动 ComfyUI(Desktop 或 Git headless 二选一);ComfyUI Desktop 启动后 API 就绪可能还要等一会儿,Git 版首次启动要先完成 10-30 分钟的自动安装。远程使用时确认对方 ComfyUI 正在运行、URL(含端口,默认 8188)正确、防火墙放行,然后再点 Connect / Refresh。

问:Checkpoint 下拉是空的,或生成时报 "No ComfyUI checkpoint was found"?

答:ComfyUI 服务器上没有安装任何 checkpoint 模型。请把至少一个模型文件放入该 ComfyUI 的 checkpoints 模型目录,然后点 Connect / Refresh 重新拉取列表;也可以在可编辑的 Checkpoint 框里直接键入模型名。

问:打开面板就提示 "Could not find comfyui_client.py"?

答:本插件依赖 Prototype Labs 嵌入式包提供的 comfyui_client.py。请用 Full Package 安装器把 Prototype Labs 核心装上(或重新安装),或设置环境变量 DF_PROTOTYPE_LABS_DIR 指向包含该文件的目录,然后重启 Dragonfly。

问:点 Generate 提示 "img2img needs an init image"?

答:img2img 模式必须先设置初始图像——点 Use current Dragonfly view 截取当前视图,或点 Load file… 选择一张图片,预览缩略图出现后再生成。

问:点 "Use current Dragonfly view" 报 "Could not capture the view"?

答:需要 Dragonfly 中存在一个当前视图。请先在主窗口点选一个视图(使其成为活动视图)再截取;若仍失败,可改用 Load file… 加载事先手动截好的图。

问:导入 Dragonfly 后图像变成灰色的了?

答:默认导入会把彩色图转成灰度(Dragonfly 的 Channel 是标量场)。想保留颜色请先勾选 Import as RGB (3 channels) 再点 Import as Channel,会得到 R/G/B 三个 Channel。

问:生成很慢甚至超时?

答:生成速度完全取决于 ComfyUI 那台机器的硬件(有无 CUDA GPU)、模型大小和步数。首次用某个 checkpoint 生成时服务器还要先把模型载入内存。可减小 Width/Height、降低 Steps;单次生成的等待上限是 900 秒,超时会报错但不影响面板继续使用。

10. 注意事项与已知限制

  • 本插件面向本机 Dragonfly 用户,面板本身不提供远程访问;需要远程浏览器出图请使用 web 版 ComfyUI 面板(Prototype Labs Server + 网页)。
  • 每次 Generate 只生成 1 张图(batch_size=1);内置工作流固定为标准 txt2img / img2img 图(euler + normal),不支持加载自定义 ComfyUI 工作流。
  • img2img 的输出尺寸由初始图像决定,Width / Height 不改变 img2img 输出大小(只影响视图截图尺寸)。
  • 导入的 Channel 是单切片二维数据(1 × 高 × 宽);彩色只能以 3 个标量 Channel 的形式保留。
  • 点 Generate 会清空上一轮的结果画廊,需要保留的图请先导入为 Channel(或去 ComfyUI 输出目录取文件)。
  • 生成期间请保持 ComfyUI 服务器运行;Server Management 启动的 ComfyUI 在关闭 Dragonfly 后仍会继续运行,不用时记得用 Stop 停止以释放显存。
  • Denoise 滑块最低 0.10;Seed 输入框上限为 2,000,000,000(填 -1 时实际随机种子可能超出此显示范围,以完成状态里报告的种子为准)。
  • 插件本身不需要联网;但 Server Management 的 Git 版 ComfyUI 首次自动安装需要联网下载 PyTorch 与依赖。

11. 参考资料

  • ComfyUI 开源项目(引擎本体,含文档与模型目录说明):https://github.com/comfyanonymous/ComfyUI
  • Full Package 安装 / 启用 / 卸载详情:安装包内的 README(中英双语)。
  • 本机 ComfyUI 服务器的启动与停止:Prototype Apps > Server Management 面板内的说明文字。


Part II English Manual

Contents

1. Overview

2. Use Cases

3. Installation and Enabling

4. Runtime Environment and First-Time Setup

5. User Interface

6. Step-by-Step Usage

7. Parameter Reference

8. Outputs

9. FAQ and Troubleshooting

10. Notes and Known Limitations

11. References

1. Overview

ComfyUI Image Generation (menu title ComfyUI Image Generation...) is a native, dockable Dragonfly panel plugin: it generates images with a local or remote ComfyUI server directly inside Dragonfly, supporting both text-to-image (txt2img) and image-to-image (img2img) - with no browser, no web server, and no access token.

Because the panel runs inside the Dragonfly process, it can do two things a web page cannot do directly: first, the img2img init image can be the current Dragonfly view, captured in-process via ReportHelper.captureSnapshot; second, any generated result can be imported into Dragonfly as a published Channel with one click (via createChannelFromNumpyArray + publish).

The underlying engine is ComfyUI - an independent, open-source node-based Stable Diffusion front end. The plugin contains and bundles none of ComfyUI's code; it only talks to it over its standard HTTP API (submit a workflow, poll the history, download results). The protocol lives in the shared comfyui_client.py module (pure Python standard library, the same single implementation used by the web-based ComfyUI panel). The built-in generation workflows are the standard ComfyUI txt2img / img2img graphs (sampler euler, scheduler normal, one image per run).

Licensing: the plugin is only a ComfyUI client. ComfyUI itself and each checkpoint model you load are governed by their own open-source / model licenses - please verify them before deployment; the plugin distributes no models.

2. Use Cases

  • A user sitting at Dragonfly: generate images without a browser or web server and pull results straight into Dragonfly for further analysis (segmentation, measurement, synthetic data, etc.).
  • Capture the current 3D render or slice view as a reference image for an img2img restyle / variation, using the Denoise slider to control how close to stay to the source.
  • Quickly produce imagery for algorithm demos, report figures, or synthetic test data; once imported as a Channel it works with Dragonfly's full toolchain.
  • Complements the web-based ComfyUI panel: the web version targets remote browser users (needs the Prototype Labs Server, a web page, and a token); this plugin targets the local Dragonfly user (needs just Dragonfly).

3. Installation and Enabling

The plugin is installed via the Prototype Labs & Apps Full Package installer:

1. Unzip the Full Package to any short path (e.g. C:\PL\; avoid deep folders because of the Windows 260-character path limit).

2. Double-click `Install_FullPackage.bat`.

3. In the installer dialog, tick the Prototype Apps you want. Note: all plugins are unticked by default, so tick ComfyUI Image Generation... manually. Also keep the Prototype Labs core (embedded package) installed - this plugin depends on the comfyui_client.py module it ships.

4. Click Install and wait for the console to finish. Installation is per-user (%LOCALAPPDATA%); no admin rights needed.

5. Restart Dragonfly completely (quit fully, then reopen). Menus are discovered only at startup, so every enable/disable change needs one restart.

6. After the restart, the menu appears at Prototype Apps > ComfyUI Image Generation... (in the Generators & Utilities group, Image Generation section).

To enable or disable the plugin later, the easiest way is inside Dragonfly: open Developer > Prototype Labs... > Menu Item Manager, tick or untick ComfyUI Image Generation... in the "Prototype Apps (Full Package)" list at the bottom, then restart Dragonfly. Disabling never deletes any settings; re-enabling is instant. You can also re-run the installer at any time (your previous choices are the new defaults): %LOCALAPPDATA%\DragonflyPrototypeLabs\FullPackage\installer\Install_FullPackage.bat.

Uninstall: double-click `Uninstall_FullPackage.bat` (a copy is kept in the same installer folder). It removes all Full Package menu items and plugins but keeps the Prototype Labs core.

4. Runtime Environment and First-Time Setup

This plugin has no Setup Environment button and builds no venv: it runs directly in Dragonfly's own Python (the view snapshot and Channel import use its bundled numpy / Pillow). The plugin itself needs no internet, no GPU, and no WSL. What you actually have to prepare is a reachable ComfyUI server with at least one checkpoint model:

Open Prototype Apps > Server Management. The "ComfyUI Server" group offers two ways to start ComfyUI, both serving the same port (default 8188) - run only one at a time:

  • Start ComfyUI Desktop - launches the installed official ComfyUI Desktop (Electron) app. It manages its own backend and may auto-update, so its API can take a while to come up / may need its window open.
  • Start Git ComfyUI (headless) - the first click auto-installs a self-contained git checkout of ComfyUI (creates a venv and downloads PyTorch plus requirements, about 10-30 minutes, internet required, installed to %LOCALAPPDATA%\DragonflyPrototypeLabs\ComfyUI by default), then runs it windowless on port 8188 - reliable, no auto-update.
  • Either way, ComfyUI keeps running after you close Dragonfly; stop it with the group's Stop button.

After starting, ComfyUI also needs at least one checkpoint model (placed in that ComfyUI's checkpoints model folder). Generation speed depends on the hardware of the machine running ComfyUI: much faster with a CUDA GPU, CPU-only also works but is slow - this is a ComfyUI-side requirement, not a requirement of this plugin.

4.2 Option B: connect to an existing local / remote ComfyUI

If a ComfyUI is already running on this machine or on your network, simply set the ComfyUI URL at the top of the panel to its address (e.g. http://192.168.1.10:8188) and click Connect / Refresh. The URL field's default comes from the environment variables COMFYUI_URL (or COMFYUI_HOST / COMFYUI_PORT, plus the matching DF_PROTOTYPE_LABS_COMFYUI_* variables), otherwise http://127.0.0.1:8188.

4.3 Dependency: the Prototype Labs embedded package

The panel's ComfyUI protocol module comfyui_client.py is shipped by the Prototype Labs embedded package (after installation it lives under GenericMenuItems\Prototype_Labs in Dragonfly's user-extensions folder). If the panel opens with the status message "Could not find comfyui_client.py", install the Prototype Labs embedded package (the Full Package core), or set the environment variable DF_PROTOTYPE_LABS_DIR to a folder containing that file.

5. User Interface

The menu opens a panel titled ComfyUI Image Generation (floating by default; it can be freely docked / moved / floated, and the layout can be saved with the session). From top to bottom:

5.1 Server row

  • ComfyUI URL text field - the ComfyUI server address, default http://127.0.0.1:8188 (see the environment variables in 4.2).
  • Connect / Refresh button - tests reachability (queries /system_stats with a 4-second timeout) and refreshes the checkpoint list; on success the status bar shows "ComfyUI connected — N checkpoint(s).", on failure a red hint points you to Server Management or the URL field.

5.2 Mode and model row

  • Mode combo box - two options: Text → Image (txt2img) (default) and Image → Image (img2img). The init-image area below only appears in img2img mode.
  • Checkpoint combo box (editable) - lists the checkpoint models on the server; you can also type a name directly. If left empty, generation automatically uses the first checkpoint on the server.

5.3 Prompt area

  • Prompt multi-line field - the positive prompt, placeholder "Describe the image to generate". Required for generation.
  • Negative prompt multi-line field - the negative prompt, placeholder example "low quality, blurry"; may be left empty.

5.4 Numeric parameter row

One row of five numeric fields: Width, Height, Steps, CFG, Seed (ranges and defaults in the parameter table, Chapter 7).

5.5 Init image area (img2img mode only)

  • Use current Dragonfly view button - captures the current Dragonfly view in-process as the init image; the snapshot size is the current Width × Height; a thumbnail preview appears on success.
  • Load file… button - pick an image from disk (*.png *.jpg *.jpeg *.bmp *.webp) as the init image.
  • Preview label - shows "(no init image)" until set, then a thumbnail (about 160 px high).
  • Denoise slider + value - range 0.10-1.00, default 0.60; lower stays closer to the init image, higher deviates more freely.

5.6 Generate buttons and status bar

  • Generate button - submits one generation with the current parameters; it runs on a background thread so the UI stays responsive, the button is temporarily disabled, and the status bar shows "Generating… (this can take a while)". A single generation waits at most 15 minutes (900 seconds).
  • Generate samples button - one click runs 6 built-in sample prompts (txt2img, random seed, built-in negative prompt); results stream into the gallery below as each finishes, and hovering a card shows its prompt. No prompt writing needed - handy for quickly validating connectivity and the model.
  • Status bar - small gray text with progress and result info; turns red with an error summary on failure.

5.7 Results area

  • Import as RGB (3 channels) checkbox - unticked by default (grayscale import as 1 Channel); when ticked, the image is split into R/G/B and imported as 3 Channels.
  • Result gallery (scrollable) - one card per generated image: a thumbnail on the left and an Import as Channel button on the right for one-click import into Dragonfly.

6. Step-by-Step Usage

6.1 Text-to-image (txt2img)

1. Make sure a ComfyUI is reachable (Chapter 4), confirm the ComfyUI URL at the top of the panel, click Connect / Refresh, and wait for "ComfyUI connected — N checkpoint(s)." in the status bar.

2. Keep Mode at Text → Image (txt2img) and pick (or type) a model in Checkpoint; if left empty, the first checkpoint on the server is used automatically.

3. Describe the desired image in Prompt and optionally fill in Negative prompt.

4. Adjust Width / Height / Steps / CFG / Seed as needed (Seed -1 means random each time).

5. Click Generate. The status bar shows progress; on completion it reports "Generated N image(s) with <model> (seed <seed>)." and the results appear in the gallery below.

6.2 Image-to-image (img2img)

1. Switch Mode to Image → Image (img2img); the "Init image (img2img)" area appears in the middle of the panel.

2. Set the init image: click Use current Dragonfly view to capture the current view (arrange the Dragonfly view first; the snapshot uses Width × Height), or click Load file… to pick a local image. A preview thumbnail confirms success.

3. Adjust the Denoise slider: lower (e.g. 0.30-0.50) to keep the source composition, higher (e.g. above 0.70) for a heavy repaint.

4. Fill in Prompt (the desired style / content - required) and the other parameters, then click Generate.

5. Note: in img2img mode the output size is determined by the init image (the workflow VAE-encodes the init pixels); Width / Height only affect the size of the "Use current Dragonfly view" snapshot.

6.3 One-click samples (Generate samples)

1. Once connected, simply click Generate samples - no prompt needed.

2. The panel generates 6 built-in samples one after another (the status bar shows "Generated sample i/6…"); each finished image is appended to the gallery, and hovering a card shows the prompt it used.

6.4 Importing results into Dragonfly

1. Choose the import mode: grayscale by default (1 Channel), or tick Import as RGB (3 channels) to keep the colour information.

2. Click Import as Channel on the desired result card.

3. The status bar shows "Imported into Dragonfly as a Channel (<GUID>)." - the new Channel is published into the current session and appears in the object list (named ComfyUI <filename>; in RGB mode you get 3 Channels suffixed (R) (G) (B)), ready to be viewed and processed like any dataset.

7. Parameter Reference

Parameter

Default

Description

ComfyUI URL

http://127.0.0.1:8188

ComfyUI server address; the default can be overridden by the COMFYUI_URL / COMFYUI_HOST / COMFYUI_PORT environment variables.

Mode

Text → Image (txt2img)

Generation mode: txt2img (from text only) or img2img (repaint based on an init image).

Checkpoint

(first server entry)

The checkpoint model to use; pick from the list or type a name; if empty, the first checkpoint on the server is used, and an error is raised if the server has none.

Prompt

(empty)

Positive prompt describing the desired image; required - an empty prompt fails with "Prompt is required.".

Negative prompt

(empty)

Negative prompt describing what to avoid; may be left empty.

Width

512

Output width in pixels, range 64-2048, step 64; in img2img mode it only sets the view-snapshot size (output size follows the init image).

Height

512

Output height in pixels, range 64-2048, step 64; same img2img note as Width.

Steps

20

Sampling steps, range 1-150; more steps mean finer detail but slower generation.

CFG

7.0

Prompt adherence (classifier-free guidance), range 0.0-30.0, step 0.5; higher follows the prompt more closely.

Seed

-1

Random seed, range -1 to 2,000,000,000; -1 means random each run; a fixed value reproduces results (the seed actually used is reported in the completion status).

Denoise (img2img only)

0.60

Denoising strength, slider range 0.10-1.00; lower stays closer to the init image, higher deviates more.

Import as RGB (3 channels)

unticked

Import mode: unticked = convert to grayscale and import as 1 Channel; ticked = split into R/G/B and import as 3 Channels.

The built-in workflows always use the euler sampler with the normal scheduler and generate 1 image per run; a single generation waits at most 900 seconds.

8. Outputs

The plugin produces two kinds of output:

  • The in-panel result gallery - every Generate / Generate samples run shows its images as thumbnail cards in the Results area (Generate clears the gallery first; samples append one by one).
  • Dragonfly Channels (after clicking Import as Channel) - grayscale mode: the image is converted to luminance and imported as one single-slice 2D Channel (named ComfyUI <filename>) which is automatically published; RGB mode: the image is split into R/G/B and published as 3 Channels (names suffixed (R) (G) (B)). This is because a Dragonfly Channel is a scalar field - a single Channel cannot hold colour. Published Channels appear in the object list, can be dragged into views, and participate in any downstream processing; the status bar reports the new object's GUID.

In addition, the ComfyUI server itself saves the finished images in its own output folder as usual (file-name prefix DragonflyPrototypeLabs) - look there if you need the original PNG files.

9. FAQ and Troubleshooting

Q: The status bar shows "ComfyUI not reachable..." in red - what now?

A: No ComfyUI is answering at the given URL. For local use, start ComfyUI first in Prototype Apps > Server Management (Desktop or Git headless - one of the two); ComfyUI Desktop may need extra time after launch before its API is up, and the Git version's first start must complete its 10-30-minute auto-install. For remote use, verify the remote ComfyUI is running, the URL (including the port, default 8188) is correct, and the firewall allows it - then click Connect / Refresh again.

Q: The Checkpoint list is empty, or generation fails with "No ComfyUI checkpoint was found"?

A: The ComfyUI server has no checkpoint models installed. Put at least one model file into that ComfyUI's checkpoints model folder, then click Connect / Refresh to reload the list; you can also type the model name directly into the editable Checkpoint box.

Q: The panel opens with "Could not find comfyui_client.py"?

A: This plugin depends on comfyui_client.py shipped by the Prototype Labs embedded package. Install (or reinstall) the Prototype Labs core with the Full Package installer, or set the environment variable DF_PROTOTYPE_LABS_DIR to a folder containing that file, then restart Dragonfly.

Q: Generate complains "img2img needs an init image"?

A: img2img mode requires an init image first - click Use current Dragonfly view to capture the current view, or Load file… to pick an image; generate only after the preview thumbnail appears.

Q: "Use current Dragonfly view" fails with "Could not capture the view"?

A: A current Dragonfly view must exist. Click into a view in the main window first (making it the active view), then capture again; if it still fails, use Load file… with a manually taken screenshot instead.

Q: The imported image is gray in Dragonfly?

A: The default import converts colour images to grayscale (a Dragonfly Channel is a scalar field). To keep the colour, tick Import as RGB (3 channels) before clicking Import as Channel - you get three Channels, R/G/B.

Q: Generation is very slow or times out?

A: Speed depends entirely on the hardware of the machine running ComfyUI (CUDA GPU or not), the model size, and the step count. The first generation with a checkpoint also loads the model into memory on the server. Try smaller Width/Height or fewer Steps; a single generation waits at most 900 seconds - a timeout raises an error but the panel remains usable.

10. Notes and Known Limitations

  • This plugin targets the local Dragonfly user; the panel itself offers no remote access. For remote-browser image generation use the web-based ComfyUI panel (Prototype Labs Server + web page).
  • Each Generate produces one image (batch_size = 1); the built-in workflows are the fixed standard txt2img / img2img graphs (euler + normal) - loading custom ComfyUI workflows is not supported.
  • The img2img output size is determined by the init image; Width / Height do not change the img2img output size (they only set the view-snapshot size).
  • Imported Channels are single-slice 2D data (1 × height × width); colour can only be preserved as 3 scalar Channels.
  • Clicking Generate clears the previous result gallery - import images you want to keep as Channels first (or fetch the files from the ComfyUI output folder).
  • Keep the ComfyUI server running during generation. A ComfyUI started from Server Management keeps running after you close Dragonfly - remember to Stop it when unused to free GPU memory.
  • The Denoise slider's minimum is 0.10; the Seed field's maximum is 2,000,000,000 (with -1, the actual random seed may exceed this display range - the seed reported in the completion status is authoritative).
  • The plugin itself needs no internet; however, the first-time auto-install of the Git ComfyUI in Server Management does need internet to download PyTorch and the requirements.

11. References

  • ComfyUI open-source project (the engine itself, with documentation and model-folder layout): https://github.com/comfyanonymous/ComfyUI
  • Full Package install / enable / uninstall details: the bilingual README inside the installer package.
  • Starting and stopping a local ComfyUI server: the explanatory text inside the Prototype Apps > Server Management panel.
You’ve reached the end of this manual.Explore the library →