Skip to content

[Bug] extra_model_paths TTS entry replaces local ComfyUI models path instead of adding to it #367

Description

@haroonaslam

Describe the bug
When extra_model_paths.yaml defines a TTS directory, TTS Audio Suite treats that configured directory as the only TTS model search root. It stops searching the normal local <ComfyUI>/models/TTS directory.

In this setup, existing models were already correctly installed under:

D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\models\TTS\...

The extra paths configuration points shared models to:

E:\models\TTS\...

After enabling that configuration, TTS Audio Suite could no longer find the models on D:. The models had to be copied to E: before the nodes worked.

This differs from normal ComfyUI extra-path behavior and from the behavior described in #63, where model discovery was intended to search all configured paths (shared + local). E: should remain the preferred download path because it is marked is_default: true, but D:\...\ComfyUI\models\TTS should remain a valid discovery fallback.

Relevant extra_model_paths.yaml configuration

comfyui:
    base_path: E:\
    is_default: true
    TTS: models\TTS\

Confirmed output
With ComfyUI's extra_model_paths.yaml loaded before importing the suite path manager:

Configured TTS roots:
 - E:\models\TTS

Preferred Step root:
 E:\models\TTS\step_audio_editx

The expected configured search roots are approximately:

E:\models\TTS
D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\models\TTS

with E: first/preferred for downloads.

Root cause
The behavior comes from utils/models/extra_paths.py:

  1. TtsExtraPathsManager._load_tts_paths() sees the TTS category already registered by ComfyUI from extra_model_paths.yaml and stores only that registered list.
  2. _setup_default_tts_paths() adds <folder_paths.models_dir>/TTS only when TTS is absent from self.tts_folders:
if folder_type not in self.tts_folders:
    folder_paths.add_model_folder_path(folder_type, config['paths'][0])
    self.tts_folders[folder_type] = config['paths']
  1. Because TTS already exists, the normal local suite directory is never registered or appended.
  2. get_all_tts_model_paths() therefore returns only the YAML path, despite its docstring saying the result includes both the default ComfyUI models folder and configured extra paths.

This affects find_model_in_paths() and all engines that rely on this shared path manager.

Steps to reproduce

  1. Install a TTS model under <ComfyUI>/models/TTS/<engine>/<model>.
  2. Configure an additional TTS path in extra_model_paths.yaml, pointing somewhere else, and mark it is_default: true.
  3. Do not duplicate the existing model into the extra path.
  4. Restart ComfyUI.
  5. Run a TTS Audio Suite node that uses find_model_in_paths().
  6. The suite searches only the additional path, reports the model missing, or triggers a download there. It does not discover the existing local model.

Suggested fix
Always merge the local suite path into the TTS discovery list when it is absent, even if TTS was previously registered from YAML. Preserve ComfyUI's configured/default ordering so the YAML path remains the download target.

For example, conceptually:

local_tts_path = os.path.join(folder_paths.models_dir, "TTS")
registered_paths = list(self.tts_folders.get("TTS", []))

if norm(local_tts_path) not in {norm(path) for path in registered_paths}:
    folder_paths.add_model_folder_path("TTS", local_tts_path, is_default=False)
    registered_paths.append(local_tts_path)

self.tts_folders["TTS"] = registered_paths

It may be safer to refresh the list from folder_paths.folder_names_and_paths['TTS'][0] after registration so ordering stays consistent with ComfyUI.

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: 5.12.1
CUDA available: True
Torch CUDA: 13.0
Local ComfyUI root: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI
Configured shared model root: E:\models

Provide your ERROR full log
Example observed with Step Audio EditX before copying the model to E::

Loading Step Audio EditX engine...
Failed: Model not found: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\models\TTS\step_audio_editx\Step-Audio-EditX

The model-discovery probe confirmed that the path manager exposed only E:\models\TTS; therefore any valid TTS models remaining under the normal D:\...\ComfyUI\models\TTS tree were invisible to the suite.

Additional context
Related historical issue: #63 implemented extra_model_paths.yaml support and stated that discovery should search all configured paths (shared + local). The current conditional setup prevents that fallback specifically when the custom TTS category is created by YAML before TTS Audio Suite initializes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions