The application of 5G communication technology and ultrawideband technology in animation design has gradually improved the level of animation special effects design, and made the style transfer algorithm a research hotspot. The original two-dimensional animation special effects design cannot solve the problem of special effects optimization, and the special effects after optimization are poor. Therefore, this paper proposes a style transfer algorithm based on 5G communication to optimize and analyze the design of two-dimensional animation special effects. Firstly, ultra-wideband communication technology and animation technology are used to obtain the design parameters of animation special effects, and the design scheme is transformed through style transfer , and judge the special effects scheme according to the animation characteristics, and discard irrelevant 3D information. Then, according to the ultrawide communication technology, the change rate and display effect of the special effect are analyzed, and compared with the actual reception effect, and adjusted Parameters and indicators for 2D animation special effects design. The special effect design results show that under the conditions of 5G network and ultra-wide communication, the style transfer algorithm can improve the realization effect of animation special effects. The lifting rate is greater than the actual design requirements, which can meet the needs of special effects design.