Downloads · 30 days
113
15% of all-time downloads
wangkanai/qwen3-vl-4b-instruct
qwen3-vl-4b-instruct is a image-text-to-text model from wangkanai. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Qwen3-VL-4B-Instruct is a powerful vision-language model with 4 billion parameters, developed by Qwen team at Alibaba Cloud. This model represents the latest generation in the Qwen series, offering superior text under…
Downloads · 30 days
113
15% of all-time downloads
All-time downloads
775
Public
Repo size
16.9 GB
Likes
2
Public
Click a slice to open those files.
.safetensors8.9 GB · 52%
From the Hugging Face model README
Qwen3-VL-4B-Instruct is a powerful vision-language model with 4 billion parameters, developed by Qwen team at Alibaba Cloud. This model represents the latest generation in the Qwen series, offering superior text understanding, deeper visual perception, extended context length, and enhanced spatial and video comprehension capabilities.
Qwen3-VL-4B-Instruct is a multimodal large language model that seamlessly integrates visual and textual understanding. Key capabilities include:
This repository contains model files in both SafeTensors and GGUF formats:
| File | Size | Format | Description |
|---|---|---|---|
qwen3-vl-4b-instruct-abliterated.safetensors | ~8GB | SafeTensors | Main model weights (abliterated version) |
qwen3-vl-4b-instruct-abliterated-f16.gguf | ~8GB | GGUF FP16 | Quantized format for efficient inference |
Total Repository Size: ~16GB
Note: Model files are currently being downloaded. File sizes are estimates based on the 4B parameter count.
flash_attention_2 for better acceleration and memory efficiencyfrom transformers import Qwen3VLForConditionalGeneration, AutoProcessor
from PIL import Image
# Load model and processor
model = Qwen3VLForConditionalGeneration.from_pretrained(
"E:/huggingface/qwen3-vl-4b-instruct",
torch_dtype="auto",
device_map="auto",
attn_implementation="flash_attention_2"
)
processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-4B-Instruct")
# Prepare image and text input
image = Image.open("path/to/your/image.jpg")
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Describe this image in detail."}
]
}
]
# Process and generate
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[image], return_tensors="pt").to(model.device)
# Generate response
outputs = model.generate(
**inputs,
max_new_tokens=512,
top_p=0.8,
temperature=0.7
)
response = processor.batch_decode(outputs, skip_special_tokens=True)[0]
print(response)
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
import cv2
# Load model
model = Qwen3VLForConditionalGeneration.from_pretrained(
"E:/huggingface/qwen3-vl-4b-instruct",
torch_dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-4B-Instruct")
# Extract video frames
def extract_frames(video_path, num_frames=8):
cap = cv2.VideoCapture(video_path)
frames = []
frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
indices = [int(i * frame_count / num_frames) for i in range(num_frames)]
for idx in indices:
cap.set(cv2.CAP_PROP_POS_FRAMES, idx)
ret, frame = cap.read()
if ret:
frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
cap.release()
return frames
# Process video
frames = extract_frames("path/to/video.mp4")
messages = [
{
"role": "user",
"content": [
{"type": "video", "video": frames},
{"type": "text", "text": "What happens in this video? Provide timestamps."}
]
}
]
# Generate analysis
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], videos=[frames], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024)
print(processor.decode(outputs[0], skip_special_tokens=True))
from transformers import Qwen3VLForConditionalGeneration, AutoProcessor
from PIL import ImageGrab
# Load model
model = Qwen3VLForConditionalGeneration.from_pretrained(
"E:/huggingface/qwen3-vl-4b-instruct",
torch_dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-4B-Instruct")
# Capture screenshot
screenshot = ImageGrab.grab()
# Analyze UI
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": screenshot},
{"type": "text", "text": "Identify all clickable elements and their functions."}
]
}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[screenshot], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(outputs[0], skip_special_tokens=True))
32 languages including English, Chinese, Japanese, Korean, Arabic, French, German, Spanish, and more.
Enable Flash Attention 2: Significantly improves memory efficiency and speed
attn_implementation="flash_attention_2"
Batch Processing: Process multiple images/videos in batches when possible
inputs = processor(text=texts, images=images, return_tensors="pt", padding=True)
Quantization: Use GGUF format for reduced memory footprint
Context Management: For long contexts, use sliding window or chunking strategies
Generation Parameters:
top_p=0.8, temperature=0.7top_p=0.9, temperature=0.3top_p=0.95, temperature=0.9device_map="auto" for automatic multi-GPU distributiontorch.cuda.empty_cache()This model is licensed under Apache License 2.0.
Key Points:
Full license text: https://www.apache.org/licenses/LICENSE-2.0
If you use Qwen3-VL-4B-Instruct in your research or applications, please cite:
@article{qwen3vl2025,
title={Qwen3-VL: The Next Generation Vision-Language Model},
author={Qwen Team},
journal={arXiv preprint},
year={2025},
organization={Alibaba Cloud}
}
For issues, questions, or contributions:
Release Date: October 15, 2025 Model Version: Qwen3-VL-4B-Instruct (Abliterated) Last Updated: November 5, 2025