Pro12 min

ComfyUI: Building a Production Pipeline

ComfyUI is the node graph that serious image people use when they need full control. Instead of a prompt box, you wire together loaders, samplers, and post steps into a graph you can save, reuse, and version. This lesson builds a clean text to image graph and explains every node.

Step 1: Install and load a base graph

Install ComfyUI locally if you have an NVIDIA GPU, or run it on a hosted GPU through RunPod or a managed ComfyUI host. On first launch it loads a default text to image graph you can study.

zsh — ComfyUI
$git clone https://github.com/comfyanonymous/ComfyUI
$pip install -r ComfyUI/requirements.txt
$python ComfyUI/main.py
Starting server on http://127.0.0.1:8188
$

Step 2: Understand the core nodes

A minimal Flux graph chains a handful of nodes. The checkpoint loader brings in the model. Two text encode nodes hold your positive and negative prompts. An empty latent sets the size. The sampler does the work. A VAE decode turns the latent into pixels, and a save node writes the file.

NodeJob
Load CheckpointLoads the Flux model weights
CLIP Text EncodeTurns your prompt into a conditioning
Empty Latent ImageSets output width and height
KSamplerRuns the denoising steps
VAE DecodeConverts the latent to an image
Save ImageWrites the file to disk
ComfyUI — text to image graph
[Load Checkpoint] --> [KSampler] --> [VAE Decode] --> [Save Image]
[CLIP Encode +] --^
[CLIP Encode -] --^
[Empty Latent] --^ (width 1024 x height 1024)
Nodes flow left to right: model and prompts feed the sampler, which feeds the decoder, which feeds save.

Step 3: Save the workflow as a reusable asset

The power of ComfyUI is that a graph is a file. Export it as JSON, drop it in a repo, and anyone can load the exact pipeline. Add nodes for upscaling and face fixing once, save it, and every future image runs through the same proven steps.

Treat custom nodes like dependencies
Community custom nodes are powerful but can break on updates or carry risk. Install only from sources you trust, and pin versions so a production graph keeps working.

Result

You have a saved, repeatable ComfyUI graph that turns a prompt into a finished, upscaled image with the same quality every time, and a file you can share or version.

Hands-on tasks