ComfyUI > Nodes > ComfyUI-NAG > NAGCFGGuider

ComfyUI Node: NAGCFGGuider

Class Name

NAGCFGGuider

Category
sampling/custom_sampling/guiders
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

NAGCFGGuider Description

Specialized node enhancing AI art generation with Negative Aesthetic Guidance for refined image manipulation.

NAGCFGGuider:

The NAGCFGGuider is a specialized node designed to enhance the sampling process in AI art generation by integrating advanced guidance techniques. It extends the capabilities of the CFGGuider class, providing a more nuanced control over the sampling process through the use of Negative Aesthetic Guidance (NAG). This node is particularly beneficial for artists looking to fine-tune the aesthetic qualities of their generated images by adjusting various parameters that influence the model's behavior during sampling. By leveraging NAG, the NAGCFGGuider allows for a more refined manipulation of the model's output, enabling the creation of images that adhere more closely to the artist's vision. The node's primary function is to guide the model in generating images that balance between the desired and undesired features, offering a powerful tool for achieving specific artistic goals.

NAGCFGGuider Input Parameters:

model

The model parameter specifies the AI model used for image generation. It is crucial as it determines the underlying architecture and capabilities of the sampling process. The choice of model can significantly impact the style and quality of the generated images.

conditioning

The conditioning parameter provides the positive guidance for the model, influencing the features and styles that should be emphasized in the generated image. It acts as a directive for the model to follow, ensuring that the output aligns with the desired artistic intent.

nag_negative

The nag_negative parameter is used to specify the negative guidance, which helps in suppressing unwanted features in the generated image. This parameter is essential for refining the output by reducing the influence of undesired elements, thus enhancing the overall aesthetic quality.

nag_scale

The nag_scale parameter controls the intensity of the negative guidance. With a default value of 5.0, it can range from 0.0 to 100.0, allowing for fine-tuning of how strongly the negative guidance affects the sampling process. A higher value increases the suppression of unwanted features.

nag_tau

The nag_tau parameter, with a default value of 2.5, ranges from 1.0 to 10.0 and influences the temporal aspect of the negative guidance. It adjusts the rate at which the negative guidance is applied, affecting the smoothness and consistency of the suppression over the sampling iterations.

nag_alpha

The nag_alpha parameter, ranging from 0.0 to 1.0 with a default of 0.25, determines the blending factor between the positive and negative guidance. It controls the balance, allowing for a harmonious integration of both influences in the final output.

nag_sigma_end

The nag_sigma_end parameter, with a default value of 0.0 and a range from 0.0 to 20.0, sets the endpoint for the negative guidance's influence. It defines the final intensity of the suppression, providing a way to taper off the negative guidance towards the end of the sampling process.

latent_image

The latent_image parameter represents the initial latent space representation of the image. It serves as the starting point for the sampling process, and its batch size is used to configure the guider, ensuring that the guidance is applied consistently across all samples.

NAGCFGGuider Output Parameters:

GUIDER

The GUIDER output is the configured guider object that encapsulates the guidance settings applied during the sampling process. It is essential for directing the model in generating images that align with the specified positive and negative guidance, ultimately influencing the aesthetic outcome of the generated artwork.

NAGCFGGuider Usage Tips:

  • Experiment with different nag_scale values to find the optimal level of negative guidance that suppresses unwanted features without overpowering the positive guidance.
  • Adjust the nag_alpha parameter to achieve a balanced integration of positive and negative influences, ensuring that the final image reflects the desired artistic intent.

NAGCFGGuider Common Errors and Solutions:

Model type <model_type> is not support for NAGCFGGuider

  • Explanation: This error occurs when the specified model type is not compatible with the NAGCFGGuider.
  • Solution: Ensure that the model you are using is one of the supported types, such as Flux, Chroma, UNetModel, or others listed in the documentation. If not, consider switching to a compatible model.

ValueError: Invalid parameter range

  • Explanation: This error indicates that one or more input parameters are set outside their allowed range.
  • Solution: Double-check the values of parameters like nag_scale, nag_tau, nag_alpha, and nag_sigma_end to ensure they fall within the specified minimum and maximum limits. Adjust them accordingly to resolve the issue.

NAGCFGGuider 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.