RFWave EnCodec 24 kHz
EnCodec-conditioned waveform reconstruction model from the RFWave family. Given the
discrete codes produced by Meta's encodec_24khz model, it reconstructs a 24 kHz mono
waveform with a rectified-flow backbone and an STFT output head.
⚠️ Code compatibility — read this first
These weights must be used together with the RFWave code at commit
28698f06b188e49bd2e112f8e9e67e777292a323(2024-11-01, "sample steps according to straightness"). The module layout and state-dict keys correspond to that revision; other revisions may fail to load withstrict=True, or may silently mismatch.git clone https://github.com/bfs18/rfwave.git cd rfwave && git checkout 28698f06b188e49bd2e112f8e9e67e777292a323
config.yamlin this repo is the config from that revision.
This is the 24 kHz EnCodec variant from the rfwave-dev-infill-stft-true experiment
(weights exported 2024-06-02). Its mel-conditioned counterpart is
laupeng1989/rfwave-libritts-24k.
Files
| File | Description |
|---|---|
last.ckpt | Original export — a plain dict {"state_dict": ...}, 356 fp32 tensors, ~44.3 M parameters. Load with torch.load (no Lightning wrapper, no optimizer state) |
model.safetensors | The same tensors converted losslessly to safetensors (bit-identical, `max |
config.yaml | Full experiment config (data module, backbone, feature extractor, head) |
Use last.ckpt if your code path expects the original file
(torch.load(path)["state_dict"]); use model.safetensors if you prefer a pickle-free
format.
Architecture
From config.yaml:
- Experiment:
rfwave.experiment_reflow_subband.VocosEncodecExp - Backbone:
VocosRFBackbone—dim=512,intermediate_dim=1536,num_layers=8,num_bands=8,input_channels=128,output_channels=192, Fourier features withpe_scale=1000 - Conditioning:
EncodecFeatures—encodec_model=encodec_24khz, bandwidths[1.5, 3.0, 6.0, 12.0],encodec_num_embeddings=4, EnCodec codebooks frozen (train_codebooks=false) - Head:
RFSTFTHead—n_fft=1280,hop_length=320,padding=same - Sampling rate: 24 000 Hz, mono
- Training: rectified flow,
p_uncond=0.1, inference guidance2.0
Training data: 24 kHz LibriTTS audio.
Usage
import torch
ckpt = torch.load("last.ckpt", map_location="cpu", weights_only=True)
state_dict = ckpt["state_dict"] # 356 tensors
# instantiate rfwave.experiment_reflow_subband.VocosEncodecExp from config.yaml (commit
# 28698f0), then:
# model.load_state_dict(state_dict, strict=True)
Or with safetensors:
from safetensors.torch import load_file
state_dict = load_file("model.safetensors")
Evaluation data
The companion evaluation set is
laupeng1989/audio-reconstruct-universal-testset-v2
(900 clips, 24 kHz mono, 1.82 h).
License
BSD, matching the RFWave project.