From 46f953ed5bd2b36bae02fe4f82142b5fca0ca4ff Mon Sep 17 00:00:00 2001 From: RevLayDust <225862333+RevLayDust@users.noreply.github.com> Date: Wed, 23 Sep 2026 23:10:13 +0700 Subject: [PATCH] fix(security): resolve CodeQL warnings and refine documentation styling - UVR.py: fix URL regex character range to prevent overly permissive matching - demucs/utils.py: bind free_port socket to localhost (127.0.0.1) using context manager - __version__.py: bump BUILD_ID to RLUV_20260923_2156 - README.md: fix Shields.io release badge URL and clean up heading emojis --- README.md | 46 +++++++++++++++++++++++----------------------- UVR.py | 2 +- __version__.py | 2 +- demucs/utils.py | 8 ++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 0eecd23..3bf35c5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
-# ⚑ RLD UVR-Opt: Ultimate Vocal Remover GUI (Optimized) +# RLD UVR-Opt: Ultimate Vocal Remover GUI (Optimized) -[![Release](https://img.shields.io/github/release/revlaydust/rld-uvr-opt-blue.svg)](https://github.com/revlaydust/rld-uvr-opt/releases/latest) +[![Release](https://img.shields.io/github/v/release/revlaydust/rld-uvr-opt?color=blue)](https://github.com/revlaydust/rld-uvr-opt/releases/latest) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![Python: 3.11+](https://img.shields.io/badge/Python-3.11%2B-3776AB.svg?logo=python&logoColor=white)](https://www.python.org/downloads/latest/python3.11/) [![Platform: Windows](https://img.shields.io/badge/Platform-Windows%2010%2F11%20(64--bit)-informational.svg?logo=windows&logoColor=white)](#-installation--prerequisites) @@ -19,15 +19,15 @@ Focused on accelerated **ONNX Runtime inference**, lower hardware VRAM usage, an />
-## πŸš€ Up to ~4x Faster Inference  |  ~53% Lower VRAM Usage +## Up to ~4x Faster Inference  |  ~53% Lower VRAM Usage -[Prerequisites & Installation](#-installation--prerequisites) $\cdot$ [Usage & Quick Start](#-usage--quick-start) $\cdot$ [Key Features](#-key-features) $\cdot$ [Verified Benchmarks](#-verified-benchmarks) $\cdot$ [Roadmap](#-roadmap) $\cdot$ [Credits](#-credits--acknowledgments) +[Prerequisites & Installation](#installation--prerequisites) $\cdot$ [Usage & Quick Start](#usage--quick-start) $\cdot$ [Key Features](#key-features) $\cdot$ [Verified Benchmarks](#verified-benchmarks) $\cdot$ [Roadmap](#roadmap) $\cdot$ [Credits](#credits--acknowledgments)
--- -## πŸ“¦ Installation & Prerequisites +## Installation & Prerequisites ### 1. System Requirements & Platform Support > [!IMPORTANT] @@ -49,7 +49,7 @@ Focused on accelerated **ONNX Runtime inference**, lower hardware VRAM usage, an --- -### 3. ⚑ One-Click Automated Installation (Windows) +### 3. One-Click Automated Installation (Windows) RLD UVR-Opt provides an automated setup script that handles your entire environment setup from start to finish: @@ -81,12 +81,12 @@ If you installed the **CPU version**, simply launch UVR using `run_uvr.bat`, `py > If you encounter any specific issues, feel free to [open an issue](https://github.com/revlaydust/rld-uvr-opt/issues)! #### What the One-Click Installer automates for you: -* πŸ” **Hardware & Driver Detection**: Automatically identifies your GPU architecture (NVIDIA RTX 20/30/40/50 series) and selects PyTorch CUDA 12.8 or optimized CPU fallback. -* 🐍 **Python Environment Management**: Automatically bootstraps `uv` and provisions an isolated Python 3.11 virtual environment (`venv`). -* πŸ“¦ **Fast Dependency Installation**: Pulls and configures all required packages, including PyTorch and ONNX Runtime GPU/CPU. -* 🧩 **Visual C++ Redistributable Auto-Install**: Checks whether Microsoft Visual C++ 2015–2022 Redistributable (x64) is installed. If missing or outdated, it automatically downloads and silently installs the official runtime to ensure native C-extensions and runtime DLLs load without errors. -* 🎬 **Automated Media Binaries**: Detects existing system installations of **FFmpeg** and **rubberband-cli**. If either is missing, it automatically downloads and extracts portable binaries into the application folderβ€”**zero manual downloading required!** -* πŸ§ͺ **Smoke Test Verification**: Runs an immediate runtime sanity check on tensor operations and ONNX execution providers before launching. +* **Hardware & Driver Detection**: Automatically identifies your GPU architecture (NVIDIA RTX 20/30/40/50 series) and selects PyTorch CUDA 12.8 or optimized CPU fallback. +* **Python Environment Management**: Automatically bootstraps `uv` and provisions an isolated Python 3.11 virtual environment (`venv`). +* **Fast Dependency Installation**: Pulls and configures all required packages, including PyTorch and ONNX Runtime GPU/CPU. +* **Visual C++ Redistributable Auto-Install**: Checks whether Microsoft Visual C++ 2015–2022 Redistributable (x64) is installed. If missing or outdated, it automatically downloads and silently installs the official runtime to ensure native C-extensions and runtime DLLs load without errors. +* **Automated Media Binaries**: Detects existing system installations of **FFmpeg** and **rubberband-cli**. If either is missing, it automatically downloads and extracts portable binaries into the application folderβ€”**zero manual downloading required!** +* **Smoke Test Verification**: Runs an immediate runtime sanity check on tensor operations and ONNX execution providers before launching.
πŸ› οΈ Manual Installation via Astral uv (Click to Expand for Advanced Users) @@ -132,7 +132,7 @@ If you prefer to configure your environment manually instead of running `install
-## πŸš€ Usage / Quick Start +## Usage / Quick Start Get from zero to audio separation in seconds: @@ -162,17 +162,17 @@ uvr_cli run -a "song.wav" -m "UVR-MDX-NET-Inst_HQ_4.onnx" --overlap 0.50 --segme --- -## ✨ Key Features +## Key Features -* **⚑ Accelerated ONNX Inference**: Optimized tensor pipelines and buffer handling reduce unnecessary overhead during chunk processing. -* **πŸ“Ÿ In-Memory FP16 Conversion**: FP16 conversion is performed in memory without requiring persistent `.fp16.onnx` files. -* **🧹 Memory & Session Management**: Improved session and allocation handling helps reduce unnecessary resource usage across runs. -* **⚑ Faster CLI Startup**: Deferred loading of heavy runtime modules reduces startup work before inference is requested. -* **🎯 Benchmark Telemetry**: Built-in measurements and metadata help compare inference performance across controlled test runs. +* **Accelerated ONNX Inference**: Optimized tensor pipelines and buffer handling reduce unnecessary overhead during chunk processing. +* **In-Memory FP16 Conversion**: FP16 conversion is performed in memory without requiring persistent `.fp16.onnx` files. +* **Memory & Session Management**: Improved session and allocation handling helps reduce unnecessary resource usage across runs. +* **Faster CLI Startup**: Deferred loading of heavy runtime modules reduces startup work before inference is requested. +* **Benchmark Telemetry**: Built-in measurements and metadata help compare inference performance across controlled test runs. --- -## πŸ“Š Verified Benchmarks +## Verified Benchmarks All metrics were gathered using the built-in isolated benchmark suite on identical test audio (**48.34s** stereo WAV, model: `UVR-MDX-NET-Inst_HQ_4.onnx`, Ultra Quality FP32). The results below reflect the documented test configuration and are not a universal performance guarantee. @@ -196,7 +196,7 @@ All metrics were gathered using the built-in isolated benchmark suite on identic --- -## 🧭 Roadmap +## Roadmap - [x] Accelerated ONNX inference pipeline and buffer optimizations. - [x] In-memory `FP16` downcasting (e.g., `FP32` $\rightarrow$ `FP16`) and cache lifecycle management. @@ -208,7 +208,7 @@ All metrics were gathered using the built-in isolated benchmark suite on identic --- -## πŸ‘₯ Credits & Acknowledgments +## Credits & Acknowledgments ### RLD UVR-Opt Maintainer * [**RevLayDust**](https://github.com/revlaydust) β€” Core architecture optimizations, ONNX pipeline acceleration, CLI engine, and memory lifecycle management. @@ -230,7 +230,7 @@ All metrics were gathered using the built-in isolated benchmark suite on identic --- -## πŸ“„ License & References +## License & References The **Ultimate Vocal Remover GUI** and **RLD UVR-Opt** codebase is open-source and released under the [**MIT License**](LICENSE). diff --git a/UVR.py b/UVR.py index fb181d9..e1d9171 100644 --- a/UVR.py +++ b/UVR.py @@ -7225,7 +7225,7 @@ def auto_hyperlink(text_widget:tk.Text): content = text_widget.get('1.0', tk.END) # Regular expression to identify URLs - urls = re.findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', content) + urls = re.findall(r'https?://(?:[a-zA-Z0-9_\-@.&+/?=:#~%]|[!*(),]|(?:%[0-9a-fA-F]{2}))+', content) for url in urls: start_idx = content.find(url) diff --git a/__version__.py b/__version__.py index e41bdfa..526791f 100644 --- a/__version__.py +++ b/__version__.py @@ -1,5 +1,5 @@ VERSION = 'v0.1.0-beta.1' -BUILD_ID = 'RLUV_20260920_1653' # represent RLUV_yyyymmdd_HHMM (year, month, day, hour, minute) +BUILD_ID = 'RLUV_20260923_2156' # represent RLUV_yyyymmdd_HHMM (year, month, day, hour, minute) PATCH = BUILD_ID PATCH_MAC = 'Not yet available' PATCH_LINUX = 'Not yet available' diff --git a/demucs/utils.py b/demucs/utils.py index 94bd323..c191180 100644 --- a/demucs/utils.py +++ b/demucs/utils.py @@ -134,22 +134,22 @@ def average_metric(metric, count=1.): return metric[1].item() / metric[0].item() -def free_port(host='', low=20000, high=40000): +def free_port(host='127.0.0.1', low=20000, high=40000): """ Return a port number that is most likely free. This could suffer from a race condition although it should be quite rare. """ - sock = socket.socket() while True: port = random.randint(low, high) try: - sock.bind((host, port)) + with socket.socket() as sock: + sock.bind((host, port)) + return port except OSError as error: if error.errno == errno.EADDRINUSE: continue raise - return port def sizeof_fmt(num, suffix='B'):