Audio Style Transfer
Put the texture of one sound onto another
- content_latent
- style_latent
- latent
Style transfer is the classic latent-space party trick: keep the content of one thing, steal the texture of another. Audio Style Transfer does exactly that for sound - the melody and rhythm of your content track, the timbre and character of your style track, blended in latent space before anything is decoded. It's the node that makes "my melody, but as if that other song produced it" a single-node operation.
How it works
Both inputs are LATENTs (encode real files with AudioVAEEncode or use generation output). The node aligns their lengths - crop_to_shortest by default, pad_to_longest, or none if you're feeling risky - then does the style math in one of five transfer_modes:
global- classic statistics matching: normalize the content latent by its own mean/std, rescale it to the style latent's mean/std. The image-style-transfer standby, applied to audio.frequency_bands- does the same trick in FFT space, band by band (how many is up tofrequency_bands, default 4), so high-frequency "air" can be transferred independently of the low end.temporal_segments- matches statistics per time segment rather than globally.adaptive- correlation-based reshaping; the default, and the one that keeps things sounding most like the content.neural_style- the deeper feature-matching variant.
style_strength (0–1, default 0.7) is how much style to transfer, and preserve_content (default 0.3) is how much of the original to keep. Together they're your wet/dry mix - and yes, they can both be high; the final blend is roughly stylized * style_strength + content * preserve_content.
The inputs that matter
content_latent- what stays (structure, melody, rhythm).style_latent- what leaks in (timbre, texture, vibe).transfer_mode-adaptiveto start,frequency_bandswhen you want surgical control of the high end.style_strength/preserve_content- the wet/dry pair.frequency_bands- only relevant in band mode.
Output is a single latent, ready for AudioVAEDecode.
Installing it
From the DavidPiazza/network_bending pack, via ComfyUI Manager ("Network Bending") or:
cd ComfyUI/custom_nodes
git clone https://github.com/DavidPiazza/network_bending.git
Restart ComfyUI, and make sure torchaudio + librosa are present (requirements-audio.txt); the audio nodes hide themselves if they're missing.
Common issues
Length mismatch is the big one - crop_to_shortest protects you, but if you set time_alignment to none with wildly different lengths, the FFT-based modes get weird in the best and worst ways. And because transfer happens before decode, a style_strength of 1.0 can come out of the decoder sounding overcooked; 0.7 is a sane default for a reason. This is one of the better-implemented nodes in the pack - all five modes actually run, which, given how some of its siblings ship, is worth appreciating.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| content_latent | LATENT | Content audio latent | |
| style_latent | LATENT | Style audio latent | |
| transfer_mode | COMBO | adaptive | Style transfer mode |
| style_strength | FLOAT | 0.700–1 | How much style to transfer |
| preserve_contentopt | FLOAT | 0.300–1 | How much original content to preserve |
| frequency_bandsopt | INT | 42–16 | Number of frequency bands for band-wise transfer |
| time_alignmentopt | COMBO | crop_to_shortest | Make content/style latents the same temporal length |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |