Visit ComfyUI Online for ready-to-use ComfyUI environment
DistanceSampler is a heuristic modification of the Heun sampler for ComfyUI, utilizing a custom function based on normalized distances to enhance sampling efficiency and accuracy.
DistanceSampler is an innovative and experimental tool designed to enhance the quality of AI-generated images by focusing on the relative distances during the sampling process. This extension is particularly beneficial for AI artists who seek to create more precise and visually appealing images with fewer artifacts, such as body horror or merged figures. By using DistanceSampler, you can achieve high-quality results with fewer steps, making it an efficient choice for generating simple subjects without the need for unconditional prediction. This means you can maintain a low CFG (Classifier-Free Guidance) scale, even as low as 1, while still producing excellent image quality.
At its core, DistanceSampler operates by initially taking slower steps to ensure a more accurate start, which is crucial as most of the image's foundational work is done in these early stages. As the process progresses, the sampler accelerates, culminating in a method known as Heun's method. This approach allows for a more refined and precise image generation process. Imagine it like painting a picture: you start with careful, deliberate strokes to outline the main features, and then you can speed up as you fill in the details, ensuring everything aligns perfectly.
DistanceSampler offers several features that can be tailored to your artistic needs:
DistanceSampler includes different variations that cater to specific needs:
If you encounter issues related to tensor shapes, a potential solution is to modify the "presets_to_add.py" file by uncommenting the following lines:
python extra_samplers["Distance_fast"] = distance_wrap(resample=3, resample_end=1, cfgpp=False, sharpen=False) extra_samplers["Distance_fast_n"] = distance_wrap(resample=3, resample_end=1, cfgpp=False, sharpen=False, use_negative=True)
These adjustments replace the spherical interpolation with a weighted average, which may resolve compatibility issues without significantly affecting the output quality.
For those interested in diving deeper into the technical aspects of DistanceSampler, the author has provided a more technical explanation. Additionally, you can explore community forums and online tutorials to connect with other AI artists and share experiences, tips, and support. Engaging with these resources can enhance your understanding and mastery of DistanceSampler, allowing you to fully leverage its capabilities in your creative projects.
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.