MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / _wavelet_decompose

Function _wavelet_decompose

diffsynth/pipelines/flashvsr_tiny_long.py:66–75  ·  view source on GitHub ↗
(x: torch.Tensor, levels: int = 5)

Source from the content-addressed store, hash-verified

64
65
66def _wavelet_decompose(x: torch.Tensor, levels: int = 5) -> Tuple[torch.Tensor, torch.Tensor]:
67 assert x.dim() == 4, 'x 必须是 (N, C, H, W)'
68 high = torch.zeros_like(x)
69 low = x
70 for i in range(levels):
71 radius = 2 ** i
72 blurred = _wavelet_blur(low, radius)
73 high = high + (low - blurred)
74 low = blurred
75 return high, low
76
77
78def _wavelet_reconstruct(content: torch.Tensor, style: torch.Tensor, levels: int = 5) -> torch.Tensor:

Callers 1

_wavelet_reconstructFunction · 0.70

Calls 1

_wavelet_blurFunction · 0.70

Tested by

no test coverage detected