1ripon1's picture
Upload folder using huggingface_hub
7344bef verified
Raw
History Blame Contribute Delete
736 Bytes
from typing import Protocol
from ..tools import LatentTools
from ..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.
"""
...