fix: add missing deviceEnvInfo for video generation payload

The Grok API requires deviceEnvInfo field to correctly parse resolutionName.
Without this field, the backend ignores resolution settings and generates
low-resolution videos regardless of the requested quality.

Added deviceEnvInfo with standard 1920x1080 viewport settings to ensure
720p and other resolution settings are properly respected by the API.

Tested: 720p videos now correctly generate at 720x1280 resolution.
This commit is contained in:
double2tea committed 2026-02-08 03:46:45 +08:00
1 parent 01dcea9b7c
commit 69dbcac74a
1 file changed
+8
+8
View File
@@ -158,6 +158,14 @@ class VideoService:
"message": f"{prompt} {mode_flag}",
"toolOverrides": {"videoGen": True},
"enableSideBySide": True,
"deviceEnvInfo": {
"darkModeEnabled": False,
"devicePixelRatio": 2,
"screenWidth": 1920,
"screenHeight": 1080,
"viewportWidth": 1920,
"viewportHeight": 1080,
},
"responseMetadata": {
"experiments": [],
"modelConfigOverride": {