MiniMax H3 Qwen Reference Prefix Cache / 参考前缀缓存 (Advanced):
The MiniMaxH3QwenReferencePrefixCacheT8Advanced node is designed to enhance the efficiency of the H3 Qwen3-VL encoder by implementing a bounded CPU-memory cache specifically for the visual-reference prefix. This node allows you to opt-in for caching, which can significantly reduce the computational load by storing and reusing the exact visual-reference prefix, while still recomputing the prompt text to ensure accuracy. It is particularly beneficial for scenarios where repeated visual references are used, as it optimizes performance without altering the core files of ComfyUI or the input CLIP object. This advanced caching mechanism is crucial for maintaining high efficiency in processing visual data, making it an essential tool for AI artists working with complex visual inputs.
MiniMax H3 Qwen Reference Prefix Cache / 参考前缀缓存 (Advanced) Input Parameters:
clip
The clip parameter is the input CLIP object that the node processes. It serves as the primary data source for the caching operation, allowing the node to extract and cache the visual-reference prefix. This parameter is crucial as it directly influences the node's ability to perform its caching function effectively.
mode
The mode parameter determines the operational mode of the cache. It offers two options: report_only and memory_lru_exp. The default is report_only, which provides a report on cache usage without altering the cache state. The memory_lru_exp mode enables a least-recently-used (LRU) expiration policy, which helps manage memory usage by removing the least accessed entries. This parameter is essential for controlling how the cache behaves and manages its entries.
max_entries
The max_entries parameter specifies the maximum number of entries that the cache can hold. It ranges from 1 to 16, with a default value of 1. This parameter is critical for defining the cache's capacity, directly impacting its ability to store and retrieve visual-reference prefixes efficiently.
maximum_cache_mib
The maximum_cache_mib parameter sets the maximum size of the cache in mebibytes (MiB). It can be adjusted between 64.0 and 65536.0 MiB, with a default of 1024.0 MiB. This parameter is vital for managing the memory footprint of the cache, ensuring it operates within the available system resources.
cache_epoch
The cache_epoch parameter is used to create a fresh, empty cache without affecting the input CLIP. It is an integer value ranging from 0 to 2147483647, with a default of 0. Incrementing this value resets the cache, which can be useful for starting a new caching session or clearing outdated entries.
MiniMax H3 Qwen Reference Prefix Cache / 参考前缀缓存 (Advanced) Output Parameters:
output
The output parameter provides the processed data from the node, which includes the cached visual-reference prefix. This output is essential for subsequent processing steps, as it contains the optimized data ready for further use.
cache
The cache parameter outputs the current state of the cache, including its contents and configuration. This information is crucial for understanding the cache's performance and making informed decisions about its management.
report
The report parameter delivers a JSON-formatted report detailing the cache's operation, including hit/miss statistics and memory usage. This output is valuable for monitoring the cache's effectiveness and identifying areas for optimization.
MiniMax H3 Qwen Reference Prefix Cache / 参考前缀缓存 (Advanced) Usage Tips:
- To optimize performance, use the
memory_lru_expmode when working with large datasets or when memory resources are limited, as it helps manage cache size effectively. - Regularly monitor the
reportoutput to understand cache usage patterns and adjustmax_entriesandmaximum_cache_mibparameters accordingly for optimal performance.
MiniMax H3 Qwen Reference Prefix Cache / 参考前缀缓存 (Advanced) Common Errors and Solutions:
unsupported Qwen prefix cache mode
- Explanation: This error occurs when an invalid mode is specified for the cache operation.
- Solution: Ensure that the
modeparameter is set to eitherreport_onlyormemory_lru_exp.
cache_epoch must be between 0 and 2147483647
- Explanation: This error indicates that the
cache_epochvalue is outside the acceptable range. - Solution: Adjust the
cache_epochparameter to a value within the specified range of 0 to 2147483647.
