Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/1038lab/ComfyUI-FireRedTTS
/ functions
Functions
144 in github.com/1038lab/ComfyUI-FireRedTTS
⨍
Functions
144
◇
Types & classes
29
↓ 12 callers
Method
forward_chunk
Forward only one frame. Args: spec: shape (B, N, T=chunk_size) cache: previous chunk's last ifft frame, shape (B,
fireredtts2/codec/decoder.py:407
↓ 8 callers
Method
__init__
( self, n_fft: int, hop_length: int, win_length: int, padding: str = "same" )
fireredtts2/codec/decoder.py:338
↓ 6 callers
Method
_shape
(self, tensor: torch.Tensor, seq_len: int, bsz: int)
fireredtts2/codec/whisper.py:42
↓ 5 callers
Function
clean_text
(text)
fireredtts2/utils/spliter.py:59
↓ 5 callers
Function
utf_8_len
(text)
fireredtts2/utils/spliter.py:76
↓ 4 callers
Function
WNConv1d
(*args, **kwargs)
fireredtts2/codec/rvq.py:8
↓ 4 callers
Method
__init__
( self, in_dim: int, embed_dim: int, num_layers: int, num_heads:
fireredtts2/codec/whisper.py:196
↓ 4 callers
Method
__init__
( self, embed_dim: int = 768, stride: int = 4, )
fireredtts2/codec/model.py:124
↓ 4 callers
Function
_create_causal_mask
(seq_len: int, device: torch.device)
fireredtts2/llm/llm.py:16
↓ 4 callers
Function
make_nonpad_mask
(lengths: torch.Tensor, max_len: int = 0)
fireredtts2/codec/utils.py:15
↓ 4 callers
Function
to_comfyui_audio
(tensor: torch.Tensor, sample_rate: int = 24000)
AILab_FireRedTTS.py:173
↓ 3 callers
Function
break_text
(texts, length, splits: set)
fireredtts2/utils/spliter.py:80
↓ 3 callers
Method
encode
Args: audio16k: shape (b, t) audio16k_length: (b,) Returns: token: shape (b, nq, l)
fireredtts2/codec/model.py:245
↓ 3 callers
Method
from_pretrained
(cls, conf_path: str, ckpt_path: str)
fireredtts2/codec/model.py:211
↓ 3 callers
Function
hertz_to_mel
( freq: Union[float, np.ndarray], mel_scale: str = "htk" )
fireredtts2/codec/audio.py:24
↓ 3 callers
Method
reset_caches
(self)
fireredtts2/llm/llm.py:332
↓ 2 callers
Method
_embed_audio
(self, codebook: int, tokens: torch.Tensor)
fireredtts2/llm/llm.py:336
↓ 2 callers
Method
_embed_tokens
(self, tokens: torch.Tensor)
fireredtts2/llm/llm.py:339
↓ 2 callers
Function
_index_causal_mask
Args: mask: (max_seq_len, max_seq_len) input_pos: (batch_size, seq_len) Returns: (batch_size, seq_len, max_seq
fireredtts2/llm/llm.py:20
↓ 2 callers
Function
_multinomial_sample_one_no_sync
(probs)
fireredtts2/llm/llm.py:34
↓ 2 callers
Function
_prepare_transformer
(model)
fireredtts2/llm/llm.py:9
↓ 2 callers
Method
_tokenize_segment
Returns: (seq_len,17), (seq_len, 17)
fireredtts2/fireredtts2.py:117
↓ 2 callers
Method
_tokenize_text_segment
( self, text: str, speaker: str )
fireredtts2/fireredtts2.py:72
↓ 2 callers
Function
add_cleaned
(curr, segments)
fireredtts2/utils/spliter.py:116
↓ 2 callers
Function
check_gpu_memory
()
AILab_FireRedTTS.py:55
↓ 2 callers
Function
clear_gpu_memory
()
AILab_FireRedTTS.py:50
↓ 2 callers
Function
count_characters_chinese
统计中文字符数量
fireredtts2/utils/spliter.py:176
↓ 2 callers
Function
count_words_english
统计英文单词数量
fireredtts2/utils/spliter.py:171
↓ 2 callers
Method
decode
Args: tokens: (B=1, nq, L) Returns: audio: (B=1, t)
fireredtts2/codec/model.py:308
↓ 2 callers
Method
decode_code
(self, embed_id)
fireredtts2/codec/rvq.py:56
↓ 2 callers
Method
decode_codes
Decode codes from multiple quantizers to embeddings. Args: codes: Tensor of shape (nq, B, T) containing code indices for each
fireredtts2/codec/rvq.py:145
↓ 2 callers
Method
forward
Compute the Inverse Short Time Fourier Transform (ISTFT) of a complex spectrogram. Args: spec (Tensor): Input comple
fireredtts2/codec/decoder.py:350
↓ 2 callers
Method
forward
( self, hidden_states: torch.Tensor, hidden_length: torch.Tensor, apply_po
fireredtts2/codec/whisper.py:234
↓ 2 callers
Method
generate
( self, text: str, speaker: str, context: List[Segment], max_audi
fireredtts2/fireredtts2.py:132
↓ 2 callers
Method
generate_frame
Args: tokens: (batch_size, seq_len, audio_num_codebooks+1) tokens_mask: (batch_size, seq_len, audio_num_codebooks+
fireredtts2/llm/llm.py:274
↓ 2 callers
Function
get_model_path
()
AILab_FireRedTTS.py:94
↓ 2 callers
Method
prepare_prompt
(self, text, speaker, audio_path)
fireredtts2/fireredtts2.py:68
↓ 2 callers
Function
safe_generate_with_fallback
(model, generate_func, *args, **kwargs)
AILab_FireRedTTS.py:64
↓ 2 callers
Function
sample_topk
(logits: torch.Tensor, topk: int, temperature: float)
fireredtts2/llm/llm.py:39
↓ 1 callers
Method
__init__
( self, input_dim: int = 768, # Input dimension, unrelated to RVQ rvq_dim=None, #
fireredtts2/codec/rvq.py:93
↓ 1 callers
Function
_create_triangular_filter_bank
Creates a triangular filter bank. Adapted from *torchaudio* and *librosa*. Args: fft_freqs (`np.ndarray` of shape `(num_f
fireredtts2/codec/audio.py:78
↓ 1 callers
Method
_encode_one_batch
(self, audio16k: torch.Tensor)
fireredtts2/codec/model.py:218
↓ 1 callers
Method
_pad_and_chunk
(audio: torch.Tensor, chunk_size: int)
fireredtts2/codec/model.py:238
↓ 1 callers
Method
_tokenize_audio
(self, audio: torch.Tensor)
fireredtts2/fireredtts2.py:90
↓ 1 callers
Function
break_text_by_length
(texts, length)
fireredtts2/utils/spliter.py:98
↓ 1 callers
Function
contains_chinese
检测文本是否包含中文字符
fireredtts2/utils/spliter.py:166
↓ 1 callers
Method
encode_code
(self, z: torch.Tensor)
fireredtts2/codec/rvq.py:62
↓ 1 callers
Method
encode_codes
(self, z: torch.Tensor)
fireredtts2/codec/rvq.py:132
↓ 1 callers
Method
extract_fbank
Args: audio: batched audio of shape (b, t)
fireredtts2/codec/whisper.py:304
↓ 1 callers
Method
forward
(self, x: torch.Tensor, input_length: torch.Tensor)
fireredtts2/codec/model.py:142
↓ 1 callers
Method
forward_upsample_conv_chunk
Stream forward upsample_conv module with previous block cache. Args: x: shape (B, C, T) cache: shape (B, C, 3), w
fireredtts2/codec/decoder.py:624
↓ 1 callers
Method
from_config
(cls, config_json: str)
fireredtts2/codec/model.py:174
↓ 1 callers
Method
generate_single
( self, context: List[Segment], temperature: float = 0.9, topk: int = 20 )
fireredtts2/fireredtts2.py:203
↓ 1 callers
Function
get_device
()
AILab_FireRedTTS.py:33
↓ 1 callers
Function
get_dialogue_model
()
AILab_FireRedTTS.py:124
↓ 1 callers
Function
get_monologue_model
()
AILab_FireRedTTS.py:147
↓ 1 callers
Function
init_weights
Initialize the weights of the model. - Xavier uniform initialization for linear layers - Normal initialization for embeddings - X
fireredtts2/llm/utils.py:199
↓ 1 callers
Function
load_custom_tokenizer
(qwen2_tokenizer_path: str)
fireredtts2/llm/utils.py:190
↓ 1 callers
Function
load_llm_model
Load model, add forward method, and move to device. Args: model_name_or_checkpoint_path: Name or path of pretrained model or checkpoin
fireredtts2/llm/utils.py:225
↓ 1 callers
Function
load_nodes
Automatically discover and load node definitions
__init__.py:17
↓ 1 callers
Method
load_prompt_audio
(self, audio_path)
fireredtts2/fireredtts2.py:60
↓ 1 callers
Function
make_block_causal_mask
( lengths: torch.Tensor, max_len: int = 0, chunk_size: int = 4 )
fireredtts2/codec/utils.py:19
↓ 1 callers
Function
make_pad_mask
(lengths: torch.Tensor, max_len: int = 0)
fireredtts2/codec/utils.py:5
↓ 1 callers
Function
mel_filter_bank
( num_frequency_bins: int, num_mel_filters: int, min_frequency: float, max_frequency: floa
fireredtts2/codec/audio.py:102
↓ 1 callers
Function
mel_to_hertz
( mels: Union[float, np.ndarray], mel_scale: str = "htk" )
fireredtts2/codec/audio.py:51
↓ 1 callers
Function
merge_sentences_chinese
合并中文句子
fireredtts2/utils/spliter.py:237
↓ 1 callers
Function
merge_sentences_english
合并英文句子
fireredtts2/utils/spliter.py:215
↓ 1 callers
Function
parse_dialogue_text
(text_list_str: str)
AILab_FireRedTTS.py:185
↓ 1 callers
Function
parse_multiline_string
(text: str)
AILab_FireRedTTS.py:166
↓ 1 callers
Function
process_text
(text)
fireredtts2/utils/spliter.py:259
↓ 1 callers
Function
process_text_list
(text_list)
fireredtts2/utils/spliter.py:279
↓ 1 callers
Method
setup_caches
Setup KV caches and return a causal mask.
fireredtts2/llm/llm.py:123
↓ 1 callers
Function
sinusoids
Returns sinusoids for positional embedding
fireredtts2/codec/whisper.py:11
↓ 1 callers
Function
split_by_punctuation_chinese
按中文标点符号分割
fireredtts2/utils/spliter.py:198
↓ 1 callers
Function
split_by_punctuation_english
按英文标点符号分割
fireredtts2/utils/spliter.py:181
↓ 1 callers
Function
split_text
(text, length)
fireredtts2/utils/spliter.py:132
Method
INPUT_TYPES
(cls)
AILab_FireRedTTS.py:208
Method
INPUT_TYPES
(cls)
AILab_FireRedTTS.py:295
Function
WNConvTranspose1d
(*args, **kwargs)
fireredtts2/codec/rvq.py:12
Method
__call__
(self, audio16k: torch.Tensor, audio16k_length: torch.Tensor)
fireredtts2/codec/whisper.py:325
Method
__init__
(self, pretrained_dir, gen_type, device)
fireredtts2/fireredtts2.py:16
Method
__init__
(self, config: ModelArgs)
fireredtts2/llm/llm.py:87
Method
__init__
( self, optimizer, warmup_steps: int, total_steps: int, decay_type: str = "linear" )
fireredtts2/llm/utils.py:25
Method
__init__
( self, in_channels: int, out_channels: int = None, conv_shortcut: bool =
fireredtts2/codec/decoder.py:9
Method
__init__
(self, dim0: int, dim1: int)
fireredtts2/codec/decoder.py:67
Method
__init__
( self, in_channels: int, out_channels: int, kernel_size: int, )
fireredtts2/codec/decoder.py:79
Method
__init__
( self, in_channels: int, out_channels: int = None, dropout: float = 0.0,
fireredtts2/codec/decoder.py:106
Method
__init__
( self, embed_dim: int = 1024, num_layers: int = 12, num_heads: int = 16,
fireredtts2/codec/decoder.py:176
Method
__init__
( self, embed_dim: int = 1024, num_layers: int = 12, num_heads: int = 16,
fireredtts2/codec/decoder.py:226
Method
__init__
(self, dim: int, n_fft: int, hop_length: int, padding: str = "same")
fireredtts2/codec/decoder.py:483
Method
__init__
( self, # Transformer embed_dim: int, num_layers: int, num_heads:
fireredtts2/codec/decoder.py:551
Method
__init__
( self, input_dim: int, codebook_size: int, codebook_dim: int, )
fireredtts2/codec/rvq.py:17
Method
__init__
( self, embed_dim: int, num_heads: int, dropout: float = 0.0, bia
fireredtts2/codec/whisper.py:24
Method
__init__
( self, embed_dim: int, num_heads: int, ffn_dim: int = None, attn
fireredtts2/codec/whisper.py:122
Method
__init__
( self, num_mels: int = 128, sampling_rate: int = 16000, hop_length: int =
fireredtts2/codec/whisper.py:276
Method
__init__
( self, # Mel extraction params num_mels: int = 128, sampling_rate: int =
fireredtts2/codec/whisper.py:375
Method
__init__
( self, in_dim: int, embed_dim: int, out_dim: int, num_layers: in
fireredtts2/codec/model.py:20
Method
__init__
( self, embed_dim: int = 768, avg_pooler=4, )
fireredtts2/codec/model.py:81
Method
__init__
( self, ssl: PretrainedWhisperEncoder, ssl_adaptor: SslAdaptor, acoustic_e
fireredtts2/codec/model.py:152
Method
__init__
(self, codec: RedCodec)
fireredtts2/codec/model.py:198
next →
1–100 of 144, ranked by callers