scheduler.py 599 Bytes
Newer Older
1
from lightx2v.models.schedulers.wan.scheduler import WanScheduler
helloyongyang's avatar
helloyongyang committed
2
3


4
class WanSchedulerCaching(WanScheduler):
helloyongyang's avatar
helloyongyang committed
5
6
    def __init__(self, config):
        super().__init__(config)
7
8

    def clear(self):
9
10
11
        self.transformer_infer.clear()


12
class WanSchedulerTaylorCaching(WanSchedulerCaching):
13
14
15
16
17
18
    def __init__(self, config):
        super().__init__(config)

        pattern = [True, False, False, False]
        self.caching_records = (pattern * ((config.infer_steps + 3) // 4))[: config.infer_steps]
        self.caching_records_2 = (pattern * ((config.infer_steps + 3) // 4))[: config.infer_steps]