There’s an interesting approach similar to this called Wave Function Collapse [1] (no relation to wfc in physics besides inspiration). It can infer the probabilistic constraints from one input example, and it seems to generalize quite well. Here’s a little demo: https://oskarstalberg.com/game/wave/wave.html
[1] https://github.com/mxgmn/WaveFunctionCollapse