How to generate a sample from a generative model like a Restricted Boltzmann Machine?
For a RBM, you run the stochastic network - forward and back from the "input" and hidden layers - multiple times. After a few steps it will converge into sampling from the data population it has learned from. If you have learned from a whole picture and want to fill in a patch, then hold the input values that are not in the patch (don't allow them to change randomly).

Other generative models may have different approaches. GANs and VAEs typically have a simpler approach where you generate a random input vector and run the generator part of network forward from that input.