This is CustomTkinter GUI for FlashSR.
If you find this repository helpful, please consider citing it.
@article{im2025flashsr,
title={FlashSR: One-step Versatile Audio Super-resolution via Diffusion Distillation},
author={Im, Jaekwon and Nam, Juhan},
journal={arXiv preprint arXiv:2501.10807},
year={2025}
}One or batch Processing audio, selection of 48k/44k sample rate, settings for Overlap selection, Lowpass input, Force Sample rate for audio.
Simple Log for debuging and processing.
git clone github.com/Lefox-DeMod/FlashSR_Inference_GUI
cd FlashSR_Inference
python -m venv venv
source venv/bin/activate
if using Windows CMD:
source venv\Scripts\activate.bat
If need use CPU installation only:
pip install -r requirements_cpu.txt
If GPU avalaible:
pip install -r requirements.txt
Unix-like
TORCH_JAEKWON_PATH='./TorchJaekwon' pip install -e ./
Windows:
TORCH_JAEKWON_PATH='.TorchJaekwon' pip install -e .
Put downloaded model in ./ModelWeights folder.
Run GUI:
python simple_gui.py
It will run on CUDA, or CPU if using manual install.
After installation, you can import the module from anywhere
from FlashSR.FlashSR import FlashSR
student_ldm_ckpt_path:str = './ModelWeights/student_ldm.pth'
sr_vocoder_ckpt_path:str = './ModelWeights/sr_vocoder.pth'
vae_ckpt_path:str = './ModelWeights/vae.pth'
flashsr = FlashSR( student_ldm_ckpt_path, sr_vocoder_ckpt_path, vae_ckpt_path)Read the low-resolution audio
audio_path:str = './Assets/ExampleInput/music.wav'
# resample audio to 48kHz
# audio.shape = [channel_size, time] ex) [2, 245760]
audio, sr = UtilAudio.read(audio_path, sample_rate = 48000)
# currently, the model only supports 245760 samples (5.12 seconds of audio)
audio = UtilData.fix_length(audio, 245760)
audio = audio.to(device)Restore high-frequency components by FlashSR
# lowpass_input: if True, apply lowpass filter to input audio before super resolution. This can help reduce discrepancy between training data and inference data.
pred_hr_audio = flashsr(audio, lowpass_input = False)
UtilAudio.write('./output.wav', pred_hr_audio, 48000)

