floyo logobeta logo
Powered by
ThinkDiffusion
floyo logobeta logo
Powered by
ThinkDiffusion

ComfyUI-RegionalAdaptiveSampling

19

Last updated
2025-04-07

Regional Adaptive Sampling is an innovative tool designed to enhance the efficiency of diffusion transformers by optimizing the inference process. It operates by selectively caching and processing specific regions of data, thus speeding up the generation workflow in ComfyUI.

  • This tool is compatible with various models, including Flux and HunYuanVideo, and supports certain versions of Wan.
  • It allows users to adjust key parameters such as sample ratio and starvation scale, giving them control over output quality and focus.
  • The implementation is straightforward, enabling users to integrate it into their existing workflows without extensive modifications.

Context

Regional Adaptive Sampling (RAS) is a technique implemented in ComfyUI to improve the performance of diffusion models. Its main purpose is to accelerate inference by intelligently managing the tokens processed during each diffusion step, which is crucial for generating high-quality images quickly.

Key Features & Benefits

The tool offers several practical features that enhance user experience:

  • Sample Ratio: Users can define the percentage of tokens retained during a RAS pass, allowing for fine-tuning of image quality. Maintaining a sample ratio above 0.3 is essential for optimal results.
  • Warmup Steps: This parameter determines how many initial steps are processed without RAS, balancing speed and quality. Users can adjust this to optimize performance based on their specific needs.
  • Hydrate Every: This setting refreshes the cache by performing a full pass through the model at specified intervals, ensuring that the generated content remains relevant and up-to-date.

Advanced Functionalities

The tool includes advanced capabilities such as starvation scale adjustment, which influences the model's focus during image generation. By modifying this parameter, users can prioritize details in the foreground or background, allowing for creative flexibility in their outputs.

Practical Benefits

By integrating Regional Adaptive Sampling into their workflows, users can significantly enhance the speed and quality of image generation in ComfyUI. The selective token processing leads to improved control over the output, resulting in more efficient and higher-quality artistic creations.

Credits/Acknowledgments

This implementation of Regional Adaptive Sampling is based on the original work from Microsoft and has been adapted for use with various models in ComfyUI. The current version is 1.1.0 and remains in experimental status, welcoming contributions and feedback from the community.