Skip to main content

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.

SamplerCustomAdvanced

๐Ÿ’ก 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.

InputTypeDescription
noiseNOISEThis is your randomness source โ€” typically a Gaussian noise tensor. Must match the dimensions of the latent input.
guiderGUIDERThis controls how the sampling is directed. Used to guide the transformation in a structured way (e.g., preserving edges, shapes, etc.).
samplerSAMPLERDefines the core algorithm that controls how steps are taken through latent space. Often created using SamplerCustom or similar.
sigmasSIGMASA float tensor that determines the noise levels per step โ€” basically how โ€œloudโ€ or โ€œquietโ€ your sampling should be at each iteration.
latent_imageLATENTThe 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โ€‹

OutputTypeDescription
outputLATENTThe final latent result after full sampling. Usually passed into a VAE Decode or further refinement.
denoised_outputLATENTThe 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โ€‹

FieldTypeRequired?Notes
noiseTensorโœ… YesMust match the latent shape. Gaussian noise is typical.
guiderModuleโœ… YesUse something like EdgeGuidance, ControlNet, or similar.
samplerSamplerโœ… YesGenerated via SamplerCustom, SamplerCustomAdvanced, or KSamplerSelect.
sigmasTensorโœ… YesCustom sigma schedule for noise reduction. Must match expected sampling length.
latent_imageTensorโœ… YesYour input image in latent form.

๐Ÿงฏ Common Errors & Troubleshootingโ€‹

ErrorWhat It MeansFix
Shape mismatch between tensorsOne 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 typeYouโ€™ve connected a guider that isnโ€™t compatible with this sampler.Use a guider node explicitly designed for this setup.
Poor image qualitySigmas 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 platformProcessing is too heavy for your cloud setup (e.g., ComfyUI Run).Reduce image resolution, or avoid high sigma schedules with complex guider modules.
NodeWhat It Does
SamplerA simpler version for typical sampling tasks. Great for plug-and-play scenarios.
SamplerCustomSimilar, but doesnโ€™t expose the denoised latent. Less precise, more streamlined.
NoiseUse this to generate compatible noise inputs.
Guider NodesLike 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.