Views
No views yet
clip_l: [batch, 77, 768] → text_encoder outputclip_g: [batch, 77, 1280] → text_encoder_2 output1from geovocab2.train.model.vae.vae_lyra import MultiModalVAE, MultiModalVAEConfig
2from huggingface_hub import hf_hub_download
3import torch
4
5# Download model
6model_path = hf_hub_download(
7 repo_id="AbstractPhil/vae-lyra-sdxl-t5xl",
8 filename="model.pt"
9)
10
11# Load checkpoint
12checkpoint = torch.load(model_path)
13
14# Create model
15config = MultiModalVAEConfig(
16 modality_dims={"clip_l": 768, "clip_g": 1280, "t5_xl": 2048},
17 latent_dim=2048,
18 fusion_strategy="cantor"
19)
20
21model = MultiModalVAE(config)
22model.load_state_dict(checkpoint['model_state_dict'])
23model.eval()
24
25# Use model - train on all three
26inputs = {
27 "clip_l": clip_l_embeddings, # [batch, 77, 768]
28 "clip_g": clip_g_embeddings, # [batch, 77, 1280]
29 "t5_xl": t5_xl_embeddings # [batch, 77, 2048]
30}
31
32# For SDXL inference - only decode CLIP outputs
33recons, mu, logvar = model(inputs, target_modalities=["clip_l", "clip_g"])
34
35# Use recons["clip_l"] and recons["clip_g"] with SDXL1@software{vae_lyra_sdxl_2025,
2 author = {AbstractPhil},
3 title = {VAE Lyra SDXL: Multi-Modal Variational Autoencoder},
4 year = {2025},
5 url = {https://huggingface.co/AbstractPhil/vae-lyra-sdxl-t5xl}
6}