ComfyUI > Nodes > DistanceSampler > SamplerDistance

ComfyUI Node: SamplerDistance

Class Name

SamplerDistance

Category
sampling/custom_sampling/samplers
Author
Extraltodeus (Account age: 3473days)
Extension
DistanceSampler
Latest Updated
2025-05-09
Github Stars
0.03K

How to Install DistanceSampler

Install this extension via the ComfyUI Manager by searching for DistanceSampler
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DistanceSampler 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

SamplerDistance Description

Enhances AI art sampling with advanced resampling for refined artistic effects and control.

SamplerDistance:

The SamplerDistance node is designed to enhance the sampling process in AI art generation by utilizing advanced resampling techniques. It provides a flexible approach to sampling, allowing you to fine-tune the resampling process to achieve desired artistic effects. The node leverages a distance-based method to adjust the sampling steps dynamically, which can lead to more refined and controlled outputs. This method is particularly beneficial for achieving smoother transitions and more precise control over the sampling process, making it a valuable tool for artists looking to experiment with different sampling strategies. By offering options to adjust the resampling at different stages, the SamplerDistance node empowers you to explore a wide range of creative possibilities.

SamplerDistance Input Parameters:

resample

The resample parameter determines the number of resampling steps to be used during the sampling process. It allows you to control the granularity of the sampling, with a default value of 3. The parameter accepts integer values ranging from -1 to 32. A value of 0 corresponds to the Euler method, while a value of 1 uses the Heun method. Values starting from 2 employ the distance method, which is the core feature of this node. Setting the value to -1 will automatically calculate the resample value based on the remaining steps plus one, although this can be slower.

resample_end

The resample_end parameter specifies the number of resampling steps to be applied at the end of the sampling process. It provides additional control over the final stages of sampling, with a default value of -1, indicating a constant resampling rate. The parameter accepts integer values from -1 to 32, allowing you to fine-tune the end of the sampling process to achieve specific artistic effects.

cfgpp

The cfgpp parameter is a boolean option that, when enabled, applies a configuration post-processing step to the sampling process. This option is enabled by default and can be toggled to refine the output by incorporating additional adjustments based on the configuration settings. It enhances the flexibility of the node by allowing you to apply post-processing to the sampled data, potentially improving the quality and coherence of the generated art.

SamplerDistance Output Parameters:

SAMPLER

The output of the SamplerDistance node is a SAMPLER object, which encapsulates the configured sampling process. This object is used to execute the sampling with the specified parameters, producing the final output that reflects the adjustments made through the resampling and configuration options. The SAMPLER output is crucial for integrating the node's functionality into the broader AI art generation workflow, enabling you to leverage the advanced sampling techniques provided by the node.

SamplerDistance Usage Tips:

  • Experiment with different resample values to find the optimal balance between speed and quality for your specific project. Higher values can lead to more detailed outputs but may increase processing time.
  • Use the resample_end parameter to control the final stages of your sampling process, which can be particularly useful for achieving specific artistic effects or ensuring smooth transitions in your generated art.
  • Enable the cfgpp option to apply additional post-processing to your samples, which can enhance the overall quality and coherence of the output.

SamplerDistance Common Errors and Solutions:

ValueError: Invalid resample value

  • Explanation: This error occurs when the resample parameter is set to a value outside the allowed range of -1 to 32. - Solution: Ensure that the resample value is within the specified range and adjust it accordingly.

TypeError: cfgpp must be a boolean

  • Explanation: This error arises when the cfgpp parameter is set to a non-boolean value.
  • Solution: Verify that the cfgpp parameter is set to either True or False.

RuntimeError: Resample steps exceed maximum allowed

  • Explanation: This error indicates that the calculated resample steps exceed the maximum allowed value.
  • Solution: Adjust the resample and resample_end parameters to ensure that the total resample steps do not exceed the maximum limit.

SamplerDistance Related Nodes

Go back to the extension to check out more related nodes.
DistanceSampler
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 Playground, enabling artists to harness the latest AI tools to create incredible art.