Nodes/ComfyTV/← ComfyTV Mask
ComfyUI Node

← ComfyTV Mask

← ComfyTV Mask — turn a ComfyTV image's alpha into a real MASK tensor

By jtydhr88·Created 3 months ago·Updated about 16 hours ago· 725
← ComfyTV Mask
  • image
  • MASK

Masks are how you tell an image pipeline "only touch here," and ComfyTV has its own way of carrying them: inside the alpha channel of a COMFYTV_IMAGE. BridgeFromMask exists to turn that back into a real MASK output - the native tensor type every ordinary ComfyUI inpainting, compositing, and masking node wants.

Here's the mechanism, because it's subtle and it decides whether this node works for you. The bridge takes a COMFYTV_IMAGE input, reads the image's alpha channel, and outputs 1 − alpha as the mask. That inversion is deliberate - ComfyUI masks are conventionally "1 = keep, 0 = discard," while alpha is "1 = opaque." So an opaque region in ComfyTV becomes a 0 in the mask, and a transparent region becomes a 1. If that feels backwards, it's because alpha and mask conventions are mirror images of each other, and the bridge is doing the flip for you. Feed it a ComfyTV image that carries transparency (cutout output, a masked edit, a PSD-style composite) and you get a usable mask on the other side.

The honest caveat, and it's a real one: if the source image has no alpha channel at all - a plain generated image, say - the mask comes back as all zeros. Which is to say, an empty mask. The code literally initializes the mask to zeros when the image has no alpha, rather than guessing "everything should be selected." So the rule is: this node is for images that already encode a selection in their alpha, not for generating a mask from an arbitrary image. Need a mask created? Use the masking/cutout tools on the image side first, then bridge the result.

One input (image, a COMFYTV_IMAGE), one output (MASK), zero parameters. It's the rarest of the three audio/image bridges in practice, but when you need it - you've done a cutout in ComfyTV and now want to feed that selection into a third-party inpaint node - it's the only way to cross the boundary without re-drawing the mask by hand.

Install is the pack-wide story: ComfyUI Manager search "ComfyTV", or git clone https://github.com/jtydhr88/ComfyTV into custom_nodes/, then a full backend restart (Desktop/macOS: clone by absolute path into the running instance). Zero extra pip dependencies - PIL and numpy, both already in ComfyUI, no models.

CategoryComfyTV/Bridge

Inputs (1)

NameTypeDefaultDescription
imageCOMFYTV_IMAGE

Outputs (1)

NameTypeDescription
MASKMASK