Nodes/PhotoRoom Nodes by Discopixel/Remove Background with Photoroom
ComfyUI Node

Remove Background with Photoroom

Zero-VRAM background removal that bills you per image

By discopixel-studio·Created 3 years ago·Updated 2 years ago· 13
Remove Background with Photoroom
  • images
  • IMAGE
  • MASK
api_key

"Remove Background with Photoroom" is the one node in the Discopixel pack that actually ships active, and it's a different breed from almost everything else you'll install: it's an API client, not a model loader. You paste in a Photoroom API key, ComfyUI uploads your image to Photoroom's servers, and you get back a cutout and a mask. No weights to download, no VRAM to burn, and no free lunch - the README is upfront about it: "Sometimes you just need a higher quality and more automatic background removal than what's available opensource."

When you'd reach for it

Photoroom is a commercial product-photography service, and this node inherits that: its segmentation model is tuned for cleanly cutting products and people out of shots, which is exactly the "just works, every time" job where local open models can still fumble on hair. It's the right tool when you're batch-processing e-commerce shots and don't want to babysit edges.

It's also the wrong tool for a surprising number of people, and it's worth saying that out loud. Since May 2026 ComfyUI ships BiRefNet natively in a models/background_removal/ folder - free, local, and the community default for hard edges. If you're not already paying Photoroom, the local path is almost certainly better for your money and your privacy. The honest use case for this node is: you already have a Photoroom account (or want their specific model quality), you need zero local footprint, or you're on a machine where you'd rather spend $ than VRAM. As a hobbyist one-off, it's a curiosity.

How it works

The mechanism is short enough to read in full. The node takes your image, saves it to a PNG buffer, and POSTs it to https://sdk.photoroom.com/v1/segment with your key in an x-api-key header. Photoroom returns a PNG with an alpha channel, and the node splits it: the RGB goes to the IMAGE output and the alpha channel becomes the MASK output. It loops over batched inputs, one API call per image.

Here's the gotcha that bites everyone the first time: the IMAGE output has no transparency. Transparent pixels get flattened to black in the RGB result, so if you preview the image output alone you'll see your subject on a black slab. The transparency lives entirely in the MASK. To put the subject on a new background you composite them yourself - stick both into a blend/composite node (Impact Pack's ImageComposite or core Blend will do) and drive the mask.

The inputs

There are only two, and both are required:

  • images (IMAGE) - any image you've generated or loaded. It's batch-aware: a batch of ten means ten separate API calls.
  • api_key (STRING) - your Photoroom API key, pasted as a string. The default is empty, so running it without a key just fails.

That's the whole knob set. The only thing a beginner actually sets is the key.

Installing it

The normal two ways:

# ComfyUI Manager: search "PhotoRoom Nodes by Discopixel" (or "Discopixel")
# and click install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/discopixel-studio/comfyui-discopixel
pip3 install -r requirements.txt

Restart ComfyUI after. It's also published to the Comfy Registry at registry.comfy.org/publishers/discopixel. Good news on dependencies: requirements.txt is a single line (opencv-python), and the actual HTTP work rides on requests and Pillow, which ship with ComfyUI. Nothing heavy, no model files - by design, since the model is someone else's computer.

Troubleshooting

  • No key or a bad one → Photoroom returns a 401, the node prints Photoroom Error: ... to the console, and then crashes trying to open the empty result. The console message is the clue; double-check the key isn't pasted with whitespace.
  • You're being billed per call. A batch of ten images is ten requests. If you're on a metered plan, keep batches honest.
  • It needs the internet at runtime, which is worth stating plainly for a node that otherwise looks like a local filter.
  • Privacy: your images leave the machine. Don't run client photos or anything sensitive through it.
  • Photoroom's API historically had a small free allowance, but pricing drifts - check their current plan before building a workflow around it.

If all you want is a cutout and you're okay running a model locally, skip the key and use the built-in BiRefNet nodes. If you need Photoroom's quality at scale and someone else is paying, this node is a clean, tiny wrapper that just works.

CategoryDiscopixel

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
api_keySTRING

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK