ComfyUI_SSBeforeAfterNode

ComfyUI_SSBeforeAfterNode
★ 2

视频过渡深度图支持FFmpeg集成视觉对比
为ComfyUI提供两个节点,用于生成前后对比过渡视频,支持普通与深度图过渡、可调分辨率/帧率、FFmpeg编码与进度追踪,便于视觉对比与创意变换。
💡 在ComfyUI中将两张图片生成带深度感或普通的前后对比过渡视频。
🍴 2 Forks💻 Python🔄 2026-01-05
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/f414772aa5c3
📦 requirements.txt
torch
numpy
Pillow
opencv-python
imageio
📄 README

ComfyUI SS Before After Node

[](LICENSE)

[]()

Create stunning before-and-after transition videos directly in ComfyUI.

This repository provides two powerful custom nodes for ComfyUI to create stunning before-and-after transition videos. These nodes are designed for visual comparisons, transformations, and creative effects, supporting both standard and depth map-based transitions.

✨ Features

  • 🔄 SSBeforeAndAfterVideo – Create videos with fade and wipe transitions between two images.
  • 🌌 Depth Map Support – Create depth-aware transitions (SSBeforeAndAfterVideoWithDepthMap) for immersive effects.
  • 🎬 Customizable Output – High-quality output with custom resolution, fps, feathering, and looping.
  • FFmpeg Integration – Robust video encoding.
  • 📊 Progress Tracking – Built-in progress bar for frame generation.
  • 🚀 Quick Start

    Prerequisites

  • ComfyUI installed
  • FFmpeg installed and available in system PATH
  • Installation

  • Go to your ComfyUI custom nodes directory:
  • “`bash

    cd ComfyUI/custom_nodes

    “`

  • Clone this repository:
  • “`bash

    git clone https://github.com/SamSeenX/ComfyUI_SSBeforeAfterNode.git

    “`

  • Install dependencies:
  • “`bash

    pip install -r ComfyUI_SSBeforeAfterNode/requirements.txt

    “`

  • Restart ComfyUI.
  • Basic Usage

  • Add the node SSBeforeAndAfterVideo or SSBeforeAndAfterVideoWithDepthMap to your workflow.
  • Connect your before_image and after_image inputs.
  • Configure parameters (transition type, duration, FPS).
  • Run the workflow.
  • 📖 Documentation

    Node 1: SSBeforeAndAfterVideo

    Creates before-and-after transition videos using classic fade and wipe effects.

    Parameters:

  • transition_type: fade, wipe_from_left, wipe_from_top, etc.
  • transition_duration: 0.5 – 10.0 seconds.
  • feather: Softness of the wipe edge (0.0 – 1.0).
  • Node 2: SSBeforeAndAfterVideoWithDepthMap

    Creates transitions using a depth map, revealing images based on depth (e.g., back-to-front).

    Parameters:

  • depth_map: Input depth map image.
  • transition_type: back_to_front, front_to_back, middle_out.
  • easing_method: Smoothness of the transition.
  • 🏗️ Project Structure

    ComfyUI_SSBeforeAfterNode/
    ├── ss_before_after_video.py            # Basic node logic
    ├── ss_before_after_video_with_depth.py # Depth-aware node logic
    ├── requirements.txt                    # Python dependencies
    └── README.md

    🤝 Contributing

    Contributions are welcome!

  • Fork the repository
  • Create your feature branch
  • Commit your changes
  • Push to the branch
  • Open a Pull Request
  • 📝 License

    This project is licensed under the MIT License – see the LICENSE file for details.

    ☕ Support

    If you find this project useful, please consider supporting me:

  • ⭐ Starring this repository
  • 🐛 Reporting issues
  • Buy me a coffee

  • Created with ❤️ by SamSeen