Overview
Qwen3-VL provides multiple ways to control the resolution of images and videos, allowing you to balance quality and computational efficiency.Official Processor Control
Image Processor Configuration
Thesize['longest_edge'] parameter corresponds to max_pixels, and size['shortest_edge'] corresponds to min_pixels.
Video Processor Configuration
For videos, the parameters control total pixels across all frames.Compression Ratios for Qwen3-VL:
- Images: 32× spatial compression
- Videos: 32× spatial + 2× temporal compression
max_pixels = 1280 × 32 × 32 = 1,310,720Using qwen-vl-utils
Theqwen-vl-utils library provides per-input resolution control.
Installation
Basic Setup for Qwen3-VL
For Qwen3-VL, set
image_patch_size=16 and return_video_metadata=True when using process_vision_info.Image Resolution Control
Method 1: Exact Dimensions
Specify exactresized_height and resized_width (rounded to nearest multiple of 32):
Method 2: Min/Max Pixels
Definemin_pixels and max_pixels to maintain aspect ratio:
Video Resolution Control
Per-Video Configuration
Video Parameters
min_pixels: Minimum pixels per framemax_pixels: Maximum pixels per frametotal_pixels: Total pixel budget across all frames (recommended < 24576 × 32 × 32)fps: Frame sampling rate (e.g.,2.0for 2 frames per second)
Frame Sampling with qwen-vl-utils
Frame List as Video
Video File with FPS Control
Important: Avoiding Duplicate Resizing
Complete Example
Next Steps
Generation Parameters
Configure temperature, top_p, and sampling parameters
Batch Inference
Process multiple requests efficiently