Advanced
ComfyUI Advanced: Training, Kontext, and Automation
Take your ComfyUI skills from intermediate to production-ready. This advanced track covers the techniques most tutorials skip: editing images with FLUX Kontext, tiling to 4K with Ultimate SD Upscale, regional prompting for multi-subject scenes, training custom LoRAs on rented cloud GPUs, and automating ComfyUI workflows with its HTTP API. Prerequisites: ComfyUI Foundations and ComfyUI Image Generation.
01
FLUX Kontext: Instruction-Based Image Editing
FLUX Kontext changes how image editing works in ComfyUI. Instead of describing the final image you want, you describe the change to make, and the model applies exactly that while leaving the rest intact. This lesson covers model setup, the workflow structure, and the prompting principles that produce accurate, targeted edits.
›
02
FLUX Kontext: Character Consistency Across Scenes
Generating the same character reliably across different scenes is one of the hardest problems in AI image production. FLUX Kontext solves it by using your reference image as an anchor — keeping the character's appearance intact while changing everything around them. This lesson covers the local dev approach, the multi-image Pro workflow, and combining Kontext with LoRA for maximum identity lock.
›
03
FLUX Fill and FLUX Depth: Advanced Inpainting Control
The standard ComfyUI inpainting workflow re-generates masked regions using the base model. FLUX Fill is a dedicated inpainting model that understands context — it fills masked regions based on what surrounds them, not just on your prompt. This lesson covers FLUX Fill setup, mask creation, outpainting, automatic segmentation with BiRefNet, and structure-preserving editing with FLUX Depth and FLUX C
›
04
Ultimate SD Upscale: Tiled High-Resolution Output
The detail pass in ComfyUI Image Generation runs the whole upscaled image through one KSampler pass. Ultimate SD Upscale goes further — it splits the image into tiles, runs the full diffusion pipeline on each tile separately, then stitches them back together with a seam-fix pass. The result: genuine AI-generated detail across every part of a 4K or 8K image that a single-pass approach cannot match.
›
05
Regional Prompting: Different Subjects, Different Prompts
A single prompt applies to the whole image — which makes multi-subject scenes difficult. Regional prompting lets you assign different prompts to different parts of the canvas: a cat on the left, a dog on the right, a garden background behind both. This lesson covers the three ComfyUI approaches to regional prompting, their trade-offs, and the limitations you need to know before building complex sc
›
06
LoRA Training, Part 1: Building Your Dataset
Training a LoRA requires three things before you open any training software: the right hardware, a well-prepared set of images, and accurate captions with a unique trigger word. This lesson covers how to rent a GPU on Vast.ai if you need one, what makes a good character or style dataset, and how to caption images for reliable, controlled training results.
›
07
LoRA Training, Part 2: Training Inside Kohya
Your dataset is prepared and your GPU is ready. This lesson walks through the Kohya training interface for FLUX LoRA — where to point it at your dataset, which parameters to set and why, how to read the loss log to know if training is going well, and how to save and download the finished LoRA file.
›
08
LoRA Training, Part 3: Testing and Fixing Your LoRA
A trained LoRA is not finished until it has been tested against prompts it was not trained on. This lesson covers how to evaluate your LoRA in ComfyUI, what the five common failure modes look like, which ones can be fixed by adjusting strength or prompts, and which ones require retraining. It also covers combining your LoRA with Kontext and IPAdapter for stronger character control.
›
09
The ComfyUI API: Automating Image Generation
ComfyUI runs an HTTP server the moment it starts, waiting for workflow submissions at port 8188. This lesson covers how to export a workflow in API format, submit it with Python, wait for completion using the WebSocket channel, and download the resulting images — giving you a complete automation foundation you can build any pipeline on top of.
›
10
Building a Production Pipeline with the ComfyUI API
The raw ComfyUI API works fine for personal automation but has no authentication, no error handling, and no retry logic. This lesson builds a FastAPI wrapper that adds all three, deploys ComfyUI headlessly on Vast.ai, and connects the pipeline to n8n — giving you a production-ready image generation endpoint you can call from any tool.
›
11
VRAM and Performance Optimization
As you combine larger models, ControlNets, LoRAs, and high-resolution upscaling, VRAM runs short. This lesson covers the full toolkit: FP8 and GGUF quantization, model offloading, batch size tuning, VAE tiling, and the flags that change how ComfyUI loads and caches models — giving you practical control over the speed/VRAM tradeoff on any GPU.
›
12
Capstone: Advanced Workflow from Concept to Output
Everything in this track comes together in one production workflow: a trained character LoRA for consistent identity, FLUX Kontext for scene editing, FLUX Fill for seamless object replacement, and Ultimate SD Upscale for final delivery at print resolution — all combined, tested, and exported as a reusable template you can run from the ComfyUI API.
›
Enjoying this track?
Get weekly AI learning picks — prompts, tools, and tutorials every Monday.