1
0
mirror of https://github.com/vladmandic/sdnext.git synced 2026-01-27 15:02:48 +03:00
Files
sdnext/modules/video_models/video_cache.py
vladmandic 3a65d561a7 add google-veo-3.1
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-09 19:14:08 +01:00

17 lines
693 B
Python

import diffusers
from modules import shared
def apply_teacache_patch(cls):
if shared.opts.teacache_enabled and cls is not None:
from modules import teacache
shared.log.debug(f'Transformers cache: type=teacache patch=forward cls={cls.__name__}')
if cls.__name__ == 'LTXVideoTransformer3DModel':
cls.forward = teacache.teacache_ltx_forward
elif cls.__name__ == 'MochiTransformer3DModel':
cls.forward = teacache.teacache_mochi_forward
elif cls.__name__ == 'CogVideoXTransformer3DModel':
cls.forward = teacache.teacache_cog_forward
diffusers.FluxTransformer2DModel.forward = teacache.teacache_flux_forward