SamplerCustomAdvanced
Category: Sampling / Advanced
Module: comfy-core
Outputs: LATENT, DENOISED_LATENT
Author: ComfyUI Core Team
Specialty: Custom image sampling using external noise, guider, sampler, sigmas, and latent inputs. For when βstandardβ just wonβt cut it.
π§ What Does It Do?β
The SamplerCustomAdvanced node is your go-to when the built-in samplers feel a bit tooβ¦ basic. This node gives you the ability to drive the sampling process manually using external inputs like a noise tensor, guider module, sigmas array, and more β making it a powerhouse for users building high-end, fine-tuned pipelines.
If youβre looking to customize how denoising and transformation are executed during image generation or refinement β this is your precision scalpel.
π‘ Real-World Use Casesβ
- Complex image transformations: Apply external guidance (like edges, masks, depth, or other conditioning) to latent images for more intelligent sampling.
- Custom denoising flows: Inject your own noise tensor and control how it's reduced using sigmas and sampling logic.
- High-clarity outputs: Preserve sharp features and structural integrity using advanced guidance.
- Online ComfyUI tuning: Ideal for setups like ComfyUI Cloud where GPU time is precious and control is key.
π Required Inputsβ
Each of these fields is mandatory, and yes, the node will politely fall apart if you try to skip one.
| Input | Type | Description |
|---|---|---|
noise | NOISE | This is your randomness source β typically a Gaussian noise tensor. Must match the dimensions of the latent input. |
guider | GUIDER | This controls how the sampling is directed. Used to guide the transformation in a structured way (e.g., preserving edges, shapes, etc.). |
sampler | SAMPLER | Defines the core algorithm that controls how steps are taken through latent space. Often created using SamplerCustom or similar. |
sigmas | SIGMAS | A float tensor that determines the noise levels per step β basically how βloudβ or βquietβ your sampling should be at each iteration. |
latent_image | LATENT | The image data youβre transforming. This is the canvas your sampler will iterate on. Usually output from a prior generation or upscaler node. |
Important: All inputs must be dimensionally and semantically compatible β no mismatched tensor shapes or youβre headed straight into the red error zone.
π€ Outputsβ
| Output | Type | Description |
|---|---|---|
output | LATENT | The final latent result after full sampling. Usually passed into a VAE Decode or further refinement. |
denoised_output | LATENT | The denoised latent halfway through the sampling process. Great for analysis, preview, or reprocessing. |
π Example Flowβ
[EmptyLatentImage] β [Noise] β [Guider] β [SamplerCustomAdvanced] β [VAEDecode]
This would give you a full pipeline where you're crafting the sampling flow yourself. Bonus points if you route the denoised_output into a preview panel or another editing pass.
π οΈ Parameter Referenceβ
| Field | Type | Required? | Notes |
|---|---|---|---|
noise | Tensor | β Yes | Must match the latent shape. Gaussian noise is typical. |
guider | Module | β Yes | Use something like EdgeGuidance, ControlNet, or similar. |
sampler | Sampler | β Yes | Generated via SamplerCustom, SamplerCustomAdvanced, or KSamplerSelect. |
sigmas | Tensor | β Yes | Custom sigma schedule for noise reduction. Must match expected sampling length. |
latent_image | Tensor | β Yes | Your input image in latent form. |
π§― Common Errors & Troubleshootingβ
| Error | What It Means | Fix |
|---|---|---|
Shape mismatch between tensors | One or more inputs (like noise or latent) arenβt aligned dimensionally. | Double-check the size of each input. Use matching resolution latent and noise tensors. |
Unsupported guider type | Youβve connected a guider that isnβt compatible with this sampler. | Use a guider node explicitly designed for this setup. |
Poor image quality | Sigmas or noise configuration might be over-suppressing or under-suppressing critical detail. | Try adjusting the sigmas schedule or noise input β this directly impacts denoising. |
Lag on cloud platform | Processing is too heavy for your cloud setup (e.g., ComfyUI Run). | Reduce image resolution, or avoid high sigma schedules with complex guider modules. |
π Related Nodes & Key Differencesβ
| Node | What It Does |
|---|---|
Sampler | A simpler version for typical sampling tasks. Great for plug-and-play scenarios. |
SamplerCustom | Similar, but doesnβt expose the denoised latent. Less precise, more streamlined. |
Noise | Use this to generate compatible noise inputs. |
Guider Nodes | Like EdgeGuider, ControlNetGuider, or FluxGuidance. |
π¬ Final Notesβ
The SamplerCustomAdvanced node is not for casual dabblers. Itβs meant for power users who want to engineer every stage of the image generation process, down to the noise tensor. If youβve ever found yourself saying, βI wish I had more control over how this gets denoised,β this is your tool.
And hey β once youβve mastered this, youβre basically halfway to writing your own sampler backend. So congrats on leveling up.