ComfyUI > Nodes > ComfyUI-NAG > SamplerCustomWithNAG

ComfyUI Node: SamplerCustomWithNAG

Class Name

SamplerCustomWithNAG

Category
sampling/custom_sampling
Author
ChenDarYen (Account age: 2440days)
Extension
ComfyUI-NAG
Latest Updated
2025-11-03
Github Stars
0.3K

How to Install ComfyUI-NAG

Install this extension via the ComfyUI Manager by searching for ComfyUI-NAG
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-NAG in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

SamplerCustomWithNAG Description

Enhance AI art sampling with NAG technique for refined, diverse outputs and improved image quality.

SamplerCustomWithNAG:

SamplerCustomWithNAG is a specialized node designed to enhance the sampling process in AI art generation by incorporating a technique known as NAG (Noise Augmentation Guidance). This node is part of the ComfyUI-NAG custom nodes and is tailored to provide more control and flexibility over the sampling process, allowing for the generation of more refined and diverse outputs. The primary goal of SamplerCustomWithNAG is to leverage noise augmentation to guide the sampling process, which can lead to improved image quality and variety. By integrating parameters such as noise, positive and negative conditions, and various NAG-specific settings, this node offers a robust framework for artists to experiment with different configurations and achieve desired artistic effects. The node is particularly beneficial for users looking to explore advanced sampling techniques and push the boundaries of AI-generated art.

SamplerCustomWithNAG Input Parameters:

noise

The noise parameter represents the initial random noise input that serves as the starting point for the sampling process. It is crucial for generating diverse outputs, as different noise inputs can lead to varying results. There are no specific minimum or maximum values, but the noise should be appropriately scaled to match the model's input requirements.

positive

The positive parameter is used to set the conditions or prompts that guide the model towards generating desired features in the output. It influences the model's focus during the sampling process, helping to emphasize certain aspects of the generated art. This parameter does not have fixed values but should be aligned with the artistic goals.

negative

The negative parameter works in contrast to the positive parameter by specifying conditions or prompts that the model should avoid or minimize in the output. It helps in refining the output by reducing unwanted features. Like the positive parameter, it is flexible and should be tailored to the specific artistic intent.

nag_negative

The nag_negative parameter is specific to the NAG technique and is used to define negative conditions for noise augmentation. It plays a role in guiding the noise augmentation process to avoid certain features, contributing to the refinement of the output. This parameter should be set based on the desired outcome and the characteristics to be minimized.

cfg

The cfg parameter stands for configuration and is used to adjust the overall guidance strength during the sampling process. It impacts how strongly the model adheres to the specified conditions, with higher values leading to more pronounced adherence. The exact range and default value depend on the model and artistic goals.

nag_scale

The nag_scale parameter controls the scale of noise augmentation, affecting the intensity of the NAG process. It is crucial for balancing the influence of noise augmentation on the final output. The parameter should be adjusted based on the desired level of noise influence, with no fixed minimum or maximum values.

nag_tau

The nag_tau parameter is a NAG-specific setting that influences the temporal aspect of noise augmentation. It affects how noise is applied over the sampling steps, contributing to the temporal consistency of the output. The parameter should be fine-tuned to achieve the desired temporal effects.

nag_alpha

The nag_alpha parameter controls the blending factor for noise augmentation, determining how much the augmented noise influences the output. It is essential for achieving the right balance between the original and augmented noise. The parameter should be set based on the desired blending effect.

nag_sigma_end

The nag_sigma_end parameter defines the endpoint for the noise augmentation process, indicating when the augmentation should cease. It is important for controlling the duration of noise influence during sampling. The parameter should be adjusted to match the desired endpoint of the augmentation.

latent_image

The latent_image parameter is an optional input that allows for the use of a pre-existing latent image as a starting point for the sampling process. It can be used to refine or build upon existing work, providing a foundation for further artistic exploration. The parameter should be used when there is a specific latent image to incorporate.

start_step

The start_step parameter specifies the initial step of the sampling process, allowing for control over when the sampling begins. It is useful for skipping initial steps or starting from a specific point in the process. The parameter should be set based on the desired starting point.

last_step

The last_step parameter defines the final step of the sampling process, controlling when the sampling should conclude. It is important for determining the duration of the sampling process and can be used to limit the number of steps. The parameter should be set based on the desired endpoint.

force_full_denoise

The force_full_denoise parameter is a boolean setting that, when enabled, forces the sampling process to fully denoise the output at the final step. It is useful for ensuring a clean and polished final result. The parameter should be enabled when a fully denoised output is desired.

denoise_mask

The denoise_mask parameter is an optional input that allows for selective denoising of specific areas in the output. It provides control over which parts of the image are denoised, enabling targeted refinement. The parameter should be used when there are specific areas to focus on.

sigmas

The sigmas parameter represents a sequence of values that control the noise levels at each step of the sampling process. It is crucial for managing the noise schedule and can significantly impact the final output. The parameter should be set based on the desired noise progression.

callback

The callback parameter is an optional function that can be used to execute custom code at each step of the sampling process. It provides flexibility for integrating additional functionality or monitoring the process. The parameter should be used when custom actions are needed during sampling.

disable_pbar

The disable_pbar parameter is a boolean setting that, when enabled, disables the progress bar during the sampling process. It is useful for reducing visual clutter or when the progress bar is not needed. The parameter should be enabled when a cleaner interface is desired.

seed

The seed parameter is used to set the random seed for the sampling process, ensuring reproducibility of results. It is important for generating consistent outputs across different runs. The parameter should be set when reproducibility is required.

SamplerCustomWithNAG Output Parameters:

samples

The samples output parameter represents the final generated images or data resulting from the sampling process. It is the primary output of the node and reflects the application of noise augmentation and the specified conditions. The samples are crucial for evaluating the effectiveness of the sampling process and the artistic quality of the generated outputs. They provide a tangible result that can be further analyzed or used in creative projects.

SamplerCustomWithNAG Usage Tips:

  • Experiment with different noise inputs to explore a wide range of artistic possibilities and achieve diverse outputs.
  • Adjust the cfg parameter to control the strength of guidance and find the right balance between adhering to conditions and allowing creative freedom.
  • Utilize the nag_scale, nag_tau, and nag_alpha parameters to fine-tune the noise augmentation process and achieve desired artistic effects.
  • Use the latent_image parameter to build upon existing work or refine specific aspects of a previous output.
  • Enable force_full_denoise when a clean and polished final result is desired, especially for high-quality outputs.

SamplerCustomWithNAG Common Errors and Solutions:

"Invalid noise input"

  • Explanation: This error occurs when the noise input is not properly formatted or scaled to match the model's requirements.
  • Solution: Ensure that the noise input is correctly formatted and scaled according to the model's specifications.

"Mismatched positive and negative conditions"

  • Explanation: This error arises when the positive and negative conditions are not compatible or conflict with each other.
  • Solution: Review and adjust the positive and negative conditions to ensure they are aligned and do not contradict each other.

"Invalid sigma values"

  • Explanation: This error occurs when the sigmas parameter contains invalid or out-of-range values.
  • Solution: Verify that the sigmas parameter is correctly set with appropriate values for the noise schedule.

"Callback function error"

  • Explanation: This error happens when the callback function is not properly defined or contains errors.
  • Solution: Check the callback function for any syntax or logical errors and ensure it is correctly implemented.

SamplerCustomWithNAG Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-NAG
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.