del get_timesteps func

This commit is contained in:
u 2024-08-29 21:07:51 +08:00
parent 40c8dc4899
commit c4bc81d120

View File

@ -23,20 +23,6 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(
logger = logging.getLogger(__name__)
def get_timesteps(
cogvideo_pipeline: CogVideoXPipeline,
num_inference_steps, strength, device):
# get the original timestep using init_timestep
init_timestep = min(int(num_inference_steps * strength), num_inference_steps)
t_start = max(num_inference_steps - init_timestep, 0)
timesteps = cogvideo_pipeline.scheduler.timesteps[t_start * cogvideo_pipeline.scheduler.order :]
if hasattr(cogvideo_pipeline.scheduler, "set_begin_index"):
cogvideo_pipeline.scheduler.set_begin_index(t_start * cogvideo_pipeline.scheduler.order)
return timesteps.to(device), num_inference_steps - t_start
def _prepare_rotary_positional_embeddings(
cogvideo_pipeline: CogVideoXPipeline,
height: int,