This is really cool! Is the source available anywhere? I've been looking into implementing this myself and would be really interested in seeing how you did this.
Viewing post in Wave Function Collapse in Godot comments
Source of this particular implementation is not available, it’s messy, slow and not optimized, and there are still one bug I couldn’t fix.
If you want to implement WFC, I would rather suggest directly porting original source code rather than writing from scratch as I did: https://github.com/mxgmn/WaveFunctionCollapse