Preprocesses masks for use with the LTXVideo model's latent masking. This node handles temporal mask processing by: 1. Validating mask dimensions against VAE downscaling factors 2. Optionally inverting masks 3. Handling the first frame mask separately (can be ignored) 4. Co
| 9 | |
| 10 | @comfy_node(name="LTXVPreprocessMasks") |
| 11 | class LTXVPreprocessMasks: |
| 12 | """ |
| 13 | Preprocesses masks for use with the LTXVideo model's latent masking. |
| 14 | |
| 15 | This node handles temporal mask processing by: |
| 16 | 1. Validating mask dimensions against VAE downscaling factors |
| 17 | 2. Optionally inverting masks |
| 18 | 3. Handling the first frame mask separately (can be ignored) |
| 19 | 4. Combining temporal masks using max pooling |
| 20 | 5. Growing/shrinking masks with morphological operations |
| 21 | 6. Clamping mask values to ensure proper opacity |
| 22 | |
| 23 | The output is a set of masks ready for latent-space masking operations. |
| 24 | """ |
| 25 | |
| 26 | @classmethod |
| 27 | def INPUT_TYPES(cls: "LTXVPreprocessMasks") -> dict[str, Any]: # noqa: N802 |
| 28 | return { |
| 29 | "required": { |
| 30 | "masks": ("MASK",), |
| 31 | "vae": ("VAE",), |
| 32 | "invert_input_masks": ( |
| 33 | "BOOLEAN", |
| 34 | { |
| 35 | "default": False, |
| 36 | "tooltip": "Invert the input masks before processing." |
| 37 | "Useful for masking vs unmasking operations.", |
| 38 | }, |
| 39 | ), |
| 40 | "ignore_first_mask": ( |
| 41 | "BOOLEAN", |
| 42 | { |
| 43 | "default": True, |
| 44 | "tooltip": "Zero out the first mask, typically used when" |
| 45 | "it corresponds to the conditioning frame.", |
| 46 | }, |
| 47 | ), |
| 48 | "pooling_method": ( |
| 49 | ["max", "mean", "min"], |
| 50 | { |
| 51 | "default": "max", |
| 52 | "tooltip": "Method to combine temporal masks. Max preserves strongest values, " |
| 53 | "mean averages them, min takes weakest values.", |
| 54 | }, |
| 55 | ), |
| 56 | "grow_mask": ( |
| 57 | "INT", |
| 58 | { |
| 59 | "default": 0, |
| 60 | "min": -16384, |
| 61 | "max": 16384, |
| 62 | "step": 1, |
| 63 | "tooltip": "Pixels to grow (positive) or shrink (negative) the mask." |
| 64 | "Uses morphological operations.", |
| 65 | }, |
| 66 | ), |
| 67 | "tapered_corners": ( |
| 68 | "BOOLEAN", |
nothing calls this directly
no outgoing calls
no test coverage detected