Skip to main content

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

The size['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
For example, setting visual tokens to 1280 means max_pixels = 1280 × 32 × 32 = 1,310,720

Using qwen-vl-utils

The qwen-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 exact resized_height and resized_width (rounded to nearest multiple of 32):

Method 2: Min/Max Pixels

Define min_pixels and max_pixels to maintain aspect ratio:

Video Resolution Control

Per-Video Configuration

Video Parameters

  • min_pixels: Minimum pixels per frame
  • max_pixels: Maximum pixels per frame
  • total_pixels: Total pixel budget across all frames (recommended < 24576 × 32 × 32)
  • fps: Frame sampling rate (e.g., 2.0 for 2 frames per second)

Frame Sampling with qwen-vl-utils

Frame List as Video

Video File with FPS Control

Important: Avoiding Duplicate Resizing

When using qwen-vl-utils, always set do_resize=False in the processor to avoid duplicate resizing:

Complete Example

Next Steps

Generation Parameters

Configure temperature, top_p, and sampling parameters

Batch Inference

Process multiple requests efficiently