Nodes/comfyui-AGSoft/🎬AGSoft Video Overlay
ComfyUI Node

🎬AGSoft Video Overlay

Burn text and watermarks onto video, positioned by expression

By Art-xmaster·Created about a year ago·Updated a day ago· 24
🎬AGSoft Video Overlay
    • video_path
    • duration_seconds
    • duration_timecode
    • file_size_mb
    • width
    • height
    • fps
    • frames_est
    video
    output_nameoverlay_video.mp4
    output_path
    overlay_text
    font_name(none)
    font_colorwhite
    font_alpha1.00
    font_size48
    text_x20
    text_yH-th-20
    watermark_path
    watermark_xW-w-20
    watermark_y20
    watermark_scale1.00
    watermark_alpha1.00
    encoder_modeauto
    quality_presetbalanced

    🎬AGSoft Video Overlay puts text and/or an image watermark onto a video. It's the node for adding a lower-third-style label, burning in your handle so nobody crops it out, or stamping a logo on every frame. Underneath it's FFmpeg's drawtext and overlay filters with the rough edges sanded off.

    There are two independent layers, and you can use either or both:

    • Text - overlay_text plus font_name (from the pack's own fonts/ folder - the default (none) means no text, so you must pick a font), font_color from a preset palette of FFmpeg/X11 color names, font_alpha (1.0 = opaque), and font_size.
    • Image watermark - watermark_path pointing at a PNG (transparency recommended), watermark_scale as a size multiplier, and watermark_alpha.

    The part that bites people: X/Y expressions

    text_x, text_y, watermark_x, watermark_y are not pixel numbers - they're FFmpeg position expressions, and this is where most users stumble. The good news is the defaults and examples are the idioms you actually want:

    • 20 - 20px from the left/top edge.
    • (W-tw)/2 - horizontally centered (W = video width, tw = text width).
    • W-tw-20 - right-aligned with a 20px margin.
    • H-th-20 - bottom-aligned with a 20px margin (this is the default text_y, i.e. bottom-right text).

    If you type a nonsense expression, FFmpeg errors and the node fails - the error message is the usual cryptic ffmpeg stderr, so copy the expression and check it against those examples before assuming the node is broken.

    The video source is unusual in this pack: the video input is a STRING path that auto-converts to a socket when you drop a connection onto it. Works either way. encoder_mode (auto prefers NVENC) and quality_preset (fast / balanced / quality) control the re-encode - and this node always re-encodes, since it's compositing frames.

    Outputs

    The standard set: video_path (STRING), duration_seconds, duration_timecode, file_size_mb, width, height, fps, frames_est. Empty output_pathComfyUI/output.

    Install

    Part of the comfyui-AGSoft pack. ComfyUI Manager → search "comfyui-AGSoft" → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Art-xmaster/comfyui-AGSoft
    

    Restart. No models - the fonts/ folder ships with the pack, and everything runs through the bundled FFmpeg (or a system ffmpeg on PATH).

    Quick practical notes: for a watermark you actually want people to see, skip overlay_text and load a PNG - text from drawtext is fine for captions but a real logo scales better. And if your text doesn't show up at all, 90% of the time you left font_name at (none).

    CategoryAGSoft/Video

    Inputs (17)

    NameTypeDefaultDescription
    videoSTRINGInput video path. Connect a path loader (the widget auto-converts to an input socket on link drop) or type an absolute path manually. --- Путь входного видео. Подключите загрузчик пути (виджет сам станет сокетом при дропе линка) или введите абсолютный путь вручную.
    output_nameSTRINGoverlay_video.mp4Output filename. The extension is kept as entered (.mp4 by default). --- Имя итогового файла. Расширение сохраняется как введено (по умолчанию .mp4).
    output_pathSTRINGOutput directory. If empty, ComfyUI/output is used. --- Папка сохранения. Если пусто, используется ComfyUI/output.
    overlay_textSTRINGText to draw over the video. Requires a font other than (none). --- Текст поверх видео. Нужен шрифт, отличный от (none).
    font_nameCOMBO(none)Font for the text overlay, taken from the node's fonts/ folder. (none) = no text is drawn. Add a .ttf/.otf to fonts/ and recreate the node to refresh. --- Шрифт для текста из папки fonts/ ноды. (none) = текст не рисуется. Добавьте .ttf/.otf в fonts/ и пересоздайте ноду для обновления.
    font_colorCOMBOwhiteText color from a preset palette (FFmpeg/X11 color names). --- Цвет текста из готовой палитры (имена цветов FFmpeg/X11).
    font_alphaFLOAT1.000–1Text transparency. 1.0 = fully opaque, 0.0 = fully transparent. --- Прозрачность текста. 1.0 = полностью непрозрачно, 0.0 = полностью прозрачно.
    font_sizeINT484–500Text font size in pixels. --- Размер шрифта текста в пикселях.
    text_xSTRING20Drawtext X expression. Examples: 20, (W-tw)/2, W-tw-20. --- Выражение координаты X текста. Примеры: 20, (W-tw)/2, W-tw-20.
    text_ySTRINGH-th-20Drawtext Y expression. Examples: 20, (H-th)/2, H-th-20. --- Выражение координаты Y текста. Примеры: 20, (H-th)/2, H-th-20.
    watermark_pathSTRINGOptional path to a watermark image (PNG with transparency recommended). --- Опционально: путь к изображению watermark (рекомендуется PNG с прозрачностью).
    watermark_xSTRINGW-w-20Overlay X expression. Example: W-w-20 (top-right with margin). --- Выражение координаты X. Пример: W-w-20 (справа вверху с отступом).
    watermark_ySTRING20Overlay Y expression. Example: 20. --- Выражение координаты Y. Пример: 20.
    watermark_scaleFLOAT1.000.05–10Watermark size multiplier. 1.0 = original size (100%). Below 1.0 shrinks it (e.g. 0.5 = 50%), above 1.0 enlarges it (e.g. 2.0 = 200%). --- Множитель размера watermark. 1.0 = исходный размер (100%). Меньше 1.0 — уменьшение (например 0.5 = 50%), больше 1.0 — увеличение (например 2.0 = 200%).
    watermark_alphaFLOAT1.000–1Watermark transparency. 1.0 = fully opaque, 0.0 = fully transparent. --- Прозрачность watermark. 1.0 = полностью непрозрачно, 0.0 = полностью прозрачно.
    encoder_modeCOMBOautoauto = use NVENC if available, otherwise CPU. nvenc = force NVIDIA NVENC. cpu = force libx264. --- auto = NVENC, если доступен, иначе CPU. nvenc = принудительно NVIDIA NVENC. cpu = принудительно libx264.
    quality_presetCOMBObalancedEncoding quality preset (speed vs quality trade-off). --- Пресет качества кодирования (баланс скорости и качества).

    Outputs (8)

    NameTypeDescription
    video_pathSTRING
    duration_secondsFLOAT
    duration_timecodeSTRING
    file_size_mbFLOAT
    widthINT
    heightINT
    fpsFLOAT
    frames_estINT