Nodes/ComfyUI-BFSNodes/LTXV Apply Neutral Mask
ComfyUI Node

LTXV Apply Neutral Mask

Scrub a region down to flat white, gray, or black before conditioning

By alisson-anjos·Created 5 months ago·Updated 10 days ago· 100
LTXV Apply Neutral Mask
  • image
  • mask
  • image
background
hard_edgestrue

Small node, clear job: wherever mask is set, replace those pixels in image with a flat, boring background - white, neutral_gray, or black. That's it. The reason it exists in this particular pack, per the README, is prep work for the Edit Anything conditioning nodes: before you hand a reference image or a guide frame to something like LTXVEditAnythingLoopingSampler, you sometimes want to strip out whatever's behind or around your subject so the model isn't accidentally conditioning on background clutter it was never supposed to care about.

The two settings that matter

background picks the fill color - white, neutral_gray, or black. Which one you want depends on what your downstream LoRA was trained against; if you don't know, white is the safest default since it's the least likely to read as "meaningful" content to a model (a flat black region can occasionally get interpreted as shadow or negative space, depending on training data).

hard_edges (on by default) controls whether the mask boundary is a clean cut or feathered. Hard edges are usually what you want when you're deliberately trying to signal "this region is blank, ignore it" - a soft edge can leave a faint gradient that still carries some signal into the model.

Required inputs: image, mask, background, hard_edges. One output: image. No batch-size surprises, no extra logic - this is meant to be a quick, composable prep step you drop inline before a conditioning node, not a destination node in itself.

Getting it installed

Through ComfyUI Manager, search "ComfyUI-BFSNodes." Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/alisson-anjos/ComfyUI-BFSNodes.git
cd ComfyUI-BFSNodes
pip install -r requirements.txt

Restart ComfyUI. Nothing extra to download - this is a pure image-processing node, no model or LoRA dependency at all, so it works regardless of which Edit Anything LoRA (or none) you're running downstream.

Where it fits in a real workflow

The obvious pairing is right before LTXVResizeReferenceByMask, the pack's other mask-driven prep node - clean the background first with this node, then resize the now-isolated subject onto a fresh canvas with that one. Together they're a lightweight version of what you'd otherwise do by hand in an image editor: crop out the noise, put your subject on a clean plate, and hand that to the model instead of a busy real-world photo. If your Edit Anything results look like they're picking up unwanted texture or color cast from a reference image's background, this is the node to reach for before assuming the LoRA or the sampler settings are at fault - a lot of "the model is copying the wrong thing" complaints trace back to a reference image that was never actually clean to begin with.

CategoryLTXV/EditAnything

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
maskMASK
backgroundCOMBO3 options: white, neutral_gray, black
hard_edgesBOOLEANtrue

Outputs (1)

NameTypeDescription
imageIMAGE