feat: 优化无GPU模式浏览器启动参数提升性能

This commit is contained in:
foxhui
2025-11-26 23:24:29 +08:00
Unverified
parent 413bfd1ba4
commit 0925efd369
2 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -459,12 +459,12 @@ chrome:
1. **启动虚拟显示器并运行程序** (屏幕号 99 可按需修改):
```bash
xvfb-run --server-num=99 --server-args="-ac -screen 0 1280x720x16" npm start
xvfb-run --server-num=99 --server-args="-ac -screen 0 1280x720x24" npm start
```
2. **将虚拟显示器映射至 VNC**:
```bash
x11vnc -display :99 -localhost -nopw -once -noxdamage -ncache 10
x11vnc -display :99 -localhost -nopw -once -noxdamage -ncache 10 -forever
```
3. **建立 SSH 隧道连接 VNC** (安全推荐):
+6 -3
View File
@@ -228,9 +228,12 @@ async function initBrowser(config) {
args.push(
'--disable-gpu',
'--use-gl=swiftshader',
'--disable-accelerated-2d-canvas'
'--disable-accelerated-2d-canvas',
'--animation-duration-scale=0',
'--disable-smooth-scrolling',
'--animation-duration-scale=0'
);
console.log('>>> [Browser] GPU 加速: 禁用 (优化兼容性)');
console.log('>>> [Browser] GPU 加速: 禁用');
} else {
console.log('>>> [Browser] GPU 加速: 启用');
}
@@ -436,7 +439,7 @@ async function generateImage(context, prompt, imgPaths, modelId) {
return;
}
} catch (e) {
console.error('[CDP] 拦截处理出错:', e);
console.error('>>> [CDP] 拦截处理出错:', e);
}
}