ComfyUI > Nodes > ComfyUI_ASR > 视频添加动态字幕

ComfyUI Node: 视频添加动态字幕

Class Name

DynamicSubtitlesToVideoMW

Category
🎤MW/MW-ASR
Author
billwuhao (Account age: 2576days)
Extension
ComfyUI_ASR
Latest Updated
2026-03-11
Github Stars
0.03K

How to Install ComfyUI_ASR

Install this extension via the ComfyUI Manager by searching for ComfyUI_ASR
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_ASR 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

视频添加动态字幕 Description

Enhances videos by dynamically overlaying customizable, synchronized subtitles for improved engagement.

视频添加动态字幕:

The DynamicSubtitlesToVideoMW node is designed to enhance video content by dynamically overlaying subtitles onto video frames. This node is particularly beneficial for creators who wish to add timed text to their videos, such as captions or translations, in a visually appealing manner. By allowing subtitles to be synchronized with the video content, it ensures that the text appears at the right moment, enhancing the viewer's understanding and engagement. The node provides flexibility in terms of font style, size, color, and background, allowing you to customize the appearance of the subtitles to match the video's aesthetic. Additionally, it supports various configurations to control the positioning and alignment of the text, making it a versatile tool for video editing and content creation.

视频添加动态字幕 Input Parameters:

视频

This parameter accepts an image input representing the video frames onto which the subtitles will be overlaid. It is essential for providing the visual content that will be enhanced with subtitles.

帧率

This parameter specifies the frame rate of the video, which is crucial for synchronizing the subtitles with the video playback. It is a floating-point number that must be provided to ensure accurate timing of the subtitles.

字幕文本

This parameter is a string that contains the subtitle text along with time stamps for each word or phrase. It is mandatory to input this data to enable the node to display the subtitles at the correct times during the video.

字体

This parameter allows you to select the font style for the subtitles from a list of available fonts. The fonts should be placed in the fonts directory within the node's folder, providing a way to customize the text appearance.

字体大小比例

This floating-point parameter determines the size of the subtitle font relative to the video width. It ranges from 0.01 to 0.2, with a default value of 0.05, allowing you to adjust the text size to ensure readability without overwhelming the video content.

字体颜色

This parameter specifies the color of the subtitle text in the format #RRGGBB. The default color is white (#FFFFFF), but you can change it to match the video's color scheme or improve contrast.

字体背景色

This parameter sets the background color of the subtitle text, also in the #RRGGBB format. The default is black (#000000), which helps the text stand out against various video backgrounds.

背景透明度

This floating-point parameter controls the opacity of the subtitle background, ranging from 0 (completely transparent) to 1 (completely opaque). The default value is 0.5, providing a balance between visibility and unobtrusiveness.

最大行数

This optional integer parameter defines the maximum number of subtitle lines that can be displayed on the screen simultaneously. It ranges from 1 to 10, with a default of 2, allowing you to manage the amount of text shown at once.

字幕宽度比例

This optional floating-point parameter determines the width of the subtitles relative to the video width. It ensures that the text does not extend beyond the video's edges, maintaining a clean and professional appearance.

视频添加动态字幕 Output Parameters:

Output Frames

The output of this node is a stack of video frames with the dynamically overlaid subtitles. Each frame is processed to include the appropriate subtitle text at the correct time, resulting in a seamless integration of text and video. This output can be used for further video editing or directly exported as a final video product.

视频添加动态字幕 Usage Tips:

  • Ensure that the 字幕文本 parameter is accurately formatted with time stamps to achieve precise subtitle synchronization with the video.
  • Experiment with different 字体 and 字体颜色 settings to find the best combination that enhances readability and complements the video's aesthetic.

视频添加动态字幕 Common Errors and Solutions:

ValueError: Invalid subtitle text format

  • Explanation: This error occurs when the 字幕文本 parameter is not correctly formatted with time stamps.
  • Solution: Verify that the subtitle text includes proper time stamps for each word or phrase to ensure accurate synchronization.

FileNotFoundError: Font file not found

  • Explanation: This error indicates that the specified font file is not located in the fonts directory.
  • Solution: Ensure that the desired font file is placed in the correct directory and that the 字体 parameter is set to a valid font name.

视频添加动态字幕 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_ASR
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.

视频添加动态字幕