ComfyUI is a tool for generating images which can be deployed locally.
ComfyUI is the most powerful and modular diffusion model GUI, API and backend with a graph/nodes interface. Now you can use it in Dify, input the prompt or images, and get the generated image.
It is highly recommended to install comfy-asset-downloader on your ComfyUI server as this plugin needs it to download models automatically.
Please refer to its official documentation to ensure that ComfyUI can run normally and generate images.
As shown in the figure, select . If there is no such selection, you need to enable in the settings.
The ComfyUI tools could be found at the Plugin Marketplace, please install it first.
On the Dify navigation page, click and fill in the URL of ComfyUI Server.
You can use the ComfyUI tool in the following application types:
Both Chatflow and Workflow applications support the tool node. After adding it, you need to fill in the "Input Variables → Prompt" in the node with variables to reference the user's input prompt or the content generated by the previous node. Finally, use the variable to reference the image output by in the "End" node.
Add the tool in the Agent application, then send a picture description in the dialog box to call the tool to generate an AI image.
Some ComfyUI workflows require multiple images inputs. In Dify, it will find every node in the and fill in the image files input by the user in order. When you want to change this order, you can adjust it by filling in the . For example, if your workflow needs to input images into the 35th, 69th, and 87th nodes, then input will pass the first image to the 69th node.

Workflow node is a basic node for ComfyUI.
You can set any ComfyUI node settings by inputting JSON to this node.
Quick Start node supports some functions of ComfyUI including the following ones. Best for beginners.
List Models can fetch all the names of the models, sampling methods and schedulers available on the connected ComfyUI.
CivitAI Download node can download models from CivitAI.
You need to input model ID and version ID to download a model.
These two IDs are shown as AIR(see the highlited area on the image below).

Hugging Face Download node can download models from Hugging Face.
Download By URL node can download models from a given URL.
Txt2Img node can generate an image from texts(prompt and negative prompt).
If you want to generate large images(typically 1600x1600 or bigger), HiresFix option is for you.
It generates a small and consistent image then upscale it.
Without HiresFix, large images tend to have unnaturally duplicated objects and artifacts.
Txt2Vid node can generate an video from texts(prompt and negative prompt).
Txt2Aud node can generate an audio from texts(prompt and negative prompt).
Img2Img node can edit an given image according to prompt and negative prompt.
Img2Vid node can generate an video from an given image.
Img2Any node takes only images and edits them in a various way.
The following features are supported.
Some features require addons for ComfyUI. You need to install them to ComfyUI in advance.
If you don't know how to host ComfyUI, a prebuilt docker image would help you.
It has ComfyUI itself and all the required packages for this plugin.
All you need to start a ComfyUI server is to type the following command on a server with docker and a GPU installed.
If you want to save large models to somewhere other than the system disk, say "/mnt/hdd/models", you can use -v option.
Specifically, the docker image contains the following packages.
https://github.com/langgenius/dify-official-plugins/pull/1728
New features:
Deletion:
Fix:
Refactor:
https://github.com/langgenius/dify-official-plugins/pull/1203
New feature:
Deletion:
Refactor:
https://github.com/langgenius/dify-official-plugins/pull/914
New feature:
Deletion:
https://github.com/langgenius/dify-official-plugins/pull/9
New feature: