Advanced ComfyUI work comes down to a handful of techniques: ControlNet to copy pose, edges or depth; area and mask conditioning to prompt parts of the frame separately; reference-image models where IP-Adapter used to be the default; inpainting to repaint one region; four kinds of upscaling; few-step models for drafts; subgraphs to tame big graphs; and the /prompt API for batches. Add them one at a time to an official template and compare each change at a fixed seed.
Advanced ComfyUI techniques are the nodes you add to a working graph to control what the model does: pose, regions, references, repairs, resolution, speed and volume. Each one solves one problem. Add them one at a time to an official template, compare at a fixed seed, and keep only what earns its place.
Checked on 14 October 2026 against Comfy's documentation and examples, the source of the nodes named here and each model's card, with ComfyUI v0.39.0 the latest release. We ran no speed tests, so the only timings here are Comfy's own. New to ComfyUI? Start with what ComfyUI is and how hard it is to learn.
Which technique solves which problem?
Start from the problem, not the technique. If none of these rows describes what is wrong with your output, the fix is usually in the prompt, the model or the seed.
| Problem | Technique | Key nodes |
|---|---|---|
| Match a pose, outline or depth from a reference | ControlNet | Load ControlNet Model, Apply ControlNet |
| Different prompts for different parts of the frame | Area or mask conditioning | Conditioning (Set Area), (Set Mask), (Combine) |
| Keep a face, product or style from a reference | Reference-image models, or IP-Adapter on older models | The model's official template |
| Repaint one region | Inpainting | Mask Editor, VAE Encode (for Inpainting) |
| Bigger, sharper output | Upscale model, two-pass, tiled refinement or SeedVR2 | Upscale Image (using Model), Ultimate SD Upscale |
| Faster drafts | Few-step models and LoRAs | The model's own sampler settings |
| A graph too big to manage | Subgraphs, blueprints, partial execution | Selection toolbox |
| Many variations or scheduled jobs | Seeds, list outputs and the HTTP API | KSampler seed control, /prompt |
| A step no node covers | A custom node | INPUT_TYPES or the V3 schema |
ControlNet: copy structure from a reference
ControlNet adds a condition image, such as an edge map, a depth map or pose keypoints, to guide generation. Start from the downloadable workflow in the official ControlNet tutorial with its own checkpoint, control model and input image, and only then swap in yours.
- 01Encode the prompts
Positive and negative conditioning, as in any graph.
- 02Load a matching ControlNet
It must belong to the same model family as the checkpoint.
- 03Preprocess the reference
Canny edges, depth, scribble or an OpenPose skeleton.
- 04Apply ControlNet
Takes both conditionings, the ControlNet and the image; returns new conditioning.
- 05KSampler, then VAE Decode
With the model and a latent, then the matching VAE.
Apply ControlNet takes the positive and negative conditioning, the ControlNet, the preprocessed image and optionally a VAE, and returns new positive and negative conditioning. Core ComfyUI does not include every preprocessor, so Comfy's docs point to comfyui_controlnet_aux for the rest. Three settings matter:
- strength: how much the ControlNet influences the result. Higher values raise its influence; they do not promise an exact pose or identity.
- start_percent and end_percent: when guidance begins and ends. In Comfy's example, 0.2 starts it a fifth of the way through sampling and 0.8 stops it four fifths of the way through.
- denoise, on the KSampler: the KSampler reference describes it as how much of the initial latent is changed: 1.0 for text-to-image, lower to keep more of an encoded input image. It is a separate control from ControlNet strength.
To stack ControlNets, chain Apply ControlNet nodes, passing each node's conditioning to the next. For different regions, Comfy's mixing guide suggests similar strengths, for example 1.0 each, so one region does not drown the other. Union ControlNets bundle several control types into one model. Older shared workflows may show Apply ControlNet (Old), which Comfy has deprecated. Our ControlNet guide covers the control types in depth.
Regional prompting with area and mask conditioning
One prompt applies to the whole frame, so attributes bleed between subjects. Regional prompting gives each part of the frame its own conditioning, with three core nodes.
- Conditioning (Set Area) applies a prompt to a rectangle given in pixels, with a strength. Set Area with Percentage takes the same values as fractions of the image.
- Conditioning (Set Mask) applies a prompt to a painted mask.
- Conditioning (Combine) merges the regional prompts and the whole-frame prompt into one conditioning for the sampler.
ComfyUI's area composition example adds two cautions. Stable Diffusion is most consistent near its training resolution, so a subject in its own square area helps in a wide image. And a second pass without the area prompts can blend attributes such as hair colour between subjects. For one fix in an existing picture, an instruction-editing model that changes only what you name is often simpler.
Reference images: IP-Adapter and what replaced it
Native reference support in newer models has largely replaced IP-Adapter. The main IP-Adapter pack, ComfyUI_IPAdapter_plus, was set to maintenance-only mode on 14 April 2025, so treat it as the legacy option for SD1.5 and SDXL. If you still use it, its README lists ip-adapter-plus-face_sdxl_vit-h.safetensors as the SDXL face model, in ComfyUI/models/ipadapter.
| Model | Reference support | Model licence |
|---|---|---|
| Qwen-Image-Edit-2511 | Instruction editing with reference images | Apache 2.0 |
| FLUX.2 [klein] 4B | Single and multi-reference editing; Comfy lists 8.4 GB of VRAM for the distilled model | Apache 2.0 |
| FLUX.2 [dev] | Up to 10 reference images | FLUX [dev] Non-Commercial License |
| Qwen-Image 2.1 | The text encoder node takes up to 16 image slots; image_1 is the image being edited | Qwen Research License |
| SD1.5 or SDXL with IP-Adapter | Face, style or object transfer through ComfyUI_IPAdapter_plus | The checkpoint's own licence. The pack is maintenance-only |
Sources: Comfy's guides for Qwen-Image-Edit-2511, FLUX.2 [klein], FLUX.2 [dev] and Qwen-Image 2.1, and the Qwen-Image 2.1 model card. Black Forest Labs' non-commercial licence limits the model itself to non-commercial use unless you buy a licence. Give each reference image one job and name it by its slot in the prompt. For a recurring character, a trained character LoRA is still the most direct route, and the consistent character workflow puts the pieces together.
Inpainting: repaint one region
When most of an image works, repaint only the broken part. Draw a mask in the Mask Editor, encode with VAE Encode (for Inpainting), whose grow_mask_by setting widens the mask so the edit blends in, and sample. Comfy's inpainting tutorial shows that a model trained for inpainting blends better than a general checkpoint. The denoise logic is the same as image-to-image, which our img2img guide explains.
Upscaling: four methods that behave differently
Pick conservative or creative first. Comfy's upscaling guide separates upscalers that preserve the original from those that add detail and can invent it, and warns against relying on upscaling to fix artifacts such as extra fingers.
| Method | How it works | Use it for |
|---|---|---|
| Upscale model (ESRGAN family) | A trained upscaler enlarges the image. Comfy suggests RealESRGAN for general use, BSRGAN for text, SwinIR for natural textures | Fast enlargement with no diffusion pass |
| Two-pass (hires fix) | Generate small, upscale, then sample again at a lower denoise | Adding detail at a higher resolution |
| Tiled refinement (Ultimate SD Upscale) | Upscales, then runs image-to-image tile by tile | Large outputs on modest hardware |
| SeedVR2 | One-step diffusion restoration, native in ComfyUI, 3B and 7B sizes | Faithful image and video upscales |
Sources: the two-pass example, the Ultimate SD Upscale README and the SeedVR2 guide. SeedVR2 is listed under Apache 2.0, and Comfy's tip is to scale an image down to 0.35 megapixels with ImageScaleToTotalPixels before upscaling it with SeedVR2.
Ultimate SD Upscale inputs (INPUT_TYPES)
Ultimate SD Upscale is a GPL-3.0 custom node pack. The main node's inputs, from its source file:
- Sampling:
image,model,positive,negative,vae,seed,steps(default 20),cfg(8.0),sampler_name,scheduleranddenoise(0.2). - Upscale:
upscale_model,upscale_by(default 2),mode_type(Linear, Chess or None),tile_widthandtile_height(512),mask_blur(8) andtile_padding(32). - Seam fix:
seam_fix_mode,seam_fix_denoise(1.0),seam_fix_width(64),seam_fix_mask_blur(8) andseam_fix_padding(16). - Other:
force_uniform_tiles(on),tiled_decode(off) andbatch_size(1; above 1 needsforce_uniform_tiles).
A running server lists any installed node's inputs at /object_info/{node_class}, for example /object_info/UltimateSDUpscale (server routes), which is the quickest check after a pack updates.
Faster generation: few-step models and LoRAs
Distilled models and step-reduction LoRAs cut sampling to a handful of steps, and each needs its own sampler settings. Start from its official example rather than lowering the steps of a normal workflow.
| Option | Documented settings | Source |
|---|---|---|
| SDXL Turbo | Can generate in a single step; ComfyUI uses the SDTurboScheduler node | ComfyUI Turbo example |
| LCM LoRA | 4 to 8 steps, guidance 1.0 to 2.0; in ComfyUI the lcm sampler with sgm_uniform or simple | Diffusers LCM guide, ComfyUI LCM example |
| Z-Image-Turbo | 8 function evaluations; fits 16 GB consumer GPUs, per Comfy | Z-Image-Turbo guide |
| FLUX.2 [klein] 4B distilled | 4 steps; about 1.2 seconds on an RTX 5090 with 8.4 GB of VRAM, per Comfy | Klein guide |
| Lightning and LightX2V LoRAs | 4-step LoRAs for Qwen-Image-Edit-2511 and Wan 14B video | Qwen-Image-Edit-2511 guide |
Links: the ComfyUI SDXL Turbo example, the ComfyUI LCM example and Diffusers LCM guide, and Comfy's Z-Image-Turbo and Klein guides. Stability lists SDXL Turbo under its Community License.
- Use one acceleration method at a time: SDXL Turbo and an LCM LoRA are separate approaches
- At cfg 1 ComfyUI skips the negative conditioning pass, so a negative prompt does nothing
- Few-step models want their own sampler and scheduler, not your usual ones
- Check the licence: a fast model is not always a commercial one
- Compare drafts and finals at the same seed before deciding the speed was worth it
The cfg note is from Comfy's Qwen-Image 2.1 guide.
Measure the whole workflow, not just the sampler
We have not benchmarked these options, and speed figures rarely carry from one machine to another. To measure your own, record the GPU, precision, resolution, sampler and steps; separate the first model load from warm runs; keep prompts and seeds fixed; count retries, upscaling and review time; and change one setting at a time.
Subgraphs, blueprints and partial execution
A big graph gets manageable when you fold it, reuse it and run only the part you are changing.
- 1.24.3Subgraphs
Select nodes and click the subgraph icon to pack them into one node with exposed inputs and outputs.
- 1.27.7Subgraph blueprints
Publish a subgraph to the node library and reuse it across workflows.
- 1.41.13App Mode
Put chosen inputs and outputs on a simple form. Share links work on Comfy Cloud only.
Source: Comfy's subgraph and App Mode docs, 14 October 2026.
Partial execution lets you select an output node and run only the branch that feeds it. Sources: the subgraph guide, partial execution and App Mode.
Batch generation and the API
Inside the app, three controls make variations: batch_size on the latent node renders several images in one pass at the cost of VRAM; the KSampler's seed widget can change the seed after each run; and when a node outputs a list, ComfyUI runs the downstream nodes once per item (data lists). For anything bigger, drive it from a script.
- 1Export the API format
File, then Export Workflow (API). Nodes are keyed by ID and layout is dropped.
- 2POST it to /prompt
The server returns a prompt_id, or node_errors if validation fails.
- 3Wait for the result
Poll /history/{prompt_id} or listen on the /ws WebSocket.
- 4Fetch the files
Download outputs from /view.
A minimal loop using Python's standard library, adapted from ComfyUI's basic_api_example.py (API format docs). Node IDs 3 (KSampler) and 6 (positive prompt) come from that example, so check the IDs in your own export:
import json, time, urllib.request
SERVER = "http://127.0.0.1:8188"
workflow = json.load(open("workflow_api.json")) # File > Export Workflow (API)
def post(path, data):
req = urllib.request.Request(SERVER + path, data=json.dumps(data).encode("utf-8"),
headers={"Content-Type": "application/json"})
return json.loads(urllib.request.urlopen(req).read())
prompts = ["portrait in a sunlit cafe", "portrait on a rainy street at night"]
for i, text in enumerate(prompts):
workflow["6"]["inputs"]["text"] = text
workflow["3"]["inputs"]["seed"] = 1000 + i
prompt_id = post("/prompt", {"prompt": workflow})["prompt_id"]
while True: # history appears once the run has finished
history = json.loads(urllib.request.urlopen(f"{SERVER}/history/{prompt_id}").read())
if prompt_id in history:
break
time.sleep(1)
print(text, "->", list(history[prompt_id]["outputs"]))Sources: the security policy and the Comfy API v2 overview.
Custom nodes: when to write your own
Only when built-in nodes, a subgraph or an existing Registry pack cannot handle a step you repeat. A node is a Python class: INPUT_TYPES declares its inputs, RETURN_TYPES its outputs, FUNCTION the method ComfyUI calls, and NODE_CLASS_MAPPINGS registers it (node properties). That schema is still supported, and new nodes can use the V3 schema.
This example turns a character trigger and a theme into a list of prompt variations. It only writes text; it does not render images or check identity. OUTPUT_IS_LIST makes ComfyUI run the text encoder and sampler once per prompt, and the seed input keeps runs reproducible, because ComfyUI reruns a node only when its inputs change.
# ComfyUI/custom_nodes/batch_scenarios/__init__.py
import random
SCENES = {
"Fashion": {
"actions": ["walking toward the camera", "adjusting a jacket sleeve", "sitting at a cafe table"],
"places": ["boutique", "rooftop at dusk", "city street"],
"outfits": ["tailored blazer", "linen summer dress", "streetwear set"],
"light": ["golden hour light", "overcast daylight", "neon night light"],
},
"Fitness": {
"actions": ["tying running shoes", "stretching after a run", "lifting a kettlebell"],
"places": ["outdoor track", "home gym", "park path"],
"outfits": ["running jacket and leggings", "tank top and shorts", "matching training set"],
"light": ["early morning light", "bright midday sun", "soft window light"],
},
}
class BatchScenarioGenerator:
"""Builds prompt variations. OUTPUT_IS_LIST makes ComfyUI run the
downstream nodes once per prompt; the seed makes each run reproducible."""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"character": ("STRING", {"default": "ava_character, photo of a woman"}),
"theme": (list(SCENES.keys()),),
"count": ("INT", {"default": 8, "min": 1, "max": 64}),
"seed": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFFFF, "control_after_generate": True}),
}
}
RETURN_TYPES = ("STRING", "INT")
RETURN_NAMES = ("prompts", "count")
OUTPUT_IS_LIST = (True, False)
FUNCTION = "build"
CATEGORY = "examples/prompts"
def build(self, character, theme, count, seed):
rng = random.Random(seed)
scene = SCENES[theme]
prompts = [
f"{character}, {rng.choice(scene['actions'])}, {rng.choice(scene['places'])}, "
f"wearing a {rng.choice(scene['outfits'])}, {rng.choice(scene['light'])}"
for _ in range(count)
]
return (prompts, count)
NODE_CLASS_MAPPINGS = {"BatchScenarioGenerator": BatchScenarioGenerator}
NODE_DISPLAY_NAME_MAPPINGS = {"BatchScenarioGenerator": "Batch Scenario Generator"}Restart ComfyUI, find the node under examples/prompts, and connect prompts to the text input of a CLIP Text Encode node. Replace ava_character with your LoRA's trigger word; the word alone does not load a LoRA. Custom nodes run as ordinary Python with your permissions, so install other people's from the Comfy Registry through the ComfyUI Manager, and read the workflow library guide before loading a stranger's graph.
These techniques are the toolkit; a consistent persona is one thing to build with them. The AI Influencers program takes that route, with lessons on LoRA training, ControlNet for pose and image-to-video. Model choices for each technique are in the best ComfyUI models guide.
Advanced ComfyUI techniques: FAQ
What is the difference between ControlNet strength and denoise?
ControlNet strength sets how much the control image steers the conditioning. Denoise, on the KSampler, sets how much of the initial latent is changed: 1.0 for text-to-image, lower values to keep more of an encoded input image. They are separate controls, and raising either one does not promise an exact pose or face. Change one at a time on a fixed seed.
How do I do regional prompting in ComfyUI?
Encode one prompt for the whole image and one for each region. Run each regional prompt through Conditioning (Set Area) or Conditioning (Set Mask), merge everything with Conditioning (Combine), and send the result to the positive input of the KSampler. For a single fix in an existing picture, an instruction-editing model is often the simpler route.
What replaced IP-Adapter in ComfyUI?
Its main node pack, ComfyUI_IPAdapter_plus, has been in maintenance-only mode since 14 April 2025 and still suits SD1.5 and SDXL. Newer models take reference images natively, with official templates for Qwen-Image-Edit-2511 and FLUX.2 [klein] 4B. FLUX.2 [dev] and Qwen-Image 2.1 also accept references but carry non-commercial or research licences.
Which upscaler should I use in ComfyUI?
For a faithful enlargement, an upscale model or SeedVR2, which is natively supported. To add detail with your own checkpoint, a two-pass workflow or the Ultimate SD Upscale node, which re-diffuses the image tile by tile at a low denoise of 0.2 by default. Fix artifacts such as extra fingers before you upscale, because every method enlarges them.
How do I batch-render prompts in ComfyUI?
Export the workflow with File, then Export Workflow (API), and send one request per prompt to the local /prompt endpoint, changing the prompt text and seed each time. Wait for each run in /history and download files from /view. The script on this page does that with Python's standard library, and the custom node example does it inside one run.
Can I use these techniques for commercial work?
The techniques are free to use; the models each have their own licence. Qwen-Image-Edit-2511, Z-Image-Turbo, FLUX.2 [klein] 4B and SeedVR2 are listed as Apache 2.0. FLUX.2 [dev] limits the model to non-commercial use without a paid licence, Qwen-Image 2.1 is under a research licence, and SDXL Turbo is free commercially only below $1 million in annual revenue.