LTX2.3-Multifunctional / LTX2.3 /patches /keep_models_runtime.py
India2000's picture dx8152's picture
Duplicate from dx8152/LTX2.3-Multifunctional
bf1eaec
Raw History Blame Contribute Delete
482 Bytes
"""仅提供强制卸载 GPU 管线。「保持模型加载」功能已移除。"""
from __future__ import annotations
from typing import Any
def force_unload_gpu_pipeline(pipelines: Any) -> None:
"""释放推理管线占用的显存(切换 GPU、清理、LoRA 重建等场景)。"""
try:
pipelines.unload_gpu_pipeline()
except Exception:
try:
type(pipelines).unload_gpu_pipeline(pipelines)
except Exception:
pass