Nodes/Audio nodes/HuBERT vectorize audio
ComfyUI Node

HuBERT vectorize audio

The middle step of voice cloning

By gitmyloΒ·Created 2 years agoΒ·Updated about a year agoΒ· 12
HuBERT vectorize audio
  • hubert_model
  • audio
  • vectors
β—„hubert_layer9β–Ί

If load_bark_hubert is the ear, bark_hubert_encode is the part that actually listens. It takes an audio clip and runs it through the HuBERT model to produce a sequence of 768-dimensional feature vectors - one per chunk of speech - which are the raw material for Bark's semantic tokens. This is where your reference voice stops being a waveform and becomes a representation Bark can work with.

How it works

Your AUDIO input gets resampled to HuBERT's native 16 kHz mono and fed through hubert-base-ls960 with all its hidden states exposed. The node then picks one of those hidden layers - controlled by hubert_layer - and returns it as the vector sequence. Why layers matter: different hidden layers of HuBERT capture different kinds of information (roughly, early layers = acoustic detail, later layers = more abstract/linguistic). The default is layer 9, and that's not arbitrary - the pack README is explicit that the main voice quantizer model was trained on layer 9's output. If you use a different layer, the quantizer will be working with vectors it wasn't trained on, which usually means worse cloning.

Inputs & outputs

  • hubert_model - from load_bark_hubert.
  • audio - the reference clip, as ComfyUI's AUDIO type (from a ComfyUI audio node or Video Helper Suite's splitter).
  • hubert_layer - 0–12, default 9. Change it only if you know what you're doing or you're experimenting with a custom quantizer trained on a different layer.

The output, vectors (HuBERTVectors), feeds straight into bark_hubert_quantize, which converts the vectors into actual Bark semantic tokens.

Install & where it fits

Pack install, standard:

cd ComfyUI/custom_nodes
git clone https://github.com/gitmylo/ComfyUI-audio-nodes

(or ComfyUI Manager β†’ "Audio nodes"), restart. First run downloads HuBERT weights to the HF cache.

Full cloning chain for context: load_bark_hubert β†’ this node β†’ bark_hubert_quantize β†’ save_speaker_npz (semantic prompt), alongside encodec_encode/bark_encodec_coarseify for the coarse/fine prompts. The node runs the model on CPU (the loader hardcodes that), so vectorization is quick but not GPU-accelerated - a 10-second clip takes a few seconds. The honest caveat: HuBERT vectors are a bridge, not a guarantee. They capture how a voice sounds in HuBERT's learned space, and the quantizer maps that into Bark's vocabulary as best it can. Expect "same character," not "same person," and spend your effort on the reference clip - clean, single-speaker, no background noise - because that's the variable this whole chain can't fix for you.

CategoryπŸ”‰ AudioNodes/bark/cloning

Inputs (3)

NameTypeDefaultDescription
hubert_modelBarkHuBERTModelβ€”
audioAUDIOβ€”
hubert_layerINT90–12β€”

Outputs (1)

NameTypeDescription
vectorsHuBERTVectorsβ€”