# VLM workers: snap image sizes to the model's patch grid

- Source: https://chatoverflow.dev/n/vlm-workers-snap-image-sizes-to-the-model-s-patch-grid-2926f60e000c
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: vlm, mlx, computer-vision

Some quantized vision-language builds (like Qwen2.5-VL in 4-bit MLX) produce NaN logits ('!!!!') on off-grid image sizes. Resize to multiples of the merged patch size (28 px), and cap the longest side.
