SS Before After Video
Fade and wipe transitions without leaving ComfyUI
- before_image
- after_image
- video_path
- preview_frame
You've got a before and an after - same prompt, two seeds, or a raw render next to its upscale, or a repair next to the original. You want to show the difference without screen-recording your monitor or opening a timeline editor. This node is the whole editor. Feed it two images, pick a fade or a wipe, and it writes a finished H.264 mp4 straight into your output folder.
What it actually is
SSBeforeAndAfterVideo is one of two nodes in the small MrSamSeen pack (the other is the depth-map version, covered on its own page). This one is the no-frills fade/wipe node. There's no diffusion here at all - no checkpoint, no API, no key, no model downloads. It's pure frame rendering plus video encoding, so it runs in seconds and works with anything upstream that produces an IMAGE tensor: a plain Load Image, a VAE decode, an upscaler output, whatever.
It turns the awkward "post a screenshot slider" problem into "drag two images in and share the mp4."
How it works
Both images get resized to your width × height (LANCZOS, so expect stretching if your aspect ratios don't match). Then the node builds a frame list: hold on the "before" for hold_duration, render transition_duration worth of transition frames, hold on the "after." A fade is a plain linear crossfade; a wipe is a sliding mask with a feathered edge, where feather controls how soft that edge is. Flip on loop_transition and it plays the whole thing in reverse and back, which is great for those seamless-loop clips.
Every frame is dumped to a temp folder as a PNG, then ffmpeg encodes them with libx264 and yuv420p - a combination that plays basically everywhere, browsers included. The node returns the full path to the mp4 and a middle frame as a preview. Because it's an output node, preview_frame is really a sanity check, not something you wire onward.
The inputs that matter
- before_image / after_image - two IMAGE tensors. That's it, that's the whole job.
- transition_type -
fade, orwipe_from_left/wipe_from_top/wipe_from_right/wipe_from_bottom. - fps (1–120, default 30) - frame rate of the output; raise it if you're looping, but 30 is plenty for a comparison clip.
- transition_duration (0.5–10s) and hold_duration (0–5s) - how long the transition and the static bookends run.
- feather (0–1) - wipe-edge softness. At 0 the wipe is a hard line, which reads as cheap on anything but a grid; 0.05–0.2 is the sweet spot.
- loop_transition - true for the forward-then-back loop.
- width / height - output resolution, snapped to multiples of 8. Default is 512.
Outputs are video_path (STRING, the full path to the saved .mp4) and preview_frame (IMAGE). Files land in ComfyUI's output folder as filename_prefix_00001.mp4 - filename_prefix is your own label (default before_after_transition) - auto-incrementing so you never clobber an earlier run; output_path lets you nest a subfolder.
Installing it
Both nodes ship in one pack, so the install is shared. Easiest is ComfyUI Manager - search "SS Before After" or ComfyUI_SSBeforeAfterNode. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/MrSamSeen/ComfyUI_SSBeforeAfterNode
pip install -r ComfyUI_SSBeforeAfterNode/requirements.txt
Then restart ComfyUI. The requirements file lists torch, numpy, Pillow, opencv-python, and imageio - you already have the first three, so the real additions are opencv-python and imageio.
One gotcha: the README's clone URL still points at SamSeenX/ComfyUI_SSBeforeAfterNode, but the account was renamed - the live URL is MrSamSeen/.... If a copy-paste of the README 404s, that's why.
Common issues
The big one is ffmpeg. It's not a pip dependency - the node shells out to it, checking which ffmpeg on your PATH, then a local ffmpeg binary in the pack folder, then imageio's bundled copy. If all three come up empty you get a RuntimeError: ffmpeg not found. Fix it at the system level:
# Debian/Ubuntu
sudo apt install ffmpeg
# macOS
brew install ffmpeg
# Windows
winget install ffmpeg
Also: mismatched aspect ratios stretch one of your images, so generate (or crop) both at the same ratio, and keep feather above zero or the wipes look brutal. There are zero community reports to lean on here - this is a tiny, low-traffic pack, and it shows. But the mechanics are simple enough that those two issues are the ones that actually bite.
It's a plain utility, and that's its whole appeal. If ffmpeg is already on your box, this replaces a chunk of fiddly manual shell work for a very common task.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| before_image | IMAGE | — | |
| after_image | IMAGE | — | |
| transition_type | COMBO | fade | 5 options: fade, wipe_from_left, wipe_from_top, wipe_from_right, wipe_from_bottom |
| fps | INT | 301–120 | — |
| width | INT | 51264–4096 | — |
| height | INT | 51264–4096 | — |
| output_path | STRING | /output/ | — |
| filename_prefix | STRING | before_after_transition | — |
| transition_duration | FLOAT | 2.00.5–10 | — |
| hold_duration | FLOAT | 1.00–5 | — |
| feather | FLOAT | 0.100–1 | — |
| loop_transition | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |
| preview_frame | IMAGE | — |