ComfyUI-RotoTools
Roto / alpha-matte helper nodes for ComfyUI: save an RGBA image sequence as one TGA zip named after the source video, batch-load a folder of folders of videos, and a spec readout (size / frames / fps).
ComfyUI-RotoTools
Small, focused nodes for roto / alpha-matte workflows in ComfyUI (built around LTX alpha-gen, but they work with any IMAGE batch).
Nodes
Save Image Sequence (TGA, RGBA) — image/save
Saves an IMAGE batch as numbered TGA frames, keeping a real alpha channel when the batch is RGBA (feed it from Join Image with Alpha).
- One zip instead of thousands of loose files (
save_as_zip, on by default). - Zip named after the source video: connect the Load Video node to
source_videoandclip.mp4becomesclip.zip. Without it,filename_prefixis used. - One folder for every zip: type or paste
output_folderonce; every run drops its zip there. - Never overwrites an earlier result unless you turn
overwriteon (_v2,_v3...). If the old zip is open in Explorer / 7-Zip, the new one is saved under a new name instead of failing. - Zip is written to
*.zip.partand renamed when complete, so a crash never leaves a half-written zip that looks finished. - Lossless RLE compression option, start number, zero padding, and a transparent preview of a few frames on the node.
- Optional
zip_nameinput: an exact zip name from another node (wins oversource_video). - Turn
save_as_zipoff to get loose.tgafiles.
Spec Readout (size / frames / fps) — image/monitor
Drop it at any stage of a workflow to see W x H | frames | fps | seconds printed on the node itself while the graph runs.
Optional padding check (width/height multiple of 32, frames = 8n+1) and an optional compare_to input that shows MATCHES / MISMATCH against another batch (for example the original clip).
Load Video Batch (Folders) — image/video
Built for hundreds of clips in one go. Give it one or more folders; every video in their sub-folders is found automatically (natural sort, so shot2 comes before shot10) and one video per run is sent on as a VIDEO.
batch_folder = x\ep93, x\ep94 output_folder = D:\rotos
x\ep93\shot1\shot1.mp4 -> D:\rotos\ep93\shot1.zip
x\ep94\shot1\shot1.mp4 -> D:\rotos\ep94\shot1.zip
y\ep93\shot1\shot1.mp4 -> D:\rotos\ep93 (y)\shot1.zip (another folder named ep93)
Adding folders (any mix of drives):
- + Add folders… on the preview opens the normal Windows folder dialog (macOS / Linux: the system one). Ctrl / Shift click to pick several. Open it again to add more from another drive; folders already in the list are not added twice.
- ✕ remove on a folder's header takes it out of the batch; Clear empties the list (nothing is deleted on disk).
- Or type / paste into
batch_folder: one folder per line or comma separated. Explorer's Copy as path (select the folders, Ctrl+Shift+C) can be pasted as is. - The dialog opens on the computer running ComfyUI. Dragging folders onto the node is not possible: browsers never give a web page the full path of a dropped folder.
Single videos (no folder needed), mixed freely with folders:
- Drop video files onto the node. Like the normal Load Video, each dropped video is copied once into
ComfyUI\input\rototools_dropsand that copy is used. The same video dropped again reuses its copy. - Or list video files in
batch_folderlike folders (no copy is made). - Their zips go straight into the save folder:
SAVE FOLDER\clip_a.zip. Two videos with the same name from different places becomeclip_aandclip_a (misc)(misc = the folder the second one sits in), and each keeps its zip name from run to run. - ✕ on a single video's tile (hover) takes it out of the batch; ✕ remove all on the Single videos header removes them all.
batch_folder = D:\clips\clip_a.mp4 output_folder = D:\rotos
x\ep93
D:\clips\clip_a.mp4 -> D:\rotos\clip_a.zip
x\ep93\shot1\shot1.mp4 -> D:\rotos\ep93\shot1.zip
- Replace Load Video with this node and connect
videowhere Load Video went. - Connect
zip_nameto the saver'szip_nameinput andzip_folderto the saver'soutput_folder. Each input folder gets its own folder insideoutput_folder, named after it; zips are named after the video file. Another input folder with the same name gets its location added:y\ep93becomesep93 (y). Each output folder remembers its input folder (a hidden.rototools_sourcefile), so a folder keeps the same output folder from run to run, whether it is batched with the other ep93 or on its own. The preview shows the full path of each. Two videos with the same name inside one folder becometake,take_2. - Leave
indexon increment and set Run's batch count to the number of videos (shown on the preview bar; a slim "Last run: n / total …" line under it shows where the batch is). ComfyUI queues them one after another. - Resume: with
skip_if_zip_existson, any video whose zip is already in its folder is skipped quickly, so re-queueing after a crash or a stop only does the missing ones.
Preview grid: the node shows a thumbnail of every detected video, grouped per input folder (with its full path and output folder). Hover a tile to play it, click it for a full view in the node (✕ to go back to the grid). Resize the node or use the slider to change the tile size. ✓ = zip already exists; the yellow frame is the video of the last run. Videos the browser cannot play (some .mov/.mkv/.avi codecs) still get a thumbnail.
Outputs: video, zip_name, video_path, index, total, zip_folder.
Install
Comfy Registry / ComfyUI-Manager (once published): search for RotoTools in ComfyUI-Manager, or run comfy node install rototools.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/dipto8103/ComfyUI-RotoTools
Restart ComfyUI. No extra dependencies (uses Pillow and NumPy, which ComfyUI already ships).
Notes on alpha
TGA stores straight (non-premultiplied) alpha. Make sure the alpha you feed into Join Image with Alpha has the direction your matte uses (ComfyUI's node treats its input as an inverted mask, so pass an inverted mask if your matte is white = subject).
Development
pip install -r requirements-dev.txt
pytest
The tests stub folder_paths, so ComfyUI itself is not needed.
Versions
Semantic Versioning. See CHANGELOG.md; maintainers see RELEASING.md.
License
MIT, see LICENSE.