EffectErase Object Removal
Delete moving objects from video in ComfyUI — without the per-frame jank
- video_fg_bg
- video_mask
- removed_video
Removing a person, a rig, or a passing car from a video clip used to mean one of two things: hand-painting a mask onto every frame, or per-frame image inpainting that makes the background shimmer and warp because each frame gets fixed in isolation. EffectErase Object Removal - the node behind EffectEraseNode - is the fix for that second problem, and it's the whole reason this pack exists. Give it a video and a mask of the thing you want gone, and it re-renders the masked region with the Wan2.1 1.3B video diffusion model, so the background gets rebuilt once, coherently, across the whole clip instead of frame-by-frame guesswork.
This is a wrapper, and a good one, around research from FudanCVL's EffectErase project, running through DiffSynth-Studio's WanRemovePipeline. The author is up front about that: all the math is the original paper's, the node is the part that makes it usable from a graph. There's no API, no key, nothing cloud-based. Everything downloads to your machine and runs locally.
What you feed it
Two inputs matter, and the rest are knobs:
video_fg_bg(IMAGE) - your frames as a tensor, the way they come out of a Load Video node.video_mask(MASK) - one mask per frame marking the object. This is the node's whole premise: the mask is what tells it what to erase. It finds the first frame where the mask is actually non-empty and builds a square reference crop around that region, which is how the model learns what "clean background" means for your shot.remove_prompt- defaults to "Remove the specified object and all related effects, then restore a clean background." Leave it unless you're fighting a specific artifact.
Worth knowing: the default negative_prompt is in Chinese. It's copied straight from the upstream research repo, and it's a decent quality-tag list ("blurry details, subtitles, extra fingers, distorted…"). You never have to touch it, just don't be surprised when it shows up like that.
Outputs are simpler - a single removed_video IMAGE tensor, same resolution and frame count as the input. Wire it into a Save Video / VHS Video Combine node.
The settings that actually matter
cfgdefaults to 1.0, which looks absurdly low if you're coming from image gen - but Wan is a flow-matching model and that's normal for it. Don't crank it to 7 out of habit; you'll get overcooked, wobbly results.sigma_shift(default 5) tunes the flow schedule if you feel like experimenting.num_inference_steps(default 50) is the quality-vs-speed dial. 30 is a reasonable first cut if 50 drags.use_teacache(default on) is a big free speedup - TeaCache skips redundant diffusion steps. Keep it on.vram_mode(defaultlow_vram) enables DiffSynth's offloading. Combined withtiled(also on by default), the 1.3B model runs on surprisingly modest cards - Wan's 1.3B tier exists for low-VRAM machines on purpose.keep_model_loadedcaches the whole pipeline so the next generation doesn't reload everything. Leave it on unless you need the VRAM back between runs.accel_loralists any Wan acceleration LoRAs sitting inComfyUI/models/loras; attach one ataccel_lora_strengtharound 0.7–1.0 to speed inference up.erase_lora_strengthscales the EffectErase LoRA itself - lower it from 1.0 if the background reconstruction gets too aggressive.dtypeis bfloat16 by default; switch to fp16 if your GPU doesn't handle bf16 gracefully.
One honest caveat: Wan's native context is roughly 81 frames. The node passes your exact frame count through, so short 2–3 second clips are the sweet spot. For long footage, cut it into chunks, process each, and stitch.
Installing it
Easiest via ComfyUI Manager: search "ComfyUI-EffectErase" and install. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/alisson-anjos/ComfyUI-EffectErase
# then restart ComfyUI
Two things happen automatically, and both surprise people:
- On import, it pip-installs its dependencies (modelscope, peft, diffusers and friends) if they're missing.
- On first generation, it downloads the Wan2.1 inpainting model and the EffectErase LoRA into
ComfyUI/models/EffectErase/. That's several gigabytes; the first run will look hung. It isn't.
Two gotchas, both real. First, the shipped requirements.txt doesn't actually list diffsynth - the framework the code imports - so if the auto-install still errors at import, run pip install diffsynth yourself; the node prints essentially that hint. Second, video generation is RAM-hungry in ways image gen isn't: this loads the UMT5-XXL text encoder and the VAE alongside the DiT, and system RAM does real work here. If it's swapping, more RAM helps more than you'd think.
If it dies with out-of-memory or spits out garbled frames, the first moves are vram_mode to high_vram if your card can hold it, fewer steps, or dtype to fp16. And if you don't want to paint a mask at all, the pack's second node - Video Difference Mask - generates one for you from a clean "without object" take.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| video_fg_bg | IMAGE | — | |
| video_mask | MASK | — | |
| remove_prompt | STRING | Remove the specified object and all related effects, then restore a clean background. | — |
| negative_prompt | STRING | 细节模糊不清,字幕,作品,画作,画面,静止,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,杂乱的背景,三条腿,背景人很多,倒着走 | — |
| num_inference_steps | INT | 501–200 | — |
| cfg | FLOAT | 1.00–20 | — |
| sigma_shift | FLOAT | 5.01–15 | — |
| accel_lora | COMBO | 1 options: none | |
| accel_lora_strength | FLOAT | 1.000–5 | — |
| erase_lora_strength | FLOAT | 1.000–5 | — |
| dtype | COMBO | bfloat16 | 2 options: bfloat16, fp16 |
| vram_mode | COMBO | low_vram | 2 options: low_vram, high_vram |
| keep_model_loaded | BOOLEAN | true | — |
| use_teacache | BOOLEAN | true | — |
| seed | INT | 420–18446744073709550000 | — |
| tiled | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| removed_video | IMAGE | — |