audio resample
Change the sample rate, or fake a speed change without it
- audio
- audio
- original_sample
A small, honest utility: it changes an audio clip's sample rate. What makes it worth a second look is the re_sample toggle, because it gives you two genuinely different operations behind one node depending on which way you flip it.
How it works
With re_sample on (the default), this does what "resample" normally means: it recalculates the waveform for the new sample rate while keeping the actual playback speed and pitch the same. That's the operation you want before feeding audio into a model or node that expects a specific rate - Wan-adjacent audio nodes, for instance, often expect a particular sample rate and will complain or behave oddly if you hand them something else.
With re_sample off, the node does something different and, per its own description, deliberately so: it doesn't resample the underlying samples, it just relabels the rate. The practical effect is a speed change - the clip plays faster or slower - but because the actual frequency content didn't change with it, the pitch shifts too, the way a vinyl record sounds different sped up. It's a cheap, artifact-prone way to nudge duration if pitch shift is acceptable for your use case; it is not proper time-stretching.
The inputs and outputs that matter
audio(required, AUDIO) - the clip to process.sample(default 24000, range 1–4,096,000) - the target sample rate. 24000 (24kHz) is a common speech-model rate, which lines up with this pack's audio nodes leaning toward voice/Wan workflows rather than music production.re_sample(default true, BOOLEAN) - true for a proper resample (same speed, same pitch, new rate); false for the relabel trick (changes speed, changes pitch, keeps the raw samples).
Two outputs: audio (the processed clip) and original_sample (INT) - the rate the clip had before this node touched it. That second output is handy if you need to reverse the operation later, or just want to log/display what the source rate actually was without a separate inspection node.
Installing it
Via ComfyUI Manager: search ComfyUI-WJNodes, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
cd ComfyUI-WJNodes
pip install -r requirements.txt
Resampling is a standard operation most audio libraries already bundle, so this node doesn't pull in anything exotic beyond the pack's normal Python dependencies.
Common issues & troubleshooting
Audio sounds pitch-shifted or "chipmunked" after this node. You almost certainly left re_sample off. That's not a bug - it's the documented behavior of that toggle - but it's an easy thing to leave unset by accident if you copied a workflow from someone using it for the speed-change trick on purpose. Flip it to true if you actually wanted a clean rate conversion.
Downstream node rejects the audio or sounds wrong regardless. Confirm the sample value actually matches what the next node expects - a lot of audio-conditioned model nodes are picky about exact sample rate and won't auto-adjust for you. Use original_sample to sanity-check what you started from if the output seems off.
Extreme values at the edges of the range. The node accepts sample rates up to 4,096,000 Hz, which is far beyond anything meaningful for audio playback - that ceiling exists for headroom in the field, not because you should use it. Stick to realistic rates (16000–48000 for most speech/video use) unless you have a specific reason not to.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| sample | INT | 240001–4096000 | — |
| re_sample | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| original_sample | INT | — |