8000 feat(voice): read aloud with StyleTTS2 on this machine, as an opt-in service by adeelahmad · Pull Request #291 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(voice): read aloud with StyleTTS2 on this machine, as an opt-in service - #291

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-cy94he
Oct 10, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-cy94he

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: spoken answers and podcasts needed a cloud provider, an OpenAI-compatible server you ran yourself, or a Mac.

After: StyleTTS2 is a text-to-speech choice in Settings → AI assistant → Voice. It runs on your own machine as the optional styletts2 Compose service (docker compose --profile styletts2 up -d), off by default because it is heavy (PyTorch, ~1 GB model fetched on first use). Its voices are clips: drop a few seconds of someone speaking into the styletts2-voices volume (e.g. grandpa.wav) and it appears in the voice picker; default is a public-domain LibriVox reader.

How: styletts2/ is a small stdlib HTTP server around the MIT styletts2 package that speaks the OpenAI audio API (POST /v1/audio/speech, GET /v1/audio/voices, GET /health). Lens's speech.speak() and voices() call it at voice.styletts2_url (default http://styletts2:8880); when it isn't running, answers fall back to the browser and the picker says how to start it. A new StyleTTS2 workflow builds the image and reads a sentence aloud on every change to styletts2/.

Tested for real on CPU (outside Docker, same server and pins): the first request fetched the model and answered in 49 s, later sentences in ~5 s, a clip-cloned voice worked, an unknown voice gave 404.

Motivation and Context

Adeel asked for StyleTTS2 alongside ElevenLabs, macOS say and Gemini (#268).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: GET /voice/voices and POST /voice/speak cover it.
  • Zero setup: n/a for now, the service starts with a Compose profile (starting it from Settings is in the DEVLOG refine-later list).
  • Fewest clicks and keystrokes.
  • Configurable: voice.styletts2_url in Settings with a default.
  • Light: off by default; the default install is unchanged.
  • Private and secure: runs locally on the Compose network, no published port; threat model updated.
  • Cost: local, nothing billed; calls go through the activity ledger.
  • User decides: defaults unchanged.
  • Upgrades: new setting has a default; no stored-data change.
  • Honest: docs note the model authors' ask to disclose synthesized speech.
  • Tests, docs and generated files updated.
  • Open standards; dependencies keep Lens MIT (StyleTTS2 code and package are MIT, in a separate image).
  • Result reported with evidence; "refine later" items written down.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WkPdbtd7zvYMRWaRkLN2F6


Generated by Claude Code

…service

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPdbtd7zvYMRWaRkLN2F6
@adeelahmad adeelahmad self-assigned this Oct 10, 2026
@adeelahmad
adeelahmad merged commit 4a902a7 into main Oct 10, 2026
16 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-cy94he branch October 10, 2026 20:45
@adeelahmad adeelahmad mentioned this pull request Oct 10, 2026
Merged
17 of 19 tasks
adeelahmad added a commit that referenced this pull request Oct 10, 2026
…308)

#296, #291, #285 and #294 merged after the README refresh, so they move from
"In progress" to the feature list, and the web clipper guide's status names
Edge as built.


Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS

Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0