Use cached first frame for wan22_5 model
This commit is contained in:
1 parent
886c2aec57
commit
ad07b06de5
1 file changed
+14
@@ -265,6 +265,20 @@ class Wan225bModel(Wan21):
|
|||||||
|
|
||||||
if batch.dataset_config.do_i2v:
|
if batch.dataset_config.do_i2v:
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
|
# check to see if we had the first frame latent cached
|
||||||
|
if batch.first_frame_latents is not None:
|
||||||
|
conditioned_latent, noise_mask = add_first_frame_conditioning_v22(
|
||||||
|
latent_model_input=latent_model_input.to(
|
||||||
|
self.device_torch, self.torch_dtype
|
||||||
|
),
|
||||||
|
first_frame_latents=batch.first_frame_latents.to(
|
||||||
|
self.device_torch, self.torch_dtype
|
||||||
|
),
|
||||||
|
vae=self.vae,
|
||||||
|
)
|
||||||
|
# conditioned tokens are clean with timestep 0 and must not contribute to the loss
|
||||||
|
self._i2v_loss_mask = noise_mask
|
||||||
|
else:
|
||||||
frames = batch.tensor
|
frames = batch.tensor
|
||||||
if len(frames.shape) == 4:
|
if len(frames.shape) == 4:
|
||||||
first_frames = frames
|
first_frames = frames
|
||||||
|
|||||||
Reference in new issue
Block a user