feat(webui): add preset save & apply for reusable configs#346
feat(webui): add preset save & apply for reusable configs#346redXpanda wants to merge 2 commits into
Conversation
Add a lightweight preset system to the VoxCPM WebUI, mirroring the IndexTTS workflow: save the current reference audio + all generation parameters as a named preset and reload it later. - presets.py: file-based preset store (presets/<name>/preset.json + copied reference audio), with name sanitization and path resolution - app.py: inline preset UI (name + save / dropdown + apply/delete/refresh) under the reference audio, plus i18n keys (en + zh-CN) - .gitignore: ignore presets/ (user data)
Preset save/apply/delete toasts were hardcoded in Chinese, mismatching the gr.I18n-driven UI. gr.Info/gr.Warning reject I18nData (LogMessage requires a plain str), so resolve the language from the request's Accept-Language header and look the message up in a runtime dict instead.
|
Nice work on this — the preset system is clean and well-documented, and I really like that the save inputs / apply outputs share a single source-of-truth ordering so they can't drift apart. I pulled it down and gave it a read + a quick functional roundtrip; everything lines up nicely. 🙌 One small suggestion: would you consider adding a unit test for The repo already has a A few high-value cases worth locking down:
Using I'd skip testing the Totally non-blocking from my side — just thought it'd be a nice fit given the existing test conventions. Thanks for the contribution! |
Summary
Add a lightweight preset system to the VoxCPM WebUI, mirroring the IndexTTS workflow: save the current reference audio + all generation parameters as a named preset and reload it later. Also localizes preset toast messages so they match the
gr.I18n-driven UI.What's included
presets.py— file-based preset store (presets/<name>/preset.json+ copied reference audio), with name sanitization and path resolution.app.py— inline preset UI (name + save / dropdown + apply / delete / refresh) under the reference audio, plus i18n keys (en + zh-CN)..gitignore— ignorepresets/(user data).Notes
gr.Info/gr.WarningrejectI18nData(they require a plainstr), the language is resolved from the request'sAccept-Languageheader and the message is looked up in a runtime dict.Test plan
presets/<name>/preset.json+ the copied reference audio are created.