I had to do something similar for my project. This current implementation is in blueprint, with a C++ Scene Capture Component, but it works ok.
This is done on Begin Play, and then whenever needed, my portrait widget can access “Portrait Texture” and I use it to set a Texture parameter value on my portrait material.
There are probably better solutions but this worked for me as a starting point.