Learn ComfyUI Foundations: From Zero to First Image Understanding Nodes: Inputs, Outputs, and Types

Understanding Nodes: Inputs, Outputs, and Types

Beginner 🕐 12 min Lesson 5 of 13
What you'll learn
  • Identify the input and output slots on any node and describe what each colored slot type represents
  • Explain why ComfyUI enforces data type matching on connections and what happens when types do not match
  • Add a new node to the canvas and make a valid connection between two nodes

Nodes Are the Vocabulary of ComfyUI

Every operation in ComfyUI is a node. A node is a self-contained processing unit: it takes inputs, does something with them, and produces outputs. The outputs of one node plug into the inputs of another, forming a chain. The entire power of ComfyUI comes from this simple concept — nodes in, connections between, outputs out.

Understanding how nodes work at the technical level makes everything else in ComfyUI easier. When you know what the colored ports mean and why certain connections are allowed while others are not, you can diagnose broken workflows in seconds and understand any new node you encounter immediately.

The Anatomy of a Node

Look at the KSampler node in the default workflow. On its left side are five input slots — colored circles or squares with labels: model, positive, negative, latent_image, and a few others. On its right side is one output slot: LATENT.

The left side always contains inputs — things the node receives from earlier in the pipeline. The right side always contains outputs — things the node produces and passes to later nodes. Wires connect an output on the right side of one node to an input on the left side of another.

Each input slot also has a direct widget — a text field, dropdown, or number input — that appears when the input is not connected to a wire. The seed field on the KSampler is a widget: type a number directly. When you connect a wire to an input that had a widget, the widget disappears and the wire value takes over. Disconnect the wire and the widget reappears.

Data Types: What the Colors Mean

Every input and output slot has a data type, shown by its color. ComfyUI enforces type matching — you can only connect an output to an input of the same type. The six core types you will encounter in almost every workflow:

  • MODEL (purple): The diffusion model weights. Output by Load Checkpoint, consumed by KSampler. Only one MODEL flows through a pipeline at a time.
  • CLIP (yellow): The text encoder. Output by Load Checkpoint, consumed by CLIP Text Encode nodes. In FLUX.1 workflows, there are two CLIP outputs — one for the T5-XXL encoder and one for the CLIP-L encoder.
  • VAE (teal/cyan): The variational autoencoder. Output by Load Checkpoint, consumed by VAE Decode and VAE Encode nodes.
  • LATENT (magenta/pink): Compressed image data in latent space. Output by Empty Latent Image (blank noise) and by KSampler (denoised latent), consumed by VAE Decode and by KSampler (as starting noise).
  • IMAGE (red/orange): Decoded pixel images. Output by VAE Decode and Load Image nodes, consumed by Save Image, preview nodes, and any node that works with pixel data like ControlNet preprocessors.
  • CONDITIONING (orange): The encoded representation of your prompt. Output by CLIP Text Encode nodes, consumed by KSampler's positive and negative inputs.

Other types exist — MASK, FLOAT, INT, STRING, SIGMAS — and you will encounter them as you add more custom nodes. The pattern is always the same: color identifies type, and type determines which outputs can connect to which inputs.

Type Mismatch Errors: What They Look Like

If you try to connect an output of one type to an input of a different type, ComfyUI prevents the connection. The wire snaps back, and nothing is connected. This is intentional — it prevents broken pipelines from running and producing meaningless output or crashing.

A common mistake for new users: trying to connect the IMAGE output of VAE Decode directly to the KSampler's latent_image input. These are different types (IMAGE is decoded pixel data; latent_image expects a LATENT). To use an existing image as a starting point, you need a VAE Encode node in between, which converts IMAGE back to LATENT. This is what the image-to-image workflow does.

When you open a workflow that uses custom nodes you haven't installed, those nodes appear as red boxes with a warning. They are not type mismatch errors — they are missing node errors, covered in Lesson 13.

Adding a Node to the Canvas

There are two ways to add a new node:

  • Right-click on empty canvas space: Select Add Node. Navigate the category menu, or use the search box at the top of the menu.
  • Double-click on empty canvas space: This opens a search box directly. Start typing the node name and select from the results.

Try adding a Preview Image node: right-click the canvas, select Add Node → image → Preview Image. This node is identical to Save Image except it does not write the file to disk — it only shows a preview in the interface. Connect the IMAGE output of the VAE Decode node to the input of Preview Image by clicking the output dot on the right of VAE Decode and dragging to the input dot on the left of Preview Image.

You will use this pattern — right-click to add, drag to connect — constantly as you build more complex workflows. At this point you understand the core mechanics of how ComfyUI works. The next two lessons go deeper into the specific node types: models in Lesson 6, and the VAE/CLIP/conditioning system in Lesson 7.

Key takeaways
  • Every node has inputs on the left and outputs on the right — inputs receive data from earlier nodes via wires, and outputs pass data to later nodes; this direction is always the same.
  • Each slot has a data type shown by color — MODEL (purple), CLIP (yellow), VAE (teal), LATENT (magenta), IMAGE (red), CONDITIONING (orange) — and ComfyUI only allows connections between matching types.
  • If an input has no wire connected, it shows a widget (text field, dropdown, number) for direct input — connecting a wire overrides the widget and disconnecting it restores the widget.
  • A type mismatch prevents the connection from forming entirely — the wire snaps back — which is a safety feature that stops broken pipelines from running silently with wrong data.
  • Double-clicking on empty canvas space opens a node search box — the fastest way to find and add a specific node without navigating the full right-click category menu.