diff --git a/README.md b/README.md index bc5f1a5..07fd9b3 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,13 @@ We're actively working on improvements and new features. To stay informed: ## ๐Ÿš€ Release Notes +**2025.12.13 - Version 2.5.22** + +- **๐ŸŽฌ CLI: FFmpeg video backend with 10-bit support** - New `--video_backend ffmpeg` and `--10bit` flags enable x265 encoding with 10-bit color depth, reducing banding artifacts in gradients compared to 8-bit OpenCV output *(based on PR by [@thehhmdb](https://github.com/thehhmdb) - thank you!)* +- **๐ŸŽ Fix: MPS bicubic upscaling compatibility** - Added CPU fallback for bicubic+antialias interpolation on PyTorch versions before 2.8.0, resolving RGBA alpha upscaling errors on Apple Silicon +- **โšก Fix: Cross-platform histogram matching** - Replaced scatter_ operation with argsort+index_select for improved reliability across CUDA, ROCm, and MPS backends +- **๐Ÿงน MPS: Remove sync overhead** - Reverted unnecessary `torch.mps.synchronize()` calls introduced in v2.5.21 for consistent behavior with CUDA pipeline + **2025.12.12 - Version 2.5.21** - **๐Ÿ› ๏ธ Fix: GGUF dequantization error on MPS** - Resolved shape mismatch error introduced in 2.5.20 by skipping GGUF quantized buffers in precision conversion - these must remain in packed format for on-the-fly dequantization during inference diff --git a/pyproject.toml b/pyproject.toml index b092915..ff2ca79 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.21" +version = "2.5.22" authors = [ {name = "numz"}, {name = "adrientoupet"} diff --git a/src/utils/color_fix.py b/src/utils/color_fix.py index 603c2c9..880b9b9 100644 --- a/src/utils/color_fix.py +++ b/src/utils/color_fix.py @@ -506,15 +506,15 @@ def _histogram_matching_channel(source: Tensor, reference: Tensor, device: torch matched_sorted = reference_sorted[ref_indices] del source_quantiles, ref_indices, reference_sorted - del source_sorted + del source_sorted, source_flat - # Reconstruct using index_select with out param (portable, memory-efficient) + # Reconstruct using argsort (portable across CUDA/ROCm/MPS) inverse_indices = torch.argsort(source_indices) del source_indices - torch.index_select(matched_sorted, 0, inverse_indices, out=source_flat) + matched_flat = matched_sorted[inverse_indices] del matched_sorted, inverse_indices - return source_flat.reshape(original_shape) + return matched_flat.reshape(original_shape) def hsv_saturation_histogram_match(content_feat: Tensor, style_feat: Tensor, debug: Optional['Debug'] = None) -> Tensor: @@ -756,11 +756,10 @@ def _histogram_match_1d(source: Tensor, reference: Tensor, device: torch.device) del source_sorted - # Reconstruct using index_select with out param (portable, memory-efficient) - matched = torch.empty_like(source) + # Reconstruct using argsort (portable across CUDA/ROCm/MPS) inverse_indices = torch.argsort(source_indices) del source_indices - torch.index_select(matched_sorted, 0, inverse_indices, out=matched) + matched = matched_sorted[inverse_indices] del matched_sorted, inverse_indices return matched diff --git a/src/utils/constants.py b/src/utils/constants.py index c96cbcd..1b3882f 100644 --- a/src/utils/constants.py +++ b/src/utils/constants.py @@ -4,7 +4,7 @@ Only includes constants actually used in the codebase """ # Version information -__version__ = "2.5.21" +__version__ = "2.5.22" import os import warnings