Describe the bug
After a successful Qwen3-TTS run followed by Step Audio EditX inline post-processing, a later recreation of the isolated Qwen3-TTS worker can fail before initialization with:
ModuleNotFoundError: No module named 'utils.audio'; 'utils' is not a package
Restarting ComfyUI temporarily fixes it. The failure returns after Step Audio EditX has been loaded and the Qwen worker is subsequently recreated.
This appears to be deterministic sys.path / PYTHONPATH poisoning rather than a CUDA or model problem.
Root cause / confirmed reproduction
engines/step_audio_editx/step_audio_editx_impl/model_loader.py and tokenizer.py insert step_audio_editx_impl at index 0 of the parent process's global sys.path.
- That directory contains a standalone
utils.py.
utils/runtimes/launcher.py::build_env() copies the current parent sys.path, in its existing order, into the child worker's PYTHONPATH.
utils/runtimes/workers/qwen3_tts_worker.py only inserts PROJECT_ROOT when it is absent. If the suite root is already present later in inherited PYTHONPATH, it is not moved to the front.
- The child therefore resolves
utils to step_audio_editx_impl/utils.py instead of the suite's utils/ package. The worker dies while importing utils.runtimes.protocol.
The exact failure can be reproduced without loading either model:
$suite = '<ComfyUI>\custom_nodes\tts_audio_suite'
$impl = "$suite\engines\step_audio_editx\step_audio_editx_impl"
$env:PYTHONPATH = "$impl;$suite"
& "$suite\runtimes\shared_legacy_t4\Scripts\python.exe" `
"$suite\utils\runtimes\workers\qwen3_tts_worker.py"
This produces:
Traceback (most recent call last):
File "...\utils\runtimes\workers\qwen3_tts_worker.py", line 18, in <module>
from utils.runtimes.protocol import RuntimeJobResponse
File "...\engines\step_audio_editx\step_audio_editx_impl\utils.py", line 13, in <module>
from utils.audio.librosa_fallback import safe_trim
ModuleNotFoundError: No module named 'utils.audio'; 'utils' is not a package
Suggested fix
Make worker import precedence deterministic. Possible fixes:
- In
IsolatedRuntimeLauncher.build_env(), prepend runtime_root before inherited sys.path entries, then deduplicate; and/or
- In every worker entrypoint, remove all existing normalized occurrences of
PROJECT_ROOT and unconditionally insert it at index 0 before importing utils.*.
- Longer term, avoid permanently adding
step_audio_editx_impl to the parent process's global sys.path; use package-relative imports or a scoped import strategy.
Simply using a dedicated runtime profile does not prevent this because the poisoned PYTHONPATH is inherited by every profile.
Init log / relevant environment
OS: Microsoft Windows 11 Pro 10.0.26200
ComfyUI type: Easy Install / embedded Python
GPU: NVIDIA GeForce RTX 5090, 32607 MiB
NVIDIA driver: 591.86
RAM: 127.4 GB
Python: 3.12.10 [MSC v.1943 64 bit]
ComfyUI: 0.34.0
TTS Audio Suite: 5.8.5
PyTorch: 2.13.0+cu130
TorchAudio: 2.11.0+cu130
Transformers (main runtime): 5.12.1
NumPy: 1.26.4
Librosa: 0.11.0
Numba: 0.65.0
SoundFile: 0.13.1
CUDA available: True
Torch CUDA: 13.0
Isolated profile involved: vibevoice_transformers4_shared
Provide your ERROR full log
Traceback (most recent call last):
File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\tts_audio_suite\utils\runtimes\workers\qwen3_tts_worker.py", line 18, in <module>
from utils.runtimes.protocol import RuntimeJobResponse
File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\tts_audio_suite\engines\step_audio_editx\step_audio_editx_impl\utils.py", line 13, in <module>
from utils.audio.librosa_fallback import safe_trim
ModuleNotFoundError: No module named 'utils.audio'; 'utils' is not a package
❌ Failed to create engine node instance: Worker closed the response stream unexpectedly
❌ TTS Text generation failed: Failed to create engine node instance
Traceback (most recent call last):
File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\tts_audio_suite\nodes\unified\tts_text_node.py", line 1074, in generate_speech
raise RuntimeError("Failed to create engine node instance")
RuntimeError: Failed to create engine node instance
Steps to reproduce through ComfyUI
- Restart ComfyUI.
- Run Qwen3-TTS with Step Audio EditX inline tags such as
<emotion:happy>.
- Allow runtime isolation to load Step Audio EditX after Qwen generation.
- Run again after Qwen's isolated worker has been shut down and needs recreation.
- Qwen worker intermittently/deterministically exits at its first
utils.runtimes.protocol import, depending on the inherited path state.
Additional context
The downloaded Step-Audio-EditX, tokenizer, CosyVoice, and FunASR model files are complete and pass the suite's model checks. Restarting ComfyUI clears the mutated import state, explaining why the workaround succeeds temporarily.
Describe the bug
After a successful Qwen3-TTS run followed by Step Audio EditX inline post-processing, a later recreation of the isolated Qwen3-TTS worker can fail before initialization with:
ModuleNotFoundError: No module named 'utils.audio'; 'utils' is not a packageRestarting ComfyUI temporarily fixes it. The failure returns after Step Audio EditX has been loaded and the Qwen worker is subsequently recreated.
This appears to be deterministic
sys.path/PYTHONPATHpoisoning rather than a CUDA or model problem.Root cause / confirmed reproduction
engines/step_audio_editx/step_audio_editx_impl/model_loader.pyandtokenizer.pyinsertstep_audio_editx_implat index 0 of the parent process's globalsys.path.utils.py.utils/runtimes/launcher.py::build_env()copies the current parentsys.path, in its existing order, into the child worker'sPYTHONPATH.utils/runtimes/workers/qwen3_tts_worker.pyonly insertsPROJECT_ROOTwhen it is absent. If the suite root is already present later in inheritedPYTHONPATH, it is not moved to the front.utilstostep_audio_editx_impl/utils.pyinstead of the suite'sutils/package. The worker dies while importingutils.runtimes.protocol.The exact failure can be reproduced without loading either model:
This produces:
Suggested fix
Make worker import precedence deterministic. Possible fixes:
IsolatedRuntimeLauncher.build_env(), prependruntime_rootbefore inheritedsys.pathentries, then deduplicate; and/orPROJECT_ROOTand unconditionally insert it at index 0 before importingutils.*.step_audio_editx_implto the parent process's globalsys.path; use package-relative imports or a scoped import strategy.Simply using a dedicated runtime profile does not prevent this because the poisoned
PYTHONPATHis inherited by every profile.Init log / relevant environment
Provide your ERROR full log
Steps to reproduce through ComfyUI
<emotion:happy>.utils.runtimes.protocolimport, depending on the inherited path state.Additional context
The downloaded Step-Audio-EditX, tokenizer, CosyVoice, and FunASR model files are complete and pass the suite's model checks. Restarting ComfyUI clears the mutated import state, explaining why the workaround succeeds temporarily.