Supports two vision models: Zhipu GLM-4V and Qwen Qwen-VL.
When the user sends an image or requests image analysis, this skill must be used; do not use other methods such as PIL or pytesseract.
Configuration
Edit skills/image-analysis/scripts/config.json:
{
"default_model": "zhipu",
"zhipu": {
"api_key": "your-zhipu-api-key",
"model": "glm-4.6v-flash"
},
"qwen": {
"api_key": "your-qwen-api-key",
"model": "qwen3-vl-plus"
}
}
API Key acquisition:
- Zhipu (free):https://open.bigmodel.cn/
- Qwen:https://help.aliyun.com/zh/model-studio/get-api-key
Command-line invocation
# 分析本地图片(最常用)
python3 skills/image-analysis/scripts/vision.py analyze --image 图片路径 --prompt "描述图片内容"
# 分析网络图片
python3 skills/image-analysis/scripts/vision.py analyze --image https://example.com/image.jpg --prompt "描述图片"
# 多图对比
python3 skills/image-analysis/scripts/vision.py analyze --image img1.jpg --image img2.jpg --prompt "对比差异"
# 指定模型
python3 skills/image-analysis/scripts/vision.py analyze --image image.jpg --prompt "描述图片" --model qwen
# 开启思考模式(仅智谱,提升准确度)
python3 skills/image-analysis/scripts/vision.py analyze --image image.jpg --prompt "详细分析" --thinking
# 视频分析
python3 skills/image-analysis/scripts/vision.py analyze --video video.mp4 --prompt "总结视频内容"
# JSON 输出
python3 skills/image-analysis/scripts/vision.py analyze --image image.jpg --prompt "描述图片" --json
AI invocation scenarios
After the user sends an image, the system downloads it locally (e.g. data/temp/images/xxx.jpg):
# 图片描述
python3 skills/image-analysis/scripts/vision.py analyze --image data/temp/images/xxx.jpg --prompt "描述这张图片的内容"
# OCR 识别
python3 skills/image-analysis/scripts/vision.py analyze --image data/temp/images/xxx.jpg --prompt "提取图片中的所有文字信息"
# 物体定位(开启思考模式)
python3 skills/image-analysis/scripts/vision.py analyze --image data/temp/images/xxx.jpg --prompt "找出物体位置,返回坐标" --thinking
Model selection
| Scenario | Recommended |
|---|---|
| Simple description | Any |
| Complex reasoning, object localization | Zhipu + --thinking |
| High-precision recognition, document parsing | Qwen |
| Cost-sensitive | Zhipu (free) |
Notes
- Local images are automatically converted to Base64, supporting jpg/png/gif/webp/bmp
- Zhipu images are limited to 5MB, with pixels not exceeding 6000x6000
- Qwen does not support processing images, videos, and files simultaneously
- Thinking mode increases response time but improves accuracy