Depth map renders obeying transparency

Upon experimenting I noticed cycles does not obey transparency maps when rendering a depth map pass. This will become very handy if one wants to use a depth map to train AI like Stable Diffusion. As it is depth maps seem to only obey geometry.

That’s actually pretty normal for a depth map, as they only contain a single depth value per pixel. You might be able to hack something together with a near and a far render where you mask 2 depth maps using cryptomatte or other holdouts/alphas but I am unaware of a “deep depth” map that has multiple depth values per pixel due to partial transparencies.