(
cls,
positive,
negative,
vae,
latent,
image,
frame_idx,
strength,
latent_downscale_factor,
crop,
use_tiled_encode,
tile_size,
tile_overlap,
attention_strength=1.0,
attention_mask=None,
)
| 346 | |
| 347 | @classmethod |
| 348 | def execute( |
| 349 | cls, |
| 350 | positive, |
| 351 | negative, |
| 352 | vae, |
| 353 | latent, |
| 354 | image, |
| 355 | frame_idx, |
| 356 | strength, |
| 357 | latent_downscale_factor, |
| 358 | crop, |
| 359 | use_tiled_encode, |
| 360 | tile_size, |
| 361 | tile_overlap, |
| 362 | attention_strength=1.0, |
| 363 | attention_mask=None, |
| 364 | ) -> io.NodeOutput: |
| 365 | from .iclora_attention import normalize_mask |
| 366 | from .latents import LTXVDilateLatent |
| 367 | |
| 368 | scale_factors = vae.downscale_index_formula |
| 369 | latent_image = latent["samples"] |
| 370 | noise_mask = nodes_lt.get_noise_mask(latent) |
| 371 | |
| 372 | _, _, latent_length, latent_height, latent_width = latent_image.shape |
| 373 | |
| 374 | time_scale_factor = scale_factors[0] |
| 375 | num_frames_to_keep = ( |
| 376 | (image.shape[0] - 1) // time_scale_factor |
| 377 | ) * time_scale_factor + 1 |
| 378 | causal_fix = frame_idx == 0 or num_frames_to_keep == 1 |
| 379 | if not causal_fix: |
| 380 | image = torch.cat([image[:1], image], dim=0) |
| 381 | |
| 382 | image, guide_latent = cls.encode( |
| 383 | vae, |
| 384 | latent_width, |
| 385 | latent_height, |
| 386 | image, |
| 387 | scale_factors, |
| 388 | latent_downscale_factor, |
| 389 | crop, |
| 390 | use_tiled_encode, |
| 391 | tile_size, |
| 392 | tile_overlap, |
| 393 | ) |
| 394 | |
| 395 | if not causal_fix: |
| 396 | guide_latent = guide_latent[:, :, 1:, :, :] |
| 397 | image = image[1:] |
| 398 | |
| 399 | guide_orig_shape = list(guide_latent.shape[2:]) |
| 400 | guide_mask = None |
| 401 | |
| 402 | if latent_downscale_factor > 1: |
| 403 | if ( |
| 404 | latent_width % latent_downscale_factor != 0 |
| 405 | or latent_height % latent_downscale_factor != 0 |
nothing calls this directly
no test coverage detected