diff --git a/README.md b/README.md index 602ce86..11c9c19 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,11 @@ We're actively working on improvements and new features. To stay informed: ## 🚀 Updates +**2025.11.08 - Version 2.5.4** + +- 🎨 **Fix: AdaIN color correction** - Replace `.view()` with `.reshape()` to handle non-contiguous tensors after spatial padding, resolving "view size is not compatible with input tensor's size and stride" error +- 🔴 **Fix: AMD ROCm compatibility** - Add cuDNN availability check in Conv3d workaround to prevent "ATen not compiled with cuDNN support" error on ROCm systems (AMD GPUs on Windows/Linux) + **2025.11.08 - Version 2.5.3** - 🍎 **Fix: Apple Silicon MPS device handling** - Corrected MPS device enumeration to use `"mps"` instead of `"mps:0"`, resolving invalid device errors on M-series Macs diff --git a/pyproject.toml b/pyproject.toml index c0d950e..c53010e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "seedvr2_videoupscaler" description = "SeedVR2 official ComfyUI integration: ByteDance-Seed's one-step diffusion-based video/image upscaling with memory-efficient inference" -version = "2.5.3" +version = "2.5.4" authors = [ {name = "numz"}, {name = "adrientoupet"} diff --git a/src/models/video_vae_v3/modules/causal_inflation_lib.py b/src/models/video_vae_v3/modules/causal_inflation_lib.py index d418fd1..a6b847e 100644 --- a/src/models/video_vae_v3/modules/causal_inflation_lib.py +++ b/src/models/video_vae_v3/modules/causal_inflation_lib.py @@ -91,8 +91,12 @@ class InflatedCausalConv3d(Conv3d): Workaround: Call torch.cudnn_convolution directly to bypass buggy layer. Status is logged at startup in compatibility.py. """ - if NVIDIA_CONV3D_MEMORY_BUG_WORKAROUND and weight.dtype in (torch.float16, torch.bfloat16): - # Direct cuDNN call bypasses buggy PyTorch dispatch layer + if (NVIDIA_CONV3D_MEMORY_BUG_WORKAROUND and + weight.dtype in (torch.float16, torch.bfloat16) and + hasattr(torch.backends.cudnn, 'is_available') and + torch.backends.cudnn.is_available() and + getattr(torch.backends.cudnn, 'enabled', True)): + # Direct cuDNN call bypasses buggy PyTorch dispatch layer (NVIDIA only) out = torch.cudnn_convolution( input, weight, self.padding, self.stride, self.dilation, self.groups, benchmark=False, deterministic=False, allow_tf32=True diff --git a/src/utils/color_fix.py b/src/utils/color_fix.py index adf1cea..51e3d61 100644 --- a/src/utils/color_fix.py +++ b/src/utils/color_fix.py @@ -84,9 +84,9 @@ def calc_mean_std(feat: Tensor, eps: float = 1e-5) -> tuple[Tensor, Tensor]: assert len(size) == 4, 'The input feature should be 4D tensor.' b, c = size[:2] - feat_var = feat.view(b, c, -1).var(dim=2) + eps - feat_std = feat_var.sqrt().view(b, c, 1, 1) - feat_mean = feat.view(b, c, -1).mean(dim=2).view(b, c, 1, 1) + feat_var = feat.reshape(b, c, -1).var(dim=2) + eps + feat_std = feat_var.sqrt().reshape(b, c, 1, 1) + feat_mean = feat.reshape(b, c, -1).mean(dim=2).reshape(b, c, 1, 1) return feat_mean, feat_std