ComfyUI lesson 4: Build text-to-image from a blank canvas
Wire the seven-node mental model from checkpoint to saved pixels.
Listen to this article
On-device voiceUses the voice built into your browser; no article text leaves this page.
Audio narration is not supported by this browser.
Templates are useful after you understand their skeleton. Open a blank ComfyUI canvas and build the Proteus graph without importing it; use the downloadable JSON only to compare your result.
The seven-node mental model
- Load Checkpoint returns MODEL, CLIP, and VAE.
- Two CLIP Text Encode nodes create positive and negative conditioning.
- Empty Latent Image sets width, height, and batch size.
- KSampler combines model, conditioning, latent, seed, steps, CFG, sampler,
scheduler, and denoise.
- VAE Decode turns sampled latents into pixels.
- Save Image writes the output and embeds workflow metadata where supported.
Connect sockets by type, not by visual proximity. MODEL goes to the sampler. CLIP goes to both text encoders. Their CONDITIONING outputs go to positive and negative. LATENT enters the sampler and leaves it. The checkpoint's VAE decodes the sampled latent, and IMAGE goes to Save.
Make useful inputs visible
The runnable gallery version maps prompt, negative prompt, seed, steps, CFG, width, and height as API inputs. That is the difference between a graph that works once and a workflow that can become a product endpoint.
Use multiples of 64 for dimensions and stay near the model's training resolution. Doubling both width and height quadruples latent area and sharply increases memory. Start at 1024×1024, batch size one.
When your hand-built graph matches the downloaded graph, save both normal workflow JSON and Save (API Format). The former preserves editor layout; the latter is the graph a queue or deployment endpoint executes.
Run the lesson, do not just read it
- Open the tested workflow in Comfy Studio
- Download the exact API-format JSON
- CLI:
app comfy download proteus-v04-text-to-image
The gallery records model sources, minimum VRAM, custom-node requirements, and verification state beside the graph. That is the portable unit for this series.
Series progress: lesson 4 of 10. Previous: Prompt with intent, not incantations Next: Build image-to-image and master denoise