The application of green ecological concept in the design of built environment and space layout has become an important direction of modern architectural design. This paper utilizes the Pix2Pix algorithm to read the target plan area map in the design of smart city environment, and carries the algorithm to construct the green space layout design auxiliary model in Unity3D engine and Python language environment. The model is used to realize the simulation display of green space layout design scheme and assist the designer to determine the optimal green layout scheme. The results of the case validation show that the layout optimization scheme obtained with the aid of the green space layout design model adopts the zoned lighting layout design strategy for the public areas, and after the scheme simulation, it is found that the cooling and heating energy consumption in the total environment of the district building decreases from 75.64kWh/m² and 45.26kWh/m² to 65.32kWh/m² and 42.31kWh/m², respectively. In addition, the residents of the neighborhood were highly satisfied with the simulated retrofit effect of the green layout design of the buildings in the neighborhood. This study promotes the consideration of environmental protection and sustainable development in urban design, which can reduce the negative impact of smart city construction on the environment and create a healthier and livable spatial environment.