Skip to content

Commit e6a9dc2

Browse files
authored
Merge pull request #2 from numz/main
Update the plugin
2 parents 3b9ea8d + 4490bd1 commit e6a9dc2

29 files changed

+2445
-1302
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@ We welcome code contributions from the community. Here's how to propose changes:
1616
1. Fork this repository to your own GitHub account.
1717
2. Create a new branch on your fork for your changes.
1818
3. Make your changes in this branch.
19-
4. When you are ready, submit a pull request to either:
20-
- **`main` branch** - For stable features and bug fixes
21-
- **`nightly` branch** - For experimental features or if you want faster integration (note: this branch changes more frequently and may be less stable)
19+
4. When you are ready, submit a pull request to the **`main`** branch.
2220

23-
### Branch Guidelines
24-
- **Main Branch**: Use this for production-ready changes, critical bug fixes, and well-tested features
25-
- **Nightly Branch**: Use this for experimental features, cutting-edge improvements, or if you need your changes integrated quickly. Be aware that this branch is actively under development and may contain unstable features.
26-
27-
We use the GitHub Flow workflow. Choose the appropriate target branch based on the nature of your contribution.
21+
We use the GitHub Flow workflow.
2822

2923
Before submitting a pull request, please make sure your code adheres to the project's coding conventions and it has passed all tests. If you are adding features, please also add appropriate tests.
3024

README.md

Lines changed: 171 additions & 33 deletions
Large diffs are not rendered by default.

__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Official SeedVR2 integration for ComfyUI
44
"""
55

6+
from .src.optimization.compatibility import ensure_triton_compat # noqa: F401
67
from .src.interfaces import comfy_entrypoint, SeedVR2Extension
78

89
__all__ = ["comfy_entrypoint", "SeedVR2Extension"]

inference_cli.py

Lines changed: 625 additions & 336 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
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.10"
4+
version = "2.5.24"
55
authors = [
66
{name = "numz"},
77
{name = "adrientoupet"}
88
]
99
license = {file = "LICENSE"}
1010
classifiers = [
11-
"Operating System :: OS Independent",
12-
"Environment :: GPU :: NVIDIA CUDA"
11+
"Operating System :: OS Independent"
1312
]
1413
dependencies = [
1514
"torch",

src/common/diffusion/timesteps/sampling/trailing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(
3636
dtype: torch.dtype = torch.float32,
3737
):
3838
# Create trailing timesteps with specified dtype
39-
timesteps = torch.arange(1.0, 0.0, -1.0 / steps, device=device, dtype=dtype)
39+
timesteps = torch.arange(1.0, 0.0, -1.0 / steps, device='cpu').to(device=device, dtype=dtype)
4040

4141
# Shift timesteps.
4242
timesteps = shift * timesteps / (1 + (shift - 1) * timesteps)

src/common/distributed/basic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import torch
2222
import torch.distributed as dist
2323
from torch.nn.parallel import DistributedDataParallel
24+
from ...optimization.memory_manager import is_mps_available
2425

2526
def get_global_rank() -> int:
2627
"""
@@ -47,7 +48,7 @@ def get_device() -> torch.device:
4748
"""
4849
Get current rank device.
4950
"""
50-
if hasattr(torch, 'mps') and callable(getattr(torch.mps, 'is_available', None)) and torch.mps.is_available():
51+
if is_mps_available():
5152
return torch.device("mps")
5253
return torch.device("cuda", get_local_rank())
5354

src/core/alpha_upscaling.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,23 @@ def edge_guided_alpha_upscale(
337337
rgb_edges = detect_edges_batch(images=rgb_normalized, method='sobel', debug=debug)
338338

339339
# Step 1: Initial bicubic upscale provides smooth base before edge refinement
340-
alpha_upscaled = F.interpolate(
341-
input_alpha,
342-
size=(H_out, W_out),
343-
mode='bicubic',
344-
align_corners=False,
345-
antialias=True
346-
).clamp(0, 1)
340+
# MPS on PyTorch < 2.8 doesn't support bicubic+antialias - use CPU fallback
341+
try:
342+
alpha_upscaled = F.interpolate(
343+
input_alpha,
344+
size=(H_out, W_out),
345+
mode='bicubic',
346+
align_corners=False,
347+
antialias=True
348+
).clamp(0, 1)
349+
except NotImplementedError:
350+
alpha_upscaled = F.interpolate(
351+
input_alpha.cpu(),
352+
size=(H_out, W_out),
353+
mode='bicubic',
354+
align_corners=False,
355+
antialias=True
356+
).to(device).clamp(0, 1)
347357

348358
if is_binary_mask:
349359
if debug:

0 commit comments

Comments
 (0)