How do I use a map or node as a mask? I want to use an AO node as a mask for a different texture, as in I want the AO node to be a factor for 100% opacity in the white areas and lower in the dark until full black equals zero.

Im not talking about using a stencil or anything to do with texture painting as I want this to be procedural.  

How would you set up a mask using nodes?

https://preview.redd.it/h8czrfosnw141.png?width=1362&amp;format=png&amp;auto=webp&amp;s=73506d0f8cabd3f4b27a7bcd8b08795a5531a9fb

Ive been trying to use the Mix RGB as a mask the only issue is it washes the colors out. 

So lets say I have this brick texture  and I want to control its opacity based on an image texture or a AO node so I made an AO node with a color ramp to include a white and black area. I want pure black to be zero opacity pure white to be 100% opacity. So the face should be all brick and the dark parts of the neck should have nothing under it right?





I mix the two using the AO as a foreground and fac, and the background is  the brick. It works sort of but the colors are washed out and I would like the AO to be nothing but an alpha mask but the black values still stay. Ive used every blend type with similar results and ive used both color and aplha from the AO color ram as my mix node fac.  

The best example I can give is doing this in Substance painter is pretty simple I have my AO map

And then I have just a red fill layer under it and the AO black areas are used for opacity. I basically just want this kind of masking with a Blender node set up
Your nodes setup is not good, you're actually mixing a grey color (in the MixRGB Color1 socket) with your brick pattern, it gives a grey brick pattern. Also you should put a Diffuse before your Output. I propose this solution which uses the AO as a mask between your brick pattern and the dark color you want to give in the folds of the shape: