Views
No views yet
COMiT-XL from the Hugging Face Hub:1import torch
2from comit import COMiT
3
4device = "cuda" if torch.cuda.is_available() else "cpu"
5model = COMiT.from_pretrained('cvg-unibe/comit-xl')
6model.eval().to(device)1with torch.no_grad():
2 token_dict = model.tokenize(
3 batch,
4 global_crop=False, # Whether to use the global crop as the first observation
5 order="adaptive", # One of ["raster_scan", "random", "adaptive"] or a list of crop indices
6 num_crops=3, # Used to truncate the list of crops to embed
7 )token_ids = model.quantizer.codes_to_indices(token_dict["msgs"])1with torch.no_grad():
2 detoken_dict = model.detokenize(
3 msgs=token_dict["msgs"],
4 offsets=token_dict["offsets"],
5 num_steps=10, # Number of denoising steps
6 odesolver="euler", # The numerical velocity field integration method
7 cfg_weight=7.5, # CFG strength
8 )reconstruct method that pipelines tokenize and detokenize into a single call:1with torch.no_grad():
2 rec_dict = model.reconstruct(
3 batch,
4 global_crop=False,
5 order="adaptive",
6 num_crops=3,
7 num_steps=10,
8 odesolver="euler",
9 cfg_weight=7.5,
10 )1@misc{davtyan2026comit,
2 title={Communication-Inspired Tokenization for Structured Image Representations},
3 author={Aram Davtyan and Yusuf Sahin and Yasaman Haghighi and Sebastian Stapf and Pablo Acuaviva and Alexandre Alahi and Paolo Favaro},
4 year={2026},
5 eprint={2602.20731},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2602.20731},
9}