| 85 | |
| 86 | class LTXVGemmaTextEncoderModel(torch.nn.Module): |
| 87 | def __init__( |
| 88 | self, |
| 89 | model: Gemma3ForConditionalGeneration, |
| 90 | feature_extractor, # FeatureExtractorV1/V2 |
| 91 | embeddings_processor, # VideoEmbeddingsProcessor or AVEmbeddingsProcessor |
| 92 | processor: Gemma3Processor | None = None, |
| 93 | dtype=torch.bfloat16, |
| 94 | device="cpu", |
| 95 | ): |
| 96 | super().__init__() |
| 97 | self.model = model |
| 98 | self.processor = processor |
| 99 | self.feature_extractor = feature_extractor.to(dtype=dtype) |
| 100 | self.embeddings_processor = embeddings_processor.to(dtype=dtype) |
| 101 | self.dtypes = set([dtype]) |
| 102 | # Cache an estimate of memory required to load/keep the model on device |
| 103 | # weights size + small overhead |
| 104 | self._model_memory_required = ( |
| 105 | comfy.model_management.module_size(self.model) + 256 * 1024 * 1024 |
| 106 | ) |
| 107 | |
| 108 | def set_clip_options(self, options): |
| 109 | pass |