Repository navigation
feat: add reference-audio voice cloning to KugelAudio - #1275
Merged
0xShug0 merged 1 commit intoNov 13, 2026
Merged
Conversation
Owner
|
@mirek190 Thanks! PR merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds reference-audio voice cloning to the existing KugelAudio family. Previously, raw speaker references were rejected; this enables
--task clon --voice-ref reference.wav, reference conditioning in TTS sessions, and the existing servervoice_reffield.The model-local implementation uses the causal acoustic encoder already present in the original checkpoint. Its mean features feed the existing generator's voice-conditioning path, which applies sampling/scaling once. The generator and shared GGML, CUDA, Vulkan, and server-runtime code are unchanged.
Implementation
--include-reference-encoderto conversion and a helper to augment existing GGUFs without changing their generator tensors. Preset-only conversions retain preset-only embedded capabilities.Validation
Tested on Windows with an RTX 3090 24 GiB, Ryzen 7950X3D, and 8 CPU threads, after updating to upstream
eb8281c9.The short test says “Hello, this is a test of the cloned voice.” Both references are six-second speech clips. Seed 1234, default 20 diffusion steps and guidance 3, Q8_0 generator,
max_tokens=64. Model loading and one preset warmup are excluded. First clone includes reference preparation and generation; cached clone reuses its features.These are short single-case timings, not a throughput comparison. VRAM was sampled every 100 ms and includes a 0.244 GiB baseline. CPU peak RSS was 20.09 GiB, including model storage/mappings.
Independent WavLM speaker similarity, comparing each reference against its clone and the original English male preset:
These scores support the tested references, not universal speaker accuracy. Longer normal/cloned comparison samples were also generated and listened to locally; the final audited implementation reproduces them bit for bit.
Checks passed:
Usage and limits
audiocpp_cli --family kugelaudio --task clon \ --model /path/to/kugelaudio-0-open-q8_0-clone.gguf \ --backend cuda --voice-ref reference.wav \ --text "Hello from the cloned voice." --seed 1234 --out cloned.wavThis remains experimental: the original open processor exposes prepared voice caches, not a supported raw-WAV cloning API. The reference comparison covers its original encoder component, not full PyTorch/native TTS waveform parity. Cross-backend waveforms differ; independent ASR recovered all requested words in five of six short samples, with “clone” versus “cloned” in the remaining CPU sample. Both complete sentences were recovered in all long-form tests. Metal and non-English cloning quality have not been validated.
Existing hosted preset packages still require a separately supplied encoder and the current model-spec override, or local conversion with the encoder included. This PR does not advertise an unpublished hosted package.
Model documentation · Validation report, source pins, build/run commands, and artifact paths
01_reference_video_speaker.mp4
02_cloned_video_voice.mp4