File size: 750 Bytes
08c5e28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from typing import Protocol

from ltx_core.tools import LatentTools
from ltx_core.types import LatentState


class ConditioningItem(Protocol):
    """Protocol for conditioning items that modify latent state during diffusion."""

    def apply_to(self, latent_state: LatentState, latent_tools: LatentTools) -> LatentState:
        """
        Apply the conditioning to the latent state.
        Args:
            latent_state: The latent state to apply the conditioning to. This is state always patchified.
        Returns:
            The latent state after the conditioning has been applied.
        IMPORTANT: If the conditioning needs to add extra tokens to the latent, it should add them to the end of the
        latent.
        """
        ...