bark generate coarse (2)
Where the voice gets its shape
- coarse_model
- semantic_tokens
- semantic_history
- coarse_history
- codebooks
Stage two. You've got semantic tokens - the words, decided. bark_generate_coarse ("bark generate coarse (2)") turns those into the first two EnCodec codebooks, which are the rough sonic skeleton: the pitch contour, the rhythm, the way the voice sounds. If semantic tokens are the script, coarse codebooks are the first draft of the performance. Still not listenable on their own, but now it's clearly audio-shaped.
How it works
The coarse model is another GPT-style transformer, but it predicts a flattened stream of tokens across two EnCodec codebooks at a coarser time resolution (75 Hz vs the semantic stage's ~50 Hz). It also gets a windowed treatment: rather than attending to the whole sequence forever, it slides through the semantic tokens in chunks (sliding_window_len) while keeping a bounded history (max_coarse_history) of what came before. That's the mechanism behind the two weirdly-named knobs below.
The inputs that matter
Required:
- coarse_model - from
bark_loaderwith thecoarsedropdown set tolarge/small. - semantic_tokens - the output of
bark_generate_semantic. - temperature (0.7), top_k / top_p (0 = off) - same sampling controls as the semantic stage; defaults are fine 90% of the time.
- max_coarse_history (default 630) - how many past coarse tokens the model is allowed to look at. Bigger = more coherent but slower; the cap exists because the coarse stage can't attend to a full 1024-token window.
- sliding_window_len (default 60) - how many tokens it generates per window pass. Tune down on low VRAM to shrink the working set.
- use_kv_caching - same speed-vs-VRAM tradeoff as the semantic node.
Optional, and this is the voice-cloning hook:
- semantic_history and coarse_history - the
textandcoarseoutputs ofload_speaker_npz. Feed both (they're a pair - the node uses them together to establish a speaker's prosody) and the generated audio continues in that voice instead of defaulting to one of Bark's stock voices.
The output, codebooks, is a 2-row EnCodec codebook array. It feeds bark_generate_fine. If you want to hear what the coarse stage alone sounds like, wire it into encodec_decode - it'll be a muffled, buzzy approximation. That's not a bug; that's the point.
Install & troubleshooting
Same pack, same two-line install (ComfyUI Manager, search "Audio nodes", or git clone https://github.com/gitmylo/ComfyUI-audio-nodes into custom_nodes and restart). First run downloads the coarse weights to models/bark/.
The failure mode people actually hit: you provide only coarse_history without semantic_history (or vice versa) and the model just ignores your speaker entirely, because the code only uses the history when both are supplied. It won't error - it'll silently give you a default voice. If your cloned voice isn't sticking, check that both history inputs are connected. The other common one is VRAM: this stage is where long prompts start to choke, and dropping sliding_window_len or enabling kv caching is the lever that keeps a long generation alive on an 8GB card.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| coarse_model | BarkCoarseModel | β | |
| semantic_tokens | BarkSemanticTokens | β | |
| temperature | FLOAT | 0.700.01β2 | β |
| top_k | INT | 00β10000 | β |
| top_p | FLOAT | 0.000β1 | β |
| max_coarse_history | INT | 63060β630 | β |
| sliding_window_len | INT | 601β512 | β |
| use_kv_caching | BOOLEAN | β | |
| semantic_historyopt | BarkSemanticTokens | β | |
| coarse_historyopt | EncodecCodeBooks | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| codebooks | EncodecCodeBooks | β |