ComfyUI models a diffusion pipeline as a directed graph of typed nodes
ComfyUI represents every diffusion workflow as a node graph: each node performs one operation (load model, encode text, sample latent, decode VAE) and exposes typed input and output slots. Wires connect output slots to input slots, enforcing data type contracts (MODEL, CONDITIONING, LATENT, IMAGE). The engine traverses only the subgraph reachable from an output node, so unused branches are never executed. This visual-programming model lets non-programmers build complex pipelines — inpainting, multi-pass upscale, ControlNet — without writing code. The misconception is that the graph is sequential; it is actually a DAG and nodes may share inputs from a common upstream.
Examples
A minimal txt2img graph: CheckpointLoader → (MODEL, CLIP, VAE); CLIPTextEncode(positive) ← CLIP; CLIPTextEncode(negative) ← CLIP; EmptyLatentImage; KSampler ← MODEL, CONDITIONING×2, LATENT; VAEDecode ← LATENT, VAE; SaveImage.
Assessment
Draw the minimal node graph for txt2img generation and label the type of every wire. Then explain what happens when you change only the positive prompt and re-queue — which nodes re-execute?