The recipes, part one: img2img, inpainting, outpainting, upscaling
Chapter 73
2 min read
Reviewed v78 · August 2026
The recipes, part one: img2img, inpainting, outpainting, upscaling
Most real work is the default graph with a nodeNodeA single block in a visual pipeline like ComfyUI that does one operation and wires to others to form a workflow. or two swapped in. Image-to-image is the smallest change: instead of an empty latent, you load a reference imageReference imageAn image fed to a model as conditioning to carry a subject, style, or composition into new output, rather than describing it in words. and run it through a VAEVAE (Variational Autoencoder)A neural network that learns to compress images into a small numerical representation (a latent) and decompress them back. Used in latent diffusion models to make the generation process tractable. Encode node to turn those pixels into a latent, then feed that to the KSamplerKSamplerThe ComfyUI node where denoising actually happens, taking the model, prompts, and a latent and running the sampling loop under its seed, steps, CFG, sampler, and scheduler settings.. The single control that matters is denoise. Near one, the reference is almost ignored; around one half the model keeps the composition but repaints the detail; low, and it barely touches the image. Everything else is that one dial.
Fig.diagram
■The VAE compresses pixels into a small latent so the expensive work in compressed space stays affordable, then expands the finished latent back into pixels.
InpaintingInpaintingEditing a specific masked region of an image while preserving the rest. The classic AI editing approach. swaps in a VAE Encode (for Inpainting) node, which takes the image, the VAE, and a mask marking what to change, plus a grow_mask_by value that feathers the boundary so the repaint blends instead of leaving a seam. You paint the mask right on the image by right-clicking the Load Image node and opening the MaskEditor. OutpaintingOutpaintingExtending an image beyond its original borders by generating new content that fits with the existing edges. is the same inpaint workflow with the mask made differently: a Pad Image for Outpainting node adds blank canvas on whatever sides you specify, with a feathering control, and hands the samplerSamplerThe algorithm used to perform the denoising steps. Different samplers (Euler, DPM++, etc.) have different speed-quality trade-offs. a mask covering the new empty space.
UpscalingUpscalingIncreasing an image or video's resolution after generation, often with a model that invents plausible fine detail rather than simply stretching pixels. comes in two flavors people constantly confuse. A model upscalerUpscalerA model or tool that raises the resolution of an image or video, either faithfully recovering detail or inventing plausible new detail. (a Load Upscale Model node plus an Upscale Image node, driving an ESRGAN-family model like RealESRGAN) enlarges the finished pixels. A latent upscale enlarges the image while it is still latent and runs a second sampling pass over it, which is the classic hi-res fixHi-res fixA two-stage technique that generates a small image, upscales the latent, then runs a second sampling pass at low denoise to invent fine detail at the larger size.: generate small, upscale the latent, sample again at low denoise to invent detail. Chaining upscalers, two times then four times, is common. Which you reach for depends on whether you want faithful enlargement, which is the model upscaler, or a second creative pass that adds detail, which is the latent route.
Check your understanding
pass: 5 of 7
Answer at least 5 of 7 correctly to unlock the next chapter.
1. In image-to-image, what turns the reference picture into something the sampler can use?
2. What does a denoise value near one do in image-to-image?
3. What is the purpose of the grow_mask_by value in inpainting?
4. How is outpainting related to inpainting in ComfyUI?
5. What is the difference between a model upscaler and a latent upscale?
6. Why would you reach for a latent upscale rather than a model upscaler?
7. How do you paint an inpainting mask onto an image in ComfyUI?
The weekly briefing
Get the week's moves in your inbox.
A short, sourced digest of what actually moved across generative AI, every week. Free.
Free. One email a week, no spam, unsubscribe anytime. Prefer a reader? RSS.