🎬AGSoft Video Overlay
Burn text and watermarks onto video, positioned by expression
- video_path
- duration_seconds
- duration_timecode
- file_size_mb
- width
- height
- fps
- frames_est
🎬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_textplusfont_name(from the pack's ownfonts/folder - the default(none)means no text, so you must pick a font),font_colorfrom a preset palette of FFmpeg/X11 color names,font_alpha(1.0 = opaque), andfont_size. - Image watermark -
watermark_pathpointing at a PNG (transparency recommended),watermark_scaleas a size multiplier, andwatermark_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 defaulttext_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_path → ComfyUI/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).
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| video | STRING | Input video path. Connect a path loader (the widget auto-converts to an input socket on link drop) or type an absolute path manually. --- Путь входного видео. Подключите загрузчик пути (виджет сам станет сокетом при дропе линка) или введите абсолютный путь вручную. | |
| output_name | STRING | overlay_video.mp4 | Output filename. The extension is kept as entered (.mp4 by default). --- Имя итогового файла. Расширение сохраняется как введено (по умолчанию .mp4). |
| output_path | STRING | Output directory. If empty, ComfyUI/output is used. --- Папка сохранения. Если пусто, используется ComfyUI/output. | |
| overlay_text | STRING | Text to draw over the video. Requires a font other than (none). --- Текст поверх видео. Нужен шрифт, отличный от (none). | |
| font_name | COMBO | (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_color | COMBO | white | Text color from a preset palette (FFmpeg/X11 color names). --- Цвет текста из готовой палитры (имена цветов FFmpeg/X11). |
| font_alpha | FLOAT | 1.000–1 | Text transparency. 1.0 = fully opaque, 0.0 = fully transparent. --- Прозрачность текста. 1.0 = полностью непрозрачно, 0.0 = полностью прозрачно. |
| font_size | INT | 484–500 | Text font size in pixels. --- Размер шрифта текста в пикселях. |
| text_x | STRING | 20 | Drawtext X expression. Examples: 20, (W-tw)/2, W-tw-20. --- Выражение координаты X текста. Примеры: 20, (W-tw)/2, W-tw-20. |
| text_y | STRING | H-th-20 | Drawtext Y expression. Examples: 20, (H-th)/2, H-th-20. --- Выражение координаты Y текста. Примеры: 20, (H-th)/2, H-th-20. |
| watermark_path | STRING | Optional path to a watermark image (PNG with transparency recommended). --- Опционально: путь к изображению watermark (рекомендуется PNG с прозрачностью). | |
| watermark_x | STRING | W-w-20 | Overlay X expression. Example: W-w-20 (top-right with margin). --- Выражение координаты X. Пример: W-w-20 (справа вверху с отступом). |
| watermark_y | STRING | 20 | Overlay Y expression. Example: 20. --- Выражение координаты Y. Пример: 20. |
| watermark_scale | FLOAT | 1.000.05–10 | Watermark 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_alpha | FLOAT | 1.000–1 | Watermark transparency. 1.0 = fully opaque, 0.0 = fully transparent. --- Прозрачность watermark. 1.0 = полностью непрозрачно, 0.0 = полностью прозрачно. |
| encoder_mode | COMBO | auto | auto = use NVENC if available, otherwise CPU. nvenc = force NVIDIA NVENC. cpu = force libx264. --- auto = NVENC, если доступен, иначе CPU. nvenc = принудительно NVIDIA NVENC. cpu = принудительно libx264. |
| quality_preset | COMBO | balanced | Encoding quality preset (speed vs quality trade-off). --- Пресет качества кодирования (баланс скорости и качества). |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |
| duration_seconds | FLOAT | — |
| duration_timecode | STRING | — |
| file_size_mb | FLOAT | — |
| width | INT | — |
| height | INT | — |
| fps | FLOAT | — |
| frames_est | INT | — |