    ComfyUI
 


          ComfyUI:      (TTS)         ,  ,     .    ,    ,       .      ( , ?),   ,      .      ,   ,    FAQ    .





 

    ComfyUI





.   ComfyUI:     AI


 : ComfyUI            ()   ,    (workflow).

 :

:      ;

:     ;

  :     Python;

   :     .

:

  Python ? (React);

 CUDA/ROCm  GPU?;

    (Python?).

2.  ComfyUI    

 :

  TTS?,   ;

    (NLP?);

   (, ).

 :

  GPU/CPU   ;

  ;

   (int8, fp16).

  :

      ( ComfyUI Manager);

    TTS/voice cloning;

  .

3.  :   TTS    

   (TTS):

   Tacotron2, FastSpeech2;

      ;

   WAV/MP3.

  (Voice Cloning):

   YourTTS, VITS;

    (510  );

     .

 :

  ();

  (, , );

    ;

   (, ).

   AI?:

   LLM (,  API ChatGPT);

    (   FFmpeg);

   (, , ).

4.    ComfyUI     

 :

: Windows 10/11, Linux, macOS (Apple Silicon);

GPU: NVIDIA ()  AMD   ROCm;

:  8 (  ), 16 ;

  : 15( ).

 :

1. ComfyUI Desktop (  ):

    ;

 .exe/.dmg,  ;

      .

2.    Python:

 Python 3.10 Git;

 :

```

git clone https://github.com/comfyanonymous/ComfyUI

```

 :

```

pip install -r requirements.txt

```

:

```

python main.py

```

 :

 ComfyUI (    );

  GPU (    Using CUDA);

  :

   `http://127.0.0.1:8188`;

  Manager ? Install Custom Nodes;

      (, `comfyui-audio`).

 :

 TTS? (,  Hugging Face);

   `ComfyUI/models/tts`;

 ComfyUI  .

 :

    (: `tts_basic.json`);

  Text Input ? TTS Model ? Vocoder ? Audio Output;

 Queue Prompt     .

:    :

 ComfyUI    Manager;

   Python (venv/conda);

   SSD   .




1.      


1.1.   ()   

 ()  ComfyUI    ,        (workflow).             .

  :

       (, TextInput, TTSModel).

 ()        .

 ()    ,  .

 ( )    (,  ,  ).

    ( :   ,    ,   ).

   :

   , , .

    (,    ).

     ().

  workflow:

1.    .

2.        ( ).

3.    .

4.    QueuePrompt.

1.2.     

        .

1. TextInput

:     .

: .

:   ( STRING).

:        .

2. TTSModel

:    ?.

:  (STRING)  TextInput.

: ? (SPECTROGRAM).

:

  (Tacotron2, FastSpeech2  .);

  (speed);

 (pitch).

3. Vocoder

:    .

:  (SPECTROGRAM)  TTSModel.

:  (AUDIO).

:

  (WaveNet, MelGAN);

  (samplerate).

4. AudioOutput

:    .

:  (AUDIO)  Vocoder.

:    (PATH).

:

 (WAV, MP3);

  .

5. AudioEffect

:   (, ).

:  (AUDIO).

:   (AUDIO).

:

  (reverb, eq, compression);

.

6. VoiceCloner

:     .

:

 (STRING);

  (AUDIO).

:   (AUDIO)   .

:

 (YourTTS, VITS);

   (stylestrength).

1.3.     

 workflow:

1.   File  Save  SaveAs.

2.     JSON (, `tts_workflow.json`).

3.   :

   ;

  ;

 .

   :

:    (,  TTS)  .

:  JSON?        ComfyUI  Load.

 :

  JSON?       (Git).

      .

  workflow:

1.  JSON?.

2.  ComfyUI  Load   .

3. :

    (      );

   .

:

  (NoteNode)    workflow.

     ( Ctrl+G).

 workflow  (    Right?click?Execute).




2.    


2.1.   

      (   )      .

 :

WAV ( )   ;

FLAC (  )    ;

MP3/OGG (  )    ? .

 :

 :

젖16 ( );

44,1  48 ( );

  頖96 (, ?   ).

 : 16 ()  24 (  ).

 :  (1)   (  ).

 :

 TTS30;

  ࠖ30 5   .

 :

 ?18 ?12;

  ?6 (  ).

 :

   ( <?40);

     蠖100200;

     ;

     .

2.2.    

          .

1.    

:

`sox` ( `silence`);

 Python: `pydub`, `librosa`.

:

  ?40;

  300.

2.  

:    ?14LUFS (  ).

:

  (peak normalization);

RMS? (  ).

:

`ffmpeg` (`-af loudnorm`);

`pysox` (Python).

3.  

:

  (spectral subtraction);

?;

 (, `noisereduce`).

:

 2020;

 1020.

4. 

  :

  14 ( );

  80 ( ).

:

`sox` (`equalizer`);

`scipy.signal` (Python).

5. 

     (, 48).

:

  (,   );

Sinc? (, ).

:

`ffmpeg` (`-ar 48000`);

`librosa.resample()`.

6.    

:

 ;

   .

:

`audacity` ( );

  `numpy`.

2.3.     

  :

      .

 :

젖250 ( );

1050.

      .

 :

 ;

 ( 30%   );

 (510%).

 :

   ;

   ;

    .

    :

    (   ).

    (, ? vs ?)   `+`.

   (,    21).

 :

1. :

򠖠WAV, 48, 16, ;

 ⠖  (, `sample_001.wav`).

2.  :

򠖠TSV  CSV;

:

`file_name` ( );

`text` ( ).

ࠖUTF?8  BOM.

 TSV?:

```

file_name text

sample_001     .

sample_002     !

sample_003      .

```

   :

:

頖30  ;

頖60;

頖90  .

:

    ;

   (  ,   ).

:

     ;

   1530  ;

    .

 :

     .

    (   ).

 :

WER (Word Error Rate)   ;

MOS (Mean Opinion Score)   .




3.  TTS?  ComfyUI


3.1.    (Tacotron2, FastSpeech)

ComfyUI    TTS?   .        .

1. Tacotron2

:  ?   (    ).

:

1.   `TTS: Tacotron2`  ComfyUI Manager ( Custom Nodes).

2.    (,   Hugging Face):

: `.pt`  `.ckpt`;

 : `tacotron2-lj-v2`, `tacotron2-multi`.

3.    :

```

ComfyUI/models/tts/tacotron2/

```

4.         Model Path.

  :

`text`    (  Text Input);

`speaker_id`    (  );

`speed`     ( : 1.0).

: `mel_spectrogram` (  ).

2. FastSpeech2

  Tacotron2:

  ;

 ;

    .

:

1.   `TTS: FastSpeech2`  Manager.

2.   (, `fastspeech2-vctk`)   :

```

ComfyUI/models/tts/fastspeech2/

```

3.     Model Path .

 :

`text`   ;

`pitch_control`     (: 0.81.2);

`energy_control`     (0.81.2).

: `mel_spectrogram`.

:      (, WaveGlow  HiFi?GAN)     .

3.2.  : , , 

1.   (Speed)

 :  TTS? ( `speed`).

:

0.5    ( 2);

1.0   ;

2.0    ( 2).

:

 : 0.91.1;

 : 1.21.4.

2.  (Pitch)

 :

  `pitch_control`  FastSpeech2;

   `Audio Effect` (  100500).

:

  ?   ;

  ?   .

: 0.81.2 ().

3. 

  :  `energy_control`  FastSpeech2 (   ).

  :

 `Audio Effect` ?  `volume` ( );

 `Audio Output` ?  Normalization (LUFS).

 :

 :   ?6;

 : ?14LUFS (  ).

4.  

  :

  ``  `[PAUSE]`  ;

   `pause_duration` (  ).

  :

 : ` `;

  `energy_control`   .

3.3.   

 workflow:

1.  

: `Text Input`.

 :

```

!      ComfyUI.

```

2.  

: `TTS: FastSpeech2` ( `Tacotron2`).

:

`speed` = 1.0;

`pitch_control` = 1.0;

`energy_control` = 1.0.

3.   

: `Vocoder: HiFi-GAN` ( `WaveGlow`).

:

`sample_rate` = 48000;

`denoiser_strength` = 0.01 (  ).

4. 

: `Audio Effect`.

:

 ( 14);

 .

5. 

: `Audio Output`.

:

`format` = WAV;

`output_path` = `./output/speech.wav`.

 :

1.    :

```

Text Input ? FastSpeech2 ? HiFi-GAN ? Audio Effect ? Audio Output

```

2.  Queue Prompt.

3.     .

   :

  : ,           .

  :      `denoiser_strength`.

 :    (  250)   .

  :

      (, `fastspeech2-small`).

     (File ? Save As Template).

       `Batch Process`.




4.    


4.1.      Hugging Face

1.  

1. ,   ComfyUI Manager (  Manager ? Install Custom Nodes).

2.   :

`transformers` (  );

`torch` (PyTorch  );

`soundfile` (   ).

```bash

pip install transformers torch soundfile

```

2.    Hugging Face

1.   [huggingface.co/models](https://huggingface.co/models).

2.  :

Task: Text-to-Speech, Voice Cloning;

Language:    (, Russian, English);

Library: PyTorch.

3.   :

`facebook/fairseq-wav2vec2-large-960h` ();

`silero/models` ( TTS);

`espnet/kan-bayashi_ljspeech_tts_train_tacotron2_raw_phn_tacotron_g2p_en` ().

3.  

1.  ComfyUI   Download Model ( ComfyUI Manager).

2. :

Model ID:   (, `silero/models/en_tts`).

Save Path:  `ComfyUI/models/tts/`.

3.  Download.     `.pt`  `.ckpt`.

4.    ComfyUI

1.   TTS Model Loader (    ).

2.   Model Path     .

3.  :

    `text`   `mel_spectrogram`;

,   PyTorch   .

5.  

1.  :

```

Text Input ? TTS Model Loader ? Vocoder ? Audio Output

```

2.    (, !).

3.    Queue Prompt.

  :

  :     .

 CUDA: ,  GPU    CUDA?.

 :    `torch.jit.save()`.

4.2.      

1.   ( Tacotron2 WaveGlow)

:

`Text Input`: Hello, this is a test.

`TTS: Tacotron2` ( `tacotron2-lj-v2`).

`Vocoder: WaveGlow` ( `waveglow-lj-v2`).

`Audio Output` ( WAV, 22050).

:

: `1.0`;

: `1.0`.

2.   ( VITS HiFi?GAN)

:

`Text Input`: ,    .

`TTS: VITS` ( `vits-russian`).

`Vocoder: HiFi-GAN` ( `hifigan-vits-ru`).

`Audio Effect` (:  14).

`Audio Output` (WAV, 48000).

:

: `ru`;

: `neutral`.

3.   ( ESPNet)

:

`Text Input`:    .

`TTS: ESPNet` ( `espnet/multi_tts`).

`Vocoder: MelGAN`.

:

`language_id`: `en`, `ru`, `es`  .;

`speaker_id`:   ( ).

4.   (YourTTS)

:

`Audio Input`:    (WAV, 16).

`Text Input`:    .




  .


   .

   ,     (https://www.litres.ru/pages/biblio_book/?art=73162363)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


