Nodes Browser
ComfyDeploy: How ComfyUI-Background-Edit works in ComfyUI?
What is ComfyUI-Background-Edit?
ComfyUI nodes for editing background of images/videos with CUDA acceleration support.
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
ComfyUI-Background-Edit
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI-Background-Edit
ComfyUI-Background-Edit is a set of ComfyUI nodes for editing background of images/videos with CUDA acceleration support.
Supported use cases:
- Background blurring
- Background removal
- Background swapping
The CUDA accelerated nodes can be used in real-time workflows for live video streams using comfystream.
- ComfyUI-Background-Edit
- Install
- Example Real-Time Live Video Workflows
- Example Image Workflows
- Nodes
Install
Prererquisites
- Install comfy-cli
The recommended installation method is to use the Comfy Registry.
Comfy Registry
These nodes can be installed via the Comfy Registry.
comfy node registry-install comfyui-background-edit
ComfyUI-Manager
These nodes can be installed via ComfyUI-Manager in the UI or via the CLI:
comfy node install comfyui-background-edit
Manual
These nodes can also be installed manually by copying them into your custom_nodes
folder and then installing dependencies:
cd custom_nodes
git clone https://github.com/yondonfu/ComfyUI-Background-Edit
cd ComfyUI-Background-Edit
pip install -r requirements.txt
Example Real-Time Live Video Workflows
Prerequisites
- Install ComfyUI-Depth-Anything-Tensorrt.
- The example workflow uses TensorRT to accelerate DepthAnything2 to meet real-time requirements.
The workflow (API format) can be used with comfystream to run real-time background blurring on a live video stream.
The workflow can also be saved and dropped into ComfyUI to load the workflow for further modifications.
Example Image Workflows
Prerequisites:
- Install ComfyUI-DepthAnythingV2.
The following example workflows are applied to this input image:
The output images can be saved and dropped into ComfyUI to load the workflows that created them.
Background Blurring
Background Removal
Background Swapping
This output just shows the background being swapped to a solid blue color, but in theory the background could be any image of your choice!
Nodes
| Node | Description | | --------------- | ----------------------------------------------------------------------------------------------------------- | | BackgroundColor | Creates black/red/green/blue images with same dimensions as input images. | | Composite | Creates composites of input foreground images, background images and foreground masks (CPU/CUDA supported). | | GaussianBlur | Applies gaussian blur to input images (CPU/CUDA supported). |