Hunyuan 3 Force Unload (Nuclear):
HunyuanImage3ForceUnload is a node designed to aggressively clear resources, specifically targeting the unloading of models from GPU memory to ensure that downstream nodes can re-evaluate and function optimally. This node is particularly useful in scenarios where memory management is critical, such as when working with large models or limited VRAM resources. By forcefully unloading models, it helps prevent memory bottlenecks and ensures that the system can handle new tasks without being hindered by previously loaded models. This "nuclear" approach to unloading is beneficial for maintaining system performance and stability, especially in workflows that require frequent model switching or when operating under constrained hardware conditions.
Hunyuan 3 Force Unload (Nuclear) Input Parameters:
first_run_only
The first_run_only parameter determines whether the force unload operation should be executed only once per session. When set to True, the node will perform the unload operation on its first execution and skip subsequent runs, preserving loaded models for efficiency. This is useful for workflows where unloading is only necessary initially to clear memory, and subsequent operations can proceed without further unloading. The default value is typically False, allowing the node to execute its unloading function every time it is called.
unique_id
The unique_id parameter is used to uniquely identify the node instance within a session. This helps in tracking whether the node has already executed its force unload operation when first_run_only is enabled. If not provided, a default identifier is used. This parameter ensures that the node's behavior is consistent and predictable across different runs, especially in complex workflows where multiple instances of the node might be present.
Hunyuan 3 Force Unload (Nuclear) Output Parameters:
cleared
The cleared output indicates whether the force unload operation was successfully executed. A value of True signifies that the models were unloaded from memory, freeing up resources for subsequent tasks. This output is crucial for understanding the node's impact on system resources and ensuring that the intended memory management actions were performed.
vram_status
The vram_status output provides information about the GPU memory state before and after the force unload operation. This helps in assessing the effectiveness of the unloading process and understanding the memory dynamics within the system. It is particularly useful for diagnosing memory-related issues and optimizing resource allocation.
trigger
The trigger output is a timestamp or marker indicating when the force unload operation was executed. This can be used for logging and tracking purposes, helping users understand the sequence of operations within their workflow and ensuring that the node's actions are synchronized with other processes.
Hunyuan 3 Force Unload (Nuclear) Usage Tips:
- Use the
first_run_onlyparameter to optimize performance in workflows where unloading is only necessary at the start, reducing unnecessary operations in subsequent runs. - Monitor the
vram_statusoutput to evaluate the effectiveness of the force unload operation and adjust your workflow accordingly to manage memory resources efficiently.
Hunyuan 3 Force Unload (Nuclear) Common Errors and Solutions:
Could not clear CUDA cache after error
- Explanation: This error occurs when the node attempts to clear the CUDA cache but encounters an issue, possibly due to insufficient permissions or a problem with the CUDA environment.
- Solution: Ensure that your CUDA environment is correctly configured and that you have the necessary permissions to clear the cache. Restarting the system or updating CUDA drivers may also resolve the issue.
FORCE UNLOAD SKIPPED (first_run_only)
- Explanation: This message indicates that the force unload operation was skipped because the node has already executed once in the current session with
first_run_onlyenabled. - Solution: If you need to perform the unload operation again, consider restarting the session or disabling the
first_run_onlyparameter.
