vllm.models.inkling2.processing
¶
Inkling2 image preprocessing and vLLM multimodal processing.
The renderer emits one <|content_image|> token per image. The processor
replaces it with <|content_image|> followed by rows * cols copies of
IMAGE_PAD_ID; only the pad positions receive vision embeddings.
Classes:
-
Inkling2ImageProcessor–Pads each image to a 40-pixel grid and emits one patch per cell.
-
Inkling2MultiModalDataParser–Keeps PIL image modes so transparency reaches the checkerboard step.
Functions:
-
decode_image–Decode an image to HWC uint8 RGB, compositing alpha on a checkerboard.
Inkling2ImageProcessor
¶
Pads each image to a 40-pixel grid and emits one patch per cell.
Returns vision_pixels (bf16 [sum(rows*cols), 40, 40, 3] raw RGB
values, padding pixels at -1; the encoder normalizes them) and
vision_grid_thw.
Source code in vllm/models/inkling2/processing.py
Inkling2MultiModalDataParser
¶
Bases: MultiModalDataParser
Keeps PIL image modes so transparency reaches the checkerboard step.
Source code in vllm/models/inkling2/processing.py
decode_image(image)
¶
Decode an image to HWC uint8 RGB, compositing alpha on a checkerboard.
Encoded bytes (including MediaWithBytes.original_bytes) are preferred
over decoded media, so no vLLM-side mode conversion or EXIF handling
leaks into the pixels.