An ONNX conversion of the offline model from inworld/voice-isolator by Inworld AI, released under Apache-2.0. All credit for the model goes to Inworld. This repository only changes the format.
Try it in the browser: mrfakename/voice-isolator-webgpu
spec: float32 [1, frames, 1025, 2]. This is the real/imag STFT of 48 kHz mono audio with n_fft=2048, hop=480, a periodic Hann window and center=True (reflect padding), i.e. torch.view_as_real(torch.stft(...)).permute(0, 2, 1, 3).correction: float32 [1, frames, 1025, 2], a complex correction spectrum. Voice is audio + istft(correction, length=len(audio)), using the same window and hop, and the removed background is audio - voice.frames is dynamic. The model was trained on 8 s windows (801 frames). For longer audio, run 8 s windows with 2 s linear crossfades, as VoiceIsolatorNetwork.enhance in inworld-voice-isolation does. The reference JavaScript implementation is vi.js in the Space above.The graph is opset 17 and fp32. The Mamba selective scans are exported as an exact blocked scan rather than one long per-frame loop. Each scan is split into chunks of 64 frames. The chunks are scanned in parallel from a zero state, a short recurrence across chunks then supplies each chunk's true start state, and a final parallel pass emits the outputs. The math matches the original recurrence, with only float rounding differences.
For WebGPU compatibility, Concat nodes have at most 6 inputs and sequence flips are written as Gather with computed indices instead of negative-step Slice, Softplus is written as relu(x) + log(1 + exp(-|x|)), and float ConstantOfShape is written as Expand, so every heavy op has a WebGPU kernel in onnxruntime-web. On CPU the outputs match the plain export to about 128 dB SNR.
Converted from inworld-voice-isolation==1.0.0.
inworld/voice-isolator