FL FishSpeech VQ Encode
See the audio as numbers instead of sound
- fs_model
- audio
- vq_codes
Most of the pack is about getting speech out. This node is about looking at speech as data. VQ Encode takes any AUDIO and runs it through the same DAC codec the TTS node uses on the way out, producing the discrete vector-quantized codes - the "VQ" in the name - that represent the sound. If you're wondering why you'd ever want that, you're not alone, but it's the same instinct that makes people peek inside a VAE latent: understand the representation, and you can start to manipulate it.
How it works
The node grabs the codec from your loaded fs_model, downmixes the audio to mono, resamples to the codec's 44.1kHz, and calls the codec's encode. What comes back is a tensor of codebook indices - one row per codebook, with the time dimension compressed way down (the code logs the compression ratio, which is a fun little "how much is this really compressing" number). Because the codec pads to frame boundaries, the node trims the output to the real feature length so you're not carrying dead frames around.
Inputs and output
- fs_model (required) - the
FS_MODELoutput from the Model Loader; it carries the codec. - audio (required) - any ComfyUI
AUDIO, same format the other pack nodes use. - Output: vq_codes (type
FS_VQ_CODES) - the encoded representation.
What it wires into
The FS_VQ_CODES type is internal to this pack, so there's no built-in saver or exporter - you work with the codes inside the graph. The one obvious consumer is VQ Decode, which turns them back into audio. That makes a round-trip: encode then decode should get you back to something audibly close to the original, which is a decent sanity check on the whole pipeline. Anything more adventurous - editing codes, mixing representations from two clips - you'd be doing with custom logic between the two nodes, and honestly that's power-user territory.
Installing
It's the pack install, same as everywhere: ComfyUI Manager β search "FL FishSpeech" β install β restart, or git clone https://github.com/filliptm/ComfyUI-FL-FishSpeech.git into custom_nodes/ and pip install -r requirements.txt. And the two setup steps that precede any of it: clone fishaudio/fish-speech to ComfyUI/fish-speech/, and run huggingface-cli login with access accepted for the gated openaudio-s1-mini model on HuggingFace, which downloads on your first Model Loader run.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| fs_model | FS_MODEL | β | |
| audio | AUDIO | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vq_codes | FS_VQ_CODES | β |