comfyui-slapshot Introduction
comfyui-slapshot adds four Slapshot processing nodes to ComfyUI: Rotoscoping, Depth Map, Tracking, and Motion Vectors. Each node sends a video to the Slapshot (https://slapshot.ai) service, reports when the job is complete in your ComfyUI graph, and provides a button to download the result.
These tools help with different parts of a video project. Rotoscoping separates a subject from its background with per-frame mattes. Depth Map produces depth information from a video. Tracking analyzes camera movement. Motion Vectors generates motion data and can focus on a region you identify. You can use the node that matches the result you need without setting up a separate submission workflow for each task.
All four nodes accept a source video in .mp4 or .mov format. They also let you retrieve the result of an earlier Slapshot job by entering its job ID, so you do not have to submit the same job again just to download it.
How comfyui-slapshot Works
Think of each node as a link between your ComfyUI graph and a Slapshot processing job:
- Connect a source video to the node for the task you want to perform.
- Add any optional inputs, such as reference masks or camera details.
- Run the graph. The node uploads the video and submits the job to Slapshot.
- When processing finishes, use the node’s enabled download button to get the result.
The downloaded result depends on the node. For example, Rotoscoping offers mattes for the video’s frames, while Depth Map offers a depth-map download in the format you selected.
Returning to an earlier job: Every node has a job ID field and a Download Previous Job Result button. If you have a job ID from an earlier run or the Slapshot dashboard, paste it into the field and click the button. The node retrieves the download link, starts the download, and enables that job’s download buttons. An earlier result is available only in the format chosen when the job was originally submitted.
API key
You need a Slapshot API key to submit jobs. To get one, sign in or create an account at app.slapshot.ai (https://app.slapshot.ai/), open your profile, select ComfyUI under INTEGRATIONS, and click Generate API Key. The original documentation describes two places to set the key: a .env file in your ComfyUI root directory or a config.ini file in the comfyui-slapshot plugin directory. Restart ComfyUI after setting it. If both files contain a key, the .env value takes precedence.
If you add a Slapshot node without a detected API key, the extension displays a dialog with a Get API Key button that opens the ComfyUI integration settings page.
comfyui-slapshot Features
Rotoscoping
The Slapshot — Rotoscoping node automates submission and retrieval of a rotoscoping job. Connect a .mp4 or .mov video, then optionally provide up to ten reference mask images through mask_00 to mask_09. These masks give the job reference frames for the areas you want masked.
Each reference mask must be loaded from a file whose name is a five-digit frame number, such as 00014.png. Once inference completes, you can choose between:
- Download Hard Mattes: Binary alpha masks, with a per-frame separation between masked and unmasked areas.
- Download MB Mattes: Motion-blur-aware mattes, intended for footage where a crisp edge may not represent a moving subject well.
For example, if you need a clear-cut mask for each frame, start with the hard mattes. If the footage contains visible motion blur, the MB mattes provide an alternative designed for that condition.
Depth Map
The Slapshot — Depth Map node generates depth-map output from a .mp4 or .mov video. Its export_type setting controls the download format:
| Setting | Result |
|---|---|
JPG | Downloads the depth-map result in JPG format. This is the default. |
MOV | Downloads the depth-map result in MOV format. |
Choose the format that fits the next stage of your project before submitting the job. After inference, click Download Depth Map.
Tracking
The Slapshot — Tracking node runs camera tracking on a .mp4 or .mov video. You can leave all camera fields blank or supply information you know about the shot. After inference, click Download Tracking Data.
| Input | What it means |
|---|---|
working_fps | The working frame rate, such as 24.0. |
lens | The lens focal length in millimeters. |
fix_focal_length | False (default) leaves focal length floating; True treats it as fixed. |
sensor_width and sensor_height | Camera sensor dimensions in millimeters. If you set one, you must set the other. |
fix_sensor_size | True (default) treats sensor size as fixed; False leaves it floating. |
estimated_closest_point | An approximate distance, in meters, from the camera to the closest point being tracked. |
estimated_farthest_point | An approximate distance, in meters, from the camera to the farthest point being tracked. |
calculate_distortion | False by default. Set to True to calculate lens distortion as part of the camera solve; the export then includes ST maps for the distortion used. |
A rough estimate is sufficient for the closest and farthest point settings. If you know the camera’s lens and sensor measurements, you can enter them; if you do not, those fields are optional.
Motion Vectors
The Slapshot — Motion Vectors node generates motion-vector data from a .mp4 or .mov video. You can optionally connect one ROI Mask image. “ROI” means region of interest: use a black-background image with the area you want to identify colored in.
The mask must be loaded from a file named with a five-digit frame number, such as 00034.png. The filename also determines the keyframe automatically: 00018.png, for example, selects keyframe 19. After inference, click Download Motion Vectors.
Troubleshooting comfyui-slapshot
A node says no API key was found. What should you do?
- Use the node’s Get API Key button, or visit app.slapshot.ai (https://app.slapshot.ai/) and generate a key from Profile → INTEGRATIONS → ComfyUI.
- Check that you placed the key in the
.envfile in your ComfyUI root directory or inconfig.iniin the plugin directory. - Restart ComfyUI. If you set keys in both places, check the
.envkey first because it takes precedence.
Why is a download button unavailable?
The result download buttons are enabled after inference completes. For an earlier job, enter its job ID and click Download Previous Job Result to retrieve the result and enable the relevant buttons.
Can you download a previous job in a different format?
No. Previous-job downloads are available only in the format selected when that job was originally submitted. For example, choosing JPG for a Depth Map job does not make a MOV version of that same job available later.
Why should you check a reference mask’s filename?
Rotoscoping reference masks and Motion Vectors ROI masks must come from files named with five-digit frame numbers, such as 00014.png. For Motion Vectors, that number also determines the keyframe. Check the filename before loading a mask if it is not being used as you expect.
Can you enter only one camera sensor dimension for Tracking?
No. sensor_width and sensor_height are optional, but they must be provided together. If you do not know both measurements, leave both fields unset.
Do you need camera details to run Tracking?
No. All camera fields are optional. Add the values you know about your footage, and leave the others blank.
Learn More about comfyui-slapshot
- Slapshot (https://slapshot.ai): Learn about the service that processes the video jobs submitted by these nodes.
- Slapshot app (https://app.slapshot.ai/): Access your account, find the ComfyUI integration settings to generate an API key, and obtain a job ID from the dashboard when you need to retrieve an earlier result.
