Buckets:
| from typing import Sequence | |
| from PIL import Image | |
| class ReferenceConditioner: | |
| """ | |
| Handles reference images for image/reference-to-video generation. | |
| """ | |
| def __init__(self, device="cuda"): | |
| self.device = device | |
| def preprocess( | |
| self, | |
| images: Sequence[Image.Image], | |
| ): | |
| if not images: | |
| raise ValueError("At least one reference image is required.") | |
| processed = [] | |
| for image in images: | |
| image = image.convert("RGB") | |
| processed.append(image) | |
| return processed | |
| def encode(self, images): | |
| """ | |
| TODO: | |
| Connect to the actual image/reference encoder. | |
| """ | |
| return images |
Xet Storage Details
- Size:
- 716 Bytes
- Xet hash:
- 83fd9b482ca675bd088687952075c7120f35809eec03a6254a3f268694f8dffc
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.