Visit ComfyUI Online for ready-to-use ComfyUI environment
Overlay subtitles onto video frames for enhanced content with precise control over text appearance and synchronization.
The AddSubtitlesToVideo node is designed to enhance video content by overlaying subtitles directly onto video frames. This node is particularly useful for creators who want to add textual information to their videos, such as translations, captions, or annotations, without needing to use external video editing software. By integrating subtitles into the video frames, this node ensures that the text is synchronized with the video content, providing a seamless viewing experience. The node processes video frames stored as tensors and applies subtitles based on specified timestamps, allowing for precise control over when and where the text appears. This functionality is essential for creating accessible content, improving viewer engagement, and enhancing the overall storytelling of video projects.
This parameter expects a tensor representing the video frames to which subtitles will be added. The images must be in a format compatible with PyTorch tensors, and the node will process each frame individually to overlay the subtitles. If the input is not a tensor, the node will not execute properly.
A string representing a list of dictionaries, where each dictionary contains subtitle text and its corresponding timestamp. The subtitles must be formatted correctly as a list of dictionaries, with each dictionary specifying the text and the start and end times for the subtitle display. This parameter is crucial for ensuring that subtitles appear at the correct time during video playback.
This parameter specifies the language of the subtitles, with options such as "ç±»ä¸æ–‡å—符" and "English_word". The language setting helps the node determine how to wrap text and handle different character sets, ensuring that subtitles are displayed correctly and legibly.
An integer that defines the maximum number of words allowed per line in the subtitles. The default value is 12, with a minimum of 1 and a maximum of 30. This parameter helps control the readability of the subtitles by preventing lines from becoming too long.
A string indicating the file path to the font used for rendering the subtitles. The default is "simhei.ttf". This parameter allows you to customize the appearance of the subtitles by selecting a font that matches the style of your video.
An integer specifying the size of the font used for the subtitles. The default size is 30, with a range from 1 to 200. Adjusting the font size can help ensure that subtitles are legible and appropriately sized for the video resolution.
A string representing the color of the subtitle text. The default color is "black". This parameter allows you to choose a font color that contrasts well with the video background, enhancing subtitle visibility.
A string that defines the background color for the subtitles. The default is "#B8860B", and setting it to "None" will result in no background color. This parameter can improve subtitle readability by providing a contrasting background.
An integer that adjusts the vertical position of the subtitles on the video frame. The default is 0, with a range from -1000 to 1000. This parameter allows you to position the subtitles higher or lower on the screen as needed.
An integer that adjusts the horizontal position of the subtitles on the video frame. The default is 0, with a range from -1000 to 1000. This parameter allows you to shift the subtitles left or right to achieve the desired alignment.
An integer representing the width of the video frames. The default is 1024. This parameter is used to calculate the positioning of the subtitles and ensure they are centered correctly.
An integer representing the height of the video frames. The default is 1024. This parameter, along with the width, helps determine the placement of the subtitles on the video.
A float indicating the frames per second of the video. The default is 20, with a range from 1 to 240. This parameter is essential for synchronizing the subtitles with the video playback, ensuring they appear at the correct times.
The output is a tensor representing the video frames with the added subtitles. This tensor can be used for further processing or saved as a video file. The output ensures that the subtitles are integrated into the video frames, providing a cohesive viewing experience.
<error_message>
RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.