Phase 6: Replace REST polling with @gradio/client for generation and LoRA

- Add @gradio/client dependency for direct Gradio API communication
- Create gradio-client.ts: singleton client with lazy init and reconnection
- Rewrite acestep.ts: generation via /generation_wrapper (45 params), Python spawn fallback
- Remove REST polling code (submitToApi, pollApiResult, downloadAudioFromApi)
- Create lora.ts routes: load/unload/scale/toggle/status via Gradio events
- Register /api/lora routes in index.ts
This commit is contained in:
fspecii
2026-02-08 19:39:24 +02:00
parent 193cf707cd
commit f42fde9b40
6 changed files with 494 additions and 468 deletions
+19
View File
@@ -8,6 +8,7 @@
"name": "ace-step-ui-server",
"version": "1.0.0",
"dependencies": {
"@gradio/client": "^2.0.4",
"@types/multer": "^2.0.0",
"better-sqlite3": "^11.0.0",
"cors": "^2.8.5",
@@ -472,6 +473,18 @@
"node": ">=18"
}
},
"node_modules/@gradio/client": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@gradio/client/-/client-2.0.4.tgz",
"integrity": "sha512-pYywxUpamTYQLca01YAlTBwr2eb3H8d9s7geeQdexuPkM7p+EN2LhyzgNRN4yZrpn4swwfwP1fOoadKgd1b6Ww==",
"license": "ISC",
"dependencies": {
"fetch-event-stream": "^0.1.5"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@types/better-sqlite3": {
"version": "7.6.13",
"resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.13.tgz",
@@ -1160,6 +1173,12 @@
"url": "https://opencollective.com/express"
}
},
"node_modules/fetch-event-stream": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/fetch-event-stream/-/fetch-event-stream-0.1.6.tgz",
"integrity": "sha512-GREtJ5HNikdU2AXtZ6E/5bk+aslMU6ie5mPG6H9nvsdDkkHQ6m5lHwmmmDTOBexok9hApQ7EprsXCdmz9ZC68w==",
"license": "MIT"
},
"node_modules/file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",