| 1 | from typing import Protocol |
| 2 | |
| 3 | from ltx_core.tools import LatentTools |
| 4 | from ltx_core.types import LatentState |
| 5 | |
| 6 | |
| 7 | class ConditioningItem(Protocol): |
| 8 | """Protocol for conditioning items that modify latent state during diffusion.""" |
| 9 | |
| 10 | def apply_to(self, latent_state: LatentState, latent_tools: LatentTools) -> LatentState: |
| 11 | """ |
| 12 | Apply the conditioning to the latent state. |
| 13 | Args: |
| 14 | latent_state: The latent state to apply the conditioning to. This is state always patchified. |
| 15 | Returns: |
| 16 | The latent state after the conditioning has been applied. |
| 17 | IMPORTANT: If the conditioning needs to add extra tokens to the latent, it should add them to the end of the |
| 18 | latent. |
| 19 | """ |
| 20 | ... |
| 21 |