Skip to content

Commit ca5cfbd

Browse files
committed
update
1 parent 5ac65c4 commit ca5cfbd

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/diffusers/pipelines/ltx/pipeline_ltx.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,10 @@ def do_classifier_free_guidance(self):
489489
def num_timesteps(self):
490490
return self._num_timesteps
491491

492+
@property
493+
def current_timestep(self):
494+
return self._current_timestep
495+
492496
@property
493497
def attention_kwargs(self):
494498
return self._attention_kwargs
@@ -622,6 +626,7 @@ def __call__(
622626
self._guidance_scale = guidance_scale
623627
self._attention_kwargs = attention_kwargs
624628
self._interrupt = False
629+
self._current_timestep = None
625630

626631
# 2. Define call parameters
627632
if prompt is not None and isinstance(prompt, str):
@@ -706,6 +711,8 @@ def __call__(
706711
if self.interrupt:
707712
continue
708713

714+
self._current_timestep = t
715+
709716
latent_model_input = torch.cat([latents] * 2) if self.do_classifier_free_guidance else latents
710717
latent_model_input = latent_model_input.to(prompt_embeds.dtype)
711718

src/diffusers/pipelines/ltx/pipeline_ltx_condition.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,10 @@ def do_classifier_free_guidance(self):
774774
def num_timesteps(self):
775775
return self._num_timesteps
776776

777+
@property
778+
def current_timestep(self):
779+
return self._current_timestep
780+
777781
@property
778782
def attention_kwargs(self):
779783
return self._attention_kwargs
@@ -933,6 +937,7 @@ def __call__(
933937
self._guidance_scale = guidance_scale
934938
self._attention_kwargs = attention_kwargs
935939
self._interrupt = False
940+
self._current_timestep = None
936941

937942
# 2. Define call parameters
938943
if prompt is not None and isinstance(prompt, str):
@@ -1066,6 +1071,8 @@ def __call__(
10661071
if self.interrupt:
10671072
continue
10681073

1074+
self._current_timestep = t
1075+
10691076
if image_cond_noise_scale > 0:
10701077
# Add timestep-dependent noise to the hard-conditioning latents
10711078
# This helps with motion continuity, especially when conditioned on a single frame

src/diffusers/pipelines/ltx/pipeline_ltx_image2video.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ def do_classifier_free_guidance(self):
550550
def num_timesteps(self):
551551
return self._num_timesteps
552552

553+
@property
554+
def current_timestep(self):
555+
return self._current_timestep
556+
553557
@property
554558
def attention_kwargs(self):
555559
return self._attention_kwargs
@@ -686,6 +690,7 @@ def __call__(
686690
self._guidance_scale = guidance_scale
687691
self._attention_kwargs = attention_kwargs
688692
self._interrupt = False
693+
self._current_timestep = None
689694

690695
# 2. Define call parameters
691696
if prompt is not None and isinstance(prompt, str):
@@ -778,6 +783,8 @@ def __call__(
778783
if self.interrupt:
779784
continue
780785

786+
self._current_timestep = t
787+
781788
latent_model_input = torch.cat([latents] * 2) if self.do_classifier_free_guidance else latents
782789
latent_model_input = latent_model_input.to(prompt_embeds.dtype)
783790

0 commit comments

Comments
 (0)