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.