MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / get_cfg_scale_list

Function get_cfg_scale_list

trainer/scheduler.py:143–150  ·  view source on GitHub ↗
(cfg_scale,
                       enable_cfg_interval,
                       timesteps: torch.Tensor,
                       t_scale: int = 1000)

Source from the content-addressed store, hash-verified

141
142# https://arxiv.org/pdf/2404.07724 Applying Guidance in a Limited Interval Improves Sample and Distribution Quality in Diffusion Models
143def get_cfg_scale_list(cfg_scale,
144 enable_cfg_interval,
145 timesteps: torch.Tensor,
146 t_scale: int = 1000):
147 use_cfg = (timesteps / t_scale) < enable_cfg_interval
148 cfg_list = torch.ones_like(timesteps)
149 cfg_list[use_cfg] = cfg_scale
150 return cfg_list
151
152
153class FlowMatchScheduler():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected