Multipartite entanglement generation assisted by inhomogeneous coupling