Phase 6: ComfyUI — Workflow Engine · 50 min · Python · ComfyUI
Parameter Patching
Load a template, swap the prompt, change the seed, inject a LoRA — all without opening the UI. That's parameter patching.
Real-world application: Parameter patching (programmatically swapping prompts, seeds, guidance, LoRAs in workflow JSON) is the key skill that turns ComfyUI from a visual tool into production infrastructure.
What you will learn
- Load workflow templates: reading API-format JSON as a base template
- Patch prompt text: replacing CLIP Text Encode node inputs
- Patch seeds and guidance scale: changing KSampler parameters
- Inject LoRAs: dynamically adding LoRA Loader nodes and connecting to model/clip
Objective
Turn an exploratory graph into a reproducible, parameterized, inspectable production workflow. In the paired studio lab, build a parameter patching tool that takes a workflow template and a list of parameter overrides (prompts, seeds, guidance scales, LoRA names), generates patched workflows for each set, and submits them all to ComfyUI for batch generation. Collect and save all outputs.
The Problem
A team has a ComfyUI workflow that generates product images. They need to:
- Generate 100 products with different prompts (same workflow, different text)
- Test different seeds for each product (A/B testing)
- Apply different LoRAs for different product categories
- Change resolution for social media variants
They don't want to manually edit the workflow in the UI 100 times. They need to programmatically patch the workflow JSON — swap prompts, change seeds, inject LoRAs — and execute via API.
Parameter patching is the key skill that turns ComfyUI from a visual tool into production infrastructure.
What you'll build
Load workflow templates as base JSON. Patch prompt text (CLIP Text Encode inputs), seeds and guidance (KSampler parameters), and inject LoRA Loader nodes dynamically. Execute patched workflows via API.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers The Concept, Build, Check Yourself, Key Terms & Next — plus a hands-on lab, quiz, and project artifact.
Create a free account — the opening phases of 29 of 35 courses are free, no credit card.
Browse all courses · View pricing · DeVenture Academy