Files
SOLRICKS-comfyui-solricks/utils.py
T
2026-04-29 00:31:08 +03:00

12 lines
225 B
Python

# Video TAA + DLAA utilities
# MSXYZ
import torch
LUMA_WEIGHTS = (0.2126, 0.7152, 0.0722)
def rgb_luma(x: torch.Tensor) -> torch.Tensor:
r, g, b = LUMA_WEIGHTS
return r * x[:, 0:1] + g * x[:, 1:2] + b * x[:, 2:3]