video mask: fixes for replacer extension (#509)
parent
85a854b438
commit
ecc6cf7953
|
|
@ -330,8 +330,8 @@ class VersatileAttention(CrossAttention):
|
|||
|
||||
|
||||
def forward(self, x: torch.Tensor):
|
||||
from scripts.animatediff_mm import mm_animatediff
|
||||
video_length = mm_animatediff.ad_params.batch_size
|
||||
from scripts import animatediff_mm
|
||||
video_length = animatediff_mm.mm_animatediff.ad_params.batch_size
|
||||
|
||||
d = x.shape[1]
|
||||
x = rearrange(x, "(b f) d c -> (b d) f c", f=video_length)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class AnimateDiffOutput:
|
|||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
step = params.video_length if params.video_length > params.batch_size else params.batch_size
|
||||
for i in range(res.index_of_first_image, len(res.images), step):
|
||||
if i-res.index_of_first_image >= len(res.all_seeds): break
|
||||
# frame interpolation replaces video_list with interpolated frames
|
||||
# so make a copy instead of a slice (reference), to avoid modifying res
|
||||
frame_list = [image.copy() for image in res.images[i : i + params.video_length]]
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ class AnimateDiffProcess:
|
|||
cn_unit.batch_images = self.video_path
|
||||
|
||||
# mask path broadcast
|
||||
if cn_unit.input_mode.name == 'BATCH' and self.mask_path and not cn_unit.batch_mask_dir:
|
||||
if cn_unit.input_mode.name == 'BATCH' and self.mask_path and not getattr(cn_unit, 'batch_mask_dir', False):
|
||||
cn_unit.batch_mask_dir = self.mask_path
|
||||
|
||||
# find minimun control images in CN batch
|
||||
|
|
|
|||
Loading…
Reference in New Issue