A set of ComfyUI nodes based on VoxCPM for generating and editing speech from SRT subtitle files.
model_name: Select the model to load. The default option, openbmb/VoxCPM-0.5B (Auto-Download), will automatically download the model from Hugging Face.optimize: Enables torch.compile for optimization. This feature may not work directly on Windows due to some bugs, but it is retained as it might be fixed by the community.speaker_name: Manually enter a unique identifier for the speaker (e.g., speaker1). This name must exactly match the speaker prefix used in the corresponding lines of the SRT file.prompt_audio: Input the reference audio. You can use the built-in Load Audio node in ComfyUI or use the Audio Trimmer node to extract a specific segment from a longer audio file.prompt_text: Enter the transcript of the reference audio.cache_group input of the first Cache Combiner node should be left unconnected.cache_group input of subsequent nodes should be connected to the output of the previous Cache Combiner node.cache_group input of the SRT Processor or SRT Dubber node.timestamp: Enter a timestamp in the format 00:00:06,500 --> 00:00:08,000. The node will output only the audio within this time range.SpeakerID + Space to differentiate characters. For example:
1
00:00:00,500 --> 00:00:05,000
speaker1 Hello world!
2
00:00:06,500 --> 00:00:08,000
speaker2 Hello, world!
1
00:00:00,500 --> 00:00:05,000
Hello world!
entries_to_replace: Enter the subtitle numbers from the SRT file that you want to replace, separated by spaces (e.g., 1 3 5). The node will generate new audio using the provided voice and the text from the corresponding subtitle number, then replace it at the correct time in the original audio.1 2 3 5 6, entering 4 will not match anything. If a number is duplicated (e.g., 1 2 3 4 4 5), entering 4 will process both entries numbered 4.normalize_text: Normalizes the text before synthesis. For example, when enabled, the number 50 will be read as "fifty" instead of "five zero".stretch_method: Method for time-stretching the audio to align the generated speech with the subtitle's duration.
none: No stretching is applied. If the generated audio is longer than the subtitle duration, it will overlap with the next line.librosa: Uses the librosa library for time-stretching. The quality can be inconsistent; you can adjust stretch_n_fft and stretch_hop_length to mitigate artifacts like "metallic" sounds.pydub: Uses the pydub library, which generally produces better results than librosa. This method requires FFmpeg to be installed and configured in your system's PATH.cfg_value: Defaults to 2.0, which is a balanced setting. Higher values can sometimes improve results but may lead to instability.inference_timesteps: The number of inference steps. 10 steps can produce good results, but more steps can further improve audio quality.retry_threshold: The threshold for triggering a retry. The model compares the length ratio of the generated audio to the input text. If this ratio exceeds the threshold (meaning the audio is too long for the text), it's considered a failure and triggers a retry. For very slow speakers, you may need to increase this value (e.g., to 8.0 or 10.0).retry_max_attempts: The maximum number of retries. When a generation fails, the model discards the result and tries again with a new random seed. Set to 0 to disable this feature.VoxCPM Loader node, select openbmb/VoxCPM-0.5B (Auto-Download). The model will be automatically downloaded and cached in ComfyUI's models/TTS folder.models/TTS directory, for example: \ComfyUI\models\TTS\VoxCPM-0.5B.


I have only a little knowledge of python code. This node is based on VoxCPM, and the code was written with the assistance of Gemini 2.5 Pro.
The node still has some areas for improvement (like torch.compile compatibility and the model offloading mechanism). Due to limitations in my personal time and skills, I warmly welcome anyone in the community to freely use, modify, and improve this node, while respecting the VoxCPM license. Your contributions are appreciated!
9 commits
Python
100.0%
A set of ComfyUI nodes based on VoxCPM for generating and editing speech from SRT subtitle files.
model_name: Select the model to load. The default option, openbmb/VoxCPM-0.5B (Auto-Download), will automatically download the model from Hugging Face.optimize: Enables torch.compile for optimization. This feature may not work directly on Windows due to some bugs, but it is retained as it might be fixed by the community.speaker_name: Manually enter a unique identifier for the speaker (e.g., speaker1). This name must exactly match the speaker prefix used in the corresponding lines of the SRT file.prompt_audio: Input the reference audio. You can use the built-in Load Audio node in ComfyUI or use the Audio Trimmer node to extract a specific segment from a longer audio file.prompt_text: Enter the transcript of the reference audio.cache_group input of the first Cache Combiner node should be left unconnected.cache_group input of subsequent nodes should be connected to the output of the previous Cache Combiner node.cache_group input of the SRT Processor or SRT Dubber node.timestamp: Enter a timestamp in the format 00:00:06,500 --> 00:00:08,000. The node will output only the audio within this time range.SpeakerID + Space to differentiate characters. For example:
1
00:00:00,500 --> 00:00:05,000
speaker1 Hello world!
2
00:00:06,500 --> 00:00:08,000
speaker2 Hello, world!
1
00:00:00,500 --> 00:00:05,000
Hello world!
entries_to_replace: Enter the subtitle numbers from the SRT file that you want to replace, separated by spaces (e.g., 1 3 5). The node will generate new audio using the provided voice and the text from the corresponding subtitle number, then replace it at the correct time in the original audio.1 2 3 5 6, entering 4 will not match anything. If a number is duplicated (e.g., 1 2 3 4 4 5), entering 4 will process both entries numbered 4.normalize_text: Normalizes the text before synthesis. For example, when enabled, the number 50 will be read as "fifty" instead of "five zero".stretch_method: Method for time-stretching the audio to align the generated speech with the subtitle's duration.
none: No stretching is applied. If the generated audio is longer than the subtitle duration, it will overlap with the next line.librosa: Uses the librosa library for time-stretching. The quality can be inconsistent; you can adjust stretch_n_fft and stretch_hop_length to mitigate artifacts like "metallic" sounds.pydub: Uses the pydub library, which generally produces better results than librosa. This method requires FFmpeg to be installed and configured in your system's PATH.cfg_value: Defaults to 2.0, which is a balanced setting. Higher values can sometimes improve results but may lead to instability.inference_timesteps: The number of inference steps. 10 steps can produce good results, but more steps can further improve audio quality.retry_threshold: The threshold for triggering a retry. The model compares the length ratio of the generated audio to the input text. If this ratio exceeds the threshold (meaning the audio is too long for the text), it's considered a failure and triggers a retry. For very slow speakers, you may need to increase this value (e.g., to 8.0 or 10.0).retry_max_attempts: The maximum number of retries. When a generation fails, the model discards the result and tries again with a new random seed. Set to 0 to disable this feature.VoxCPM Loader node, select openbmb/VoxCPM-0.5B (Auto-Download). The model will be automatically downloaded and cached in ComfyUI's models/TTS folder.models/TTS directory, for example: \ComfyUI\models\TTS\VoxCPM-0.5B.


I have only a little knowledge of python code. This node is based on VoxCPM, and the code was written with the assistance of Gemini 2.5 Pro.
The node still has some areas for improvement (like torch.compile compatibility and the model offloading mechanism). Due to limitations in my personal time and skills, I warmly welcome anyone in the community to freely use, modify, and improve this node, while respecting the VoxCPM license. Your contributions are appreciated!
9 commits
Python
100.0%