PixelMatte: precise photo object extraction using diffusion transformers
2 min readupdated
PixelMatte tackles image matting by predicting an alpha mask based on the source photo and a trimap (a rough mask dividing the image into background, foreground, and unknown regions). Built on a pixel-space diffusion transformer architecture without a variational autoencoder (VAE), the model enables single-pass evaluation. The repository features two versions: HiDream-8B (based on HiDream-O1-Image) and PRX-7B (based on PRX). This tool is useful for designers, developers, and computer vision researchers looking for high-quality background removal and image processing.
Key features
- Predicts the alpha mask in a single network pass without needing a text encoder or VAE.
- Two model versions available: HiDream-8B (supporting a 2048-pixel input side) and PRX-7B (supporting a 1024-pixel input side).
- Weights are stored in the bfloat16 format and include a backbone, LayerShift, and High-Pass Refiner.
- Released under the permissive Apache License 2.0.
What you can do
- Integrate the model into an image processing pipeline for high-precision separation of the foreground from the background.
- Build a Python script for batch background removal using photos and trimaps.
- Test and compare the performance of HiDream-8B and PRX-7B on complex studio shots.
Example
from PIL import Image
from pixelmatte import PixelMattePipeline
pipe = PixelMattePipeline.from_pretrained("WhiteYC/PixelMatte", subfolder="HiDream-8B")
alpha = pipe(Image.open("photo.jpg"), Image.open("trimap.png"))
Read more
DetailsArchitecture: pixel-space diffusion transformers.
Versions: HiDream-8B (based on HiDream-O1-Image) and PRX-7B (based on PRX).
Inputs: source image and trimap (0 for background, 255 for foreground, 128 for unknown region).
License: Apache License 2.0.










Comments