ComfyUI > Nodes > comfyui_LLM_party > OpenAI语音合成(openai_tts)

ComfyUI Node: OpenAI语音合成(openai_tts)

Class Name

openai_tts

Category
大模型派对(llm_party)/函数(function)
Author
heshengtao (Account age: 2893days)
Extension
comfyui_LLM_party
Latest Updated
2024-06-22
Github Stars
0.12K

How to Install comfyui_LLM_party

Install this extension via the ComfyUI Manager by searching for comfyui_LLM_party
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui_LLM_party in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

OpenAI语音合成(openai_tts) Description

Convert text to speech using OpenAI models, supporting various voices for high-quality audio synthesis.

OpenAI语音合成(openai_tts):

The openai_tts node is designed to convert text into speech using OpenAI's advanced text-to-speech models. This node allows you to input a string of text and receive an audio file of the spoken version of that text. It supports various models and voices, providing flexibility in the type of speech output you can generate. This functionality is particularly useful for creating voiceovers, narrations, or any application where converting text to natural-sounding speech is required. The node integrates seamlessly with OpenAI's API, ensuring high-quality and reliable speech synthesis.

OpenAI语音合成(openai_tts) Input Parameters:

is_enable

This parameter is a boolean that enables or disables the text-to-speech functionality. When set to True, the node will process the input text and generate speech. If set to False, the node will not perform any action. The default value is True.

input_string

This parameter accepts a string of text that you want to convert into speech. The text provided here will be synthesized into an audio file. There are no specific minimum or maximum values for the length of the text, but it should be within reasonable limits for processing.

model_name

This parameter allows you to select the text-to-speech model to be used. The available options are tts-1 and tts-1-hd, with tts-1 being the default model. The choice of model can affect the quality and characteristics of the generated speech.

voice

This parameter lets you choose the voice for the speech synthesis. Available options include alloy, echo, fable, onyx, nova, and shimmer, with alloy being the default voice. Each voice has unique characteristics, allowing you to select the one that best fits your needs.

base_url

This optional parameter specifies the base URL for the OpenAI API. The default value is https://api.openai.com/v1/. This can be customized if you are using a different endpoint for the API.

api_key

This optional parameter is for providing your OpenAI API key. The default value is a placeholder sk-XXXXX. You need to replace this with your actual API key to authenticate requests to the OpenAI API.

OpenAI语音合成(openai_tts) Output Parameters:

audio

The output parameter audio is the path to the generated audio file. This file contains the speech synthesized from the input text. The audio file is saved in the audio directory within the current working directory, and the filename is a timestamped .mp3 file.

OpenAI语音合成(openai_tts) Usage Tips:

  • Ensure that the is_enable parameter is set to True to activate the text-to-speech functionality.
  • Choose the appropriate model_name and voice to match the desired quality and style of the speech output.
  • Provide a valid OpenAI API key in the api_key parameter to authenticate your requests.
  • Customize the base_url if you are using a different endpoint for the OpenAI API.

OpenAI语音合成(openai_tts) Common Errors and Solutions:

"请输入API_KEY"

  • Explanation: This error occurs when the API key is not provided or is invalid.
  • Solution: Ensure that you have entered a valid OpenAI API key in the api_key parameter or have it set in your environment variables.

"Invalid input_string"

  • Explanation: This error occurs when the input_string parameter is empty or not provided.
  • Solution: Provide a valid string of text in the input_string parameter to be converted into speech.

"API request failed"

  • Explanation: This error occurs when the request to the OpenAI API fails, possibly due to network issues or incorrect API endpoint.
  • Solution: Check your network connection and ensure that the base_url parameter is correctly set to the OpenAI API endpoint.

OpenAI语音合成(openai_tts) Related Nodes

Go back to the extension to check out more related nodes.
comfyui_LLM_party
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.