I've modified layout.lua to support different factory sizes. Factory sizes are now derived from local size variable in each of the generator. Modified layout.lua: https://pastebin.com/sXU1k7Uq
Neat. I should probably do this too in my code, so you have less problems with updates. Note that for me, the size is only the radius of the buildable space, so one less than your size.
That's how it is in my version of modified layout.lua. Feel free to copy paste it. With original radius there should be no difference between modified and original layout.lua. The variables for controlling the radius should probably be moved to config though.