How to perform this material function in Blueprint and save it as a texture?

I’m trying to convert a material function into a blueprint to try and save the output as a texture.

I have this material function that takes an annotation texture, then filters one color and gives the output as a black and white mask

This is the material function:

Any way to get the output of this in BP and save it for further use?