ComfyUI  >  Nodes  >  ComfyUI Whisper >  Add Subtitles To Frames

ComfyUI Node: Add Subtitles To Frames

Class Name

Add Subtitles To Frames

Category
whisper
Author
yuvraj108c (Account age: 2153 days)
Extension
ComfyUI Whisper
Latest Updated
5/31/2024
Github Stars
0.1K

How to Install ComfyUI Whisper

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

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Add Subtitles To Frames Description

Overlay subtitles on video frames with timing alignment, font customization, and mask generation for AI artists.

Add Subtitles To Frames:

The Add Subtitles To Frames node is designed to overlay subtitles onto a sequence of video frames, making it an essential tool for AI artists who want to add textual elements to their visual content. This node takes a series of images and aligns subtitles based on timing information, ensuring that the text appears at the correct moments in the video. It offers customization options for font type, size, color, and positioning, allowing you to tailor the appearance of the subtitles to match your creative vision. The node also generates masks and cropped images of the subtitles, which can be useful for further processing or effects. By automating the addition of subtitles, this node saves time and effort, enabling you to focus on the artistic aspects of your project.

Add Subtitles To Frames Input Parameters:

images

This parameter accepts a sequence of images (frames) to which the subtitles will be added. The images should be in a format that can be processed by the node, typically as tensors.

alignment

This parameter takes a whisper_alignment object, which contains the timing information for the subtitles. It ensures that the text appears at the correct frames based on the start and end times specified in the alignment data.

font_color

This parameter specifies the color of the subtitle text. It accepts a string value representing the color name or hex code. The default value is "white".

font_family

This parameter allows you to choose the font type for the subtitles. It lists available fonts from the specified font directory, enabling you to select the one that best fits your project's style.

font_size

This parameter sets the size of the subtitle text. It accepts an integer value, with a default of 100. The size can be adjusted in steps of 5 to achieve the desired appearance.

x_position

This parameter determines the horizontal position of the subtitles on the frames. It accepts an integer value, with a default of 100. The position can be adjusted in steps of 50.

y_position

This parameter determines the vertical position of the subtitles on the frames. It accepts an integer value, with a default of 100. The position can be adjusted in steps of 50.

center_x

This boolean parameter, when set to true, centers the subtitles horizontally on the frames. The default value is true.

center_y

This boolean parameter, when set to true, centers the subtitles vertically on the frames. The default value is true.

video_fps

This parameter specifies the frames per second (FPS) of the video. It accepts an integer value, with a default of 24. The FPS value is used to calculate the correct frames for displaying the subtitles based on the alignment data.

Add Subtitles To Frames Output Parameters:

IMAGE

This output provides the sequence of images with the subtitles added. The images are returned as tensors, ready for further processing or rendering.

MASK

This output provides masks for the images, highlighting the areas where the subtitles are present. The masks are useful for applying additional effects or processing only the subtitle regions.

cropped_subtitles

This output provides cropped images of the subtitles. Each cropped image contains only the subtitle text, which can be used for further manipulation or analysis.

subtitle_coord

This output provides the coordinates of the subtitles on the frames. The coordinates are useful for understanding the placement of the text and for any additional processing that requires knowledge of the subtitle positions.

Add Subtitles To Frames Usage Tips:

  • Ensure that the alignment data is accurate and corresponds to the timing of the video frames to achieve precise subtitle placement.
  • Experiment with different font types and sizes to find the best match for your video's style and readability.
  • Use the center_x and center_y parameters to quickly center the subtitles if you are unsure about the exact positioning.
  • Adjust the font_color to ensure that the subtitles are easily readable against the background of your video frames.

Add Subtitles To Frames Common Errors and Solutions:

"Font not found"

  • Explanation: The specified font is not available in the font directory.
  • Solution: Ensure that the font file is present in the specified directory and that the font_family parameter is correctly set.

"Invalid alignment data"

  • Explanation: The alignment data provided does not match the expected format or contains errors.
  • Solution: Verify that the alignment data is correctly formatted and corresponds to the timing of the video frames.

"Image processing error"

  • Explanation: An error occurred while processing the images, possibly due to incompatible formats or corrupted files.
  • Solution: Check the format and integrity of the input images and ensure they are compatible with the node's requirements.

Add Subtitles To Frames Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Whisper
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.