Skip to content

Commit 4490bd1

Browse files
authored
Merge pull request #441 from AInVFX/main
v2.5.24: Restores the MPS memory leak workaround that was accidentally removed during code cleanup in v2.5.23
2 parents 5a4bf42 + baec4b6 commit 4490bd1

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ We're actively working on improvements and new features. To stay informed:
3636

3737
## 🚀 Release Notes
3838

39+
**2025.12.24 - Version 2.5.24**
40+
41+
- **🍎 Fix: MPS memory leak regression** - Restored MPS cache clearing after VAE encode/decode operations that was accidentally removed during code cleanup in v2.5.23
42+
3943
**2025.12.24 - Version 2.5.23**
4044

4145
- **🔒 Security: Prevent code execution in model loading** - Added protection against malicious .pth files by restricting deserialization to tensors only

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "seedvr2_videoupscaler"
33
description = "SeedVR2 official ComfyUI integration: ByteDance-Seed's one-step diffusion-based video/image upscaling with memory-efficient inference"
4-
version = "2.5.23"
4+
version = "2.5.24"
55
authors = [
66
{name = "numz"},
77
{name = "adrientoupet"}

src/models/video_vae_v3/modules/attn_video_vae.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,10 @@ def _encode(
12241224

12251225
output = causal_conv_gather_outputs(output)
12261226

1227+
# MPS memory leak workaround (pytorch/pytorch#155060)
1228+
if self.device.type == 'mps':
1229+
torch.mps.empty_cache()
1230+
12271231
# Only transfer back if needed
12281232
return output if output.device == x.device else output.to(x.device)
12291233

@@ -1240,6 +1244,10 @@ def _decode(
12401244
output = self.decoder(_z, memory_state=memory_state)
12411245
output = causal_conv_gather_outputs(output)
12421246

1247+
# MPS memory leak workaround (pytorch/pytorch#155060)
1248+
if self.device.type == 'mps':
1249+
torch.mps.empty_cache()
1250+
12431251
# Only transfer back if needed
12441252
return output if output.device == z.device else output.to(z.device)
12451253

src/utils/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
# Version information
7-
__version__ = "2.5.23"
7+
__version__ = "2.5.24"
88

99
import os
1010
import warnings

0 commit comments

Comments
 (0)