Open-AutoGLM icon indicating copy to clipboard operation
Open-AutoGLM copied to clipboard

输入图片大小限制

Open KAIWEILIUCC opened this issue 8 months ago • 9 comments

输入指令"打开美团搜索附近的火锅店",产生如下报错

Error code: 400 - {'errors': {'message': 'input size exceed limit 2048x2048,current input:(1080,2376)', 'request_id': '576dcaf1-9f02-456c-a506-1cb0510c35f9'}}

之前似乎没有出现过图片超出限制的错误提示,请问如何处理?

KAIWEILIUCC avatar Mar 16 '26 07:03 KAIWEILIUCC

同问 openai.BadRequestError: Error code: 400 - {'error': {'message': 'input size exceed limit 2048x2048,current input:(1080,2340)', 'request_id': '5e38c48a-2f4b-4e91-a92f-68ed529e438e'}}

Hardcandies avatar Mar 16 '26 07:03 Hardcandies

同问,也出现这样的错误

MisteryLiuCode avatar Mar 22 '26 01:03 MisteryLiuCode

同样的问题,图片分辨率过大。Result: Model error: Error code: 400 - {'error': {'message': 'input size exceed limit 2048x2048,current input:(1216,2688)', 'request_id': '3e5df556-235c-4f22-84b2-0276a6eeea25'}} 这种关键问题都没人处理了吗?

figoliu avatar Mar 26 '26 05:03 figoliu

用智谱的接口,别用modelscope的

Damonzhl avatar Mar 26 '26 06:03 Damonzhl

之前用modelscope模型遇到过,可以通过adb命令,修改被使用手机的分辨率解决。

shineforreal avatar Mar 27 '26 02:03 shineforreal

同问

TynnPassBy avatar Mar 27 '26 09:03 TynnPassBy

同样:raise self._make_status_error_from_response(err.response) from None openai.BadRequestError: Error code: 400 - {'error': {'message': 'input size exceed limit 2048x2048,current input:(1240,2772)', 'request_id': 'ff20986b-c494-4676-b4fa-397c5855a7d3'}}

qqxwz114514 avatar Mar 30 '26 07:03 qqxwz114514

同问

DreamstarDS avatar Apr 01 '26 12:04 DreamstarDS

2个解决方案:

  1. 方案一:

在运行 main.py 之前,先执行这一行 ADB 命令:adb shell wm size 1080x1920

方案1,如果报错,直接用方案二

  1. 方案二: 修改phone_agent\adb\screenshot.py 这个文件,

在 # Read and encode image img = Image.open(temp_path) width, height = img.size 这段代码下方,加上自动压缩分辨率功能,

====================== 自动压缩到 2048x2048 解决报错 ======================

max_size = 2048 if width > max_size or height > max_size: scale = min(max_size / width, max_size / height) new_width = int(width * scale) new_height = int(height * scale) img = img.resize((new_width, new_height), Image.Resampling.LANCZOS) width, height = new_width, new_height

==========================================================================

hmyjyghh avatar Apr 14 '26 03:04 hmyjyghh