Skip to main content

What is a workflow?

A workflow is a set of steps that tells ComfyUI how to create something. You can think of a workflow like a recipe:
  • The recipe is the workflow.
  • Each instruction in the recipe is a node.
  • The ingredients include prompts, images, and models.
  • The result is the generated image, video, audio, or other output.
For example, a simple image workflow might:
  1. Load a model.
  2. Read a text prompt.
  3. Generate an image.
  4. Save the image.
ComfyUI displays these steps as boxes on a canvas. A simple ComfyUI workflow

Nodes are the steps

A node performs one specific job. Some nodes load files, some change data, and others generate or save the result. For example:
  • A Load Checkpoint node loads an AI model.
  • A CLIP Text Encode node turns your prompt into instructions for the model.
  • A KSampler node generates an image from the model and those instructions.
  • A Save Image node saves the result to your computer.
You can combine nodes in different ways to create different workflows. You do not need to write code to use them. Learn more about nodes in Nodes. Nodes work together by passing data from one node to another. A link connects an output from one node to an input on another node. For example, a model loaded by a Load Checkpoint node can be passed to a KSampler node. Text instructions created by a text-encoding node can also be passed to the sampler. Only compatible data types can be connected. For example, an image output cannot be connected directly to an input that expects a number. Learn more about links in Links.

Properties control each step

Nodes contain properties. Properties are the settings that control how a node works. For example, a sampler node may have properties for:
  • The number of steps
  • The guidance scale
  • The sampling method
  • The image size
You can usually set a property directly on the node. Some properties can also receive their values from another node. Learn more about properties in Properties.

Running a workflow

When you run a workflow, ComfyUI executes the required nodes and passes data through the links. The workflow continues until it produces its final output. If a node is missing, has an error, or does not receive the data it needs, ComfyUI cannot complete the workflow. The node is marked so you can find and fix the problem.

Starting with a template

To get started, open a built-in workflow template from WorkflowBrowse Workflow Templates. Templates provide complete examples that you can run and edit. Templates use Core nodes included with ComfyUI. They also prompt you to download any required models. The community has created many custom nodes that add more capabilities. Learn more in Custom Nodes.

Saving and sharing workflows

You can save a workflow as a JSON file and share it independently of the generated media. When you save an output with a built-in save node, ComfyUI can also store the workflow inside the output file. You can then drag the file back onto the canvas to recover the workflow. For details about the embedded data, supported file formats, and programmatic access, see Workflow Metadata.

A little background

Technically, a workflow is a node graph. The nodes are the points in the graph, and the links show how data moves between them. This is also called visual programming because you create a program by arranging and connecting visual blocks instead of writing code.