Qwen Image 2.1: Inconsistent Alpha Channel
retained text
There was a [discussion](https://www.reddit.com/r/StableDiffusion/s/8myBZgelvP) a while ago about the alpha channel in the model's outputs. While half of the comments missed the entire point, one person said "PNG should trivially compress an empty alpha channel to nothing". I don't know if that's true, but it made me ask a question: Is it really empty? Turns out: **Alpha channel is not empty, and it's a mess.** The model's output will mostly always have a noisy alpha channel no matter the instructions. I wrote a script that receives the image and creates a map based on the pixels' alpha values: * Alpha 0 (completely transparent) = Black * Alpha 1 = Dark aqua * Alpha 2-127 = Green * Alpha 128-253 = Red * Alpha 254 = Light pink * Alpha 255 (opaque) = White Looks like the model struggles with absolute 0 and 255 values due to diffusion nature. I used AI to create a [custom node](https://github.com/TheObserver-000/ComfyUI-Clean-Alpha) to fix this issue. it checks every pixel and changes their alpha value to either 0 or 255 if they exceed the thresholds. It even removes the alpha channel if all alpha values are 255. prompts: >Cinematic photography captured with an 85mm portrait lens at f/2.8 to produce a shallow depth of field. A Formula 1 racing car occupies the center frame. It speeds forward along a paved circuit. The vehicle displays sleek aerodynamic bodywork, matte carbon fiber panels, and crisp sponsor decals across its chassis. The track curves through the background while grandstands and safety barriers dissolve into heavily blurred soft bokeh circles. Natural daylight illuminates the scene evenly with a gentle focus aesthetic. The image applies a Kodak Portra 400 film color grade featuring warm highlights, neutral shadows, and subtle contrast for a classic analog finish. >This is an RGBA format image with transparency. Remove the background and make it transparent. The image has an alpha channel. Edit: Looks like the VAE plays an important part in this issue. I'm not sure how much the model itself contributes to it.
document fetched 2026-09-27 00:32 · canonical https://reddit.com/r/StableDiffusion/comments/1wqkcy7/qwen_image_21_inconsistent_alpha_channel