import os import math from dataclasses import dataclass from PIL import Image from modules.logger import log debug = log.trace if os.environ.get('SD_VIDEO_DEBUG', None) is not None else lambda *args, **kwargs: None REFERENCE_FPS = 24.0 # references are resampled onto the model's own frame rate before anything reads them @dataclass(frozen=True) class ReferenceCaps: """Limits a reference workflow enforces, mirrored from the pipeline's own setup step so a bad request is rejected before the model load instead of after it. Frozen because the registry rows these describe are rewritten in place by the loader.""" max_images: int = 9 max_videos: int = 3 max_audios: int = 3 # audio references only: a video's own soundtrack takes an