feat: 添加RAM缓存极限清理节点

- 新增RAMCacheExtremeCleanup节点,提供一次性强清理功能
- 清理包含虚拟内存占用,并自动恢复之前的模式与阈值
This commit is contained in:
windecay
2026-02-04 23:44:49 +08:00
parent f0a516f748
commit fb05365923
4 changed files with 105 additions and 25 deletions
+15 -3
View File
@@ -9,14 +9,15 @@ A custom node for ComfyUI that dynamically manages RAM usage by intelligently co
- **Dual Cache Management Modes**:
- CLASSIC (No Eviction): Standard cache behavior with no automatic purging
- RAM_PRESSURE (Auto Purge): Smart cache purging when system memory falls below the threshold
- **RAM Cache Extreme Cleanup (🧹)**: Performs a one-time aggressive purge and automatically restores the previous mode and threshold.
- **Configurable Memory Threshold**: Fine-tune the minimum amount of free RAM to maintain
- **Seamless Cache Migration**: Preserves essential cache data when switching between modes
- **Real-time Memory Monitoring**: Continuously checks system RAM availability
- **Seamless Cache Migration**: Preserves aerospace cache data when switching between modes
- **Real-time Memory Monitoring**: Continuously checks system RAM and virtual memory availability
## Installation
1. Clone or download this repository
2. Place the `ComfyUI_Dynamic_RAMCache` folder in your ComfyUI `custom_nodes` directory
2. Place the `ComfyUI_Dynamic-RAMCache` folder in your ComfyUI `custom_nodes` directory
3. Restart ComfyUI
## Usage
@@ -35,7 +36,18 @@ A custom node for ComfyUI that dynamically manages RAM usage by intelligently co
- Default: 2.0 GB
- Determines the minimum amount of free RAM to maintain (in gigabytes)
### Extreme Cleanup Parameters
- **purge_threshold**:
- Range: 0.1 - 256.0 GB
- Default: 256.0 GB
- Temporary headroom used for the one-shot purge
- **restore behavior**:
- Automatically restores the mode and threshold that were active before cleanup
3. Connect the node anywhere in your workflow - it will continuously monitor and manage cache based on your settings
4. Optionally add the "RAMCacheExtremeCleanup" node at the end of a workflow to trigger a one-shot cleanup and restore the previous state
## How It Works