http://kesen.realtimerendering.com (if you've never come across it) has links to papers from most of the major graphics conferences, including links to author's pages. Many of those pages have source code.

A couple of quick probes using the search term '"wang tiles for image and texture generation" cohen' (the name of one of the early papers on the subject + the name of first author) led to this and other implementations: http://www.robburke.net/mle/wang/