ComfyUI > Nodes > ComfyUI-Stream-Pack > SRT Generator

ComfyUI Node: SRT Generator

Class Name

SRTGeneratorNode

Category
text_utils
Author
livepeer (Account age: 3364days)
Extension
ComfyUI-Stream-Pack
Latest Updated
2025-09-25
Github Stars
0.02K

How to Install ComfyUI-Stream-Pack

Install this extension via the ComfyUI Manager by searching for ComfyUI-Stream-Pack
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Stream-Pack 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

SRT Generator Description

Transforms transcription data into SRT subtitles, supporting segment and word-level accuracy.

SRT Generator:

The SRTGeneratorNode is designed to transform audio transcription data into SubRip Subtitle (SRT) format, which is widely used for displaying subtitles in video content. This node processes transcription data, which may be structured as JSON or plain text, and converts it into a series of time-coded subtitle entries. The primary benefit of this node is its ability to handle both segment-level and word-level transcription data, ensuring flexibility and accuracy in subtitle generation. By providing options for absolute or relative timing and enforcing minimum duration for subtitles, the node ensures that the generated SRT files are both precise and readable. This functionality is crucial for creators who need to add subtitles to their video content, enhancing accessibility and viewer engagement.

SRT Generator Input Parameters:

transcription_data

This parameter represents the raw transcription data that the node will process. It can be in JSON format, containing either segment-level or word-level information, or as plain text. The transcription data is crucial as it forms the basis for generating the SRT content. The node attempts to parse this data to extract meaningful segments for subtitle creation. There are no explicit minimum or maximum values, but the data should be sufficiently detailed to allow for accurate subtitle generation.

segment_start_time

This parameter specifies the starting time for the first segment in the transcription data. It is a float value representing seconds and is used when calculating the absolute timing of subtitles. The default value is 0.0 seconds. Adjusting this parameter allows you to synchronize subtitles with the audio track accurately.

segment_duration

This parameter defines the default duration for each segment in seconds. It is used when the transcription data does not provide explicit end times for segments. The default value is 3.0 seconds. This parameter ensures that each subtitle has a reasonable display duration, enhancing readability.

use_absolute_time

This boolean parameter determines whether the node should use absolute timing for subtitles. If set to True, the node adds the segment_start_time to each segment's start and end times. The default value is False, meaning the node uses segment-relative timing by default. This option is useful for aligning subtitles with specific points in the audio track.

minimum_duration

This parameter sets the minimum duration for each subtitle in seconds. If a segment's calculated duration is shorter than this value, the node extends the end time to meet the minimum duration. The default value is 1.0 second. This ensures that subtitles are displayed long enough for viewers to read comfortably.

SRT Generator Output Parameters:

srt_content

The output parameter srt_content is a string containing the generated SRT file content. This content includes a series of subtitle entries, each with a unique identifier, start and end times, and the corresponding text. The SRT format is widely compatible with video players and editing software, making it an essential output for adding subtitles to video content. The generated SRT content enhances the accessibility and engagement of video materials by providing clear and synchronized subtitles.

SRT Generator Usage Tips:

  • Ensure that your transcription data is well-structured and contains accurate timing information to improve the quality of the generated SRT content.
  • Use the use_absolute_time parameter to synchronize subtitles with specific points in your audio track, especially if your transcription data does not include absolute timing.
  • Adjust the minimum_duration parameter to ensure that subtitles are displayed long enough for viewers to read comfortably, especially for short segments.

SRT Generator Common Errors and Solutions:

Empty or minimal transcription data: '<transcription_data>'

  • Explanation: This error occurs when the provided transcription data is empty or too short to generate meaningful subtitles.
  • Solution: Ensure that your transcription data is complete and contains sufficient information for subtitle generation.

Error generating SRT: <error_message>

  • Explanation: This error indicates that an unexpected issue occurred during the SRT generation process, possibly due to malformed transcription data.
  • Solution: Check the format and content of your transcription data for errors. Ensure it is correctly structured and try again.

SRT Generator Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Stream-Pack
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

SRT Generator