Integration of controllable deformation with excellent thermal stability, mechanical, and insulation properties can greatly expand the versatility of smart polyimides (PIs). However, the unique molecular structure of PI makes it difficult for its molecular chain to move, which is not conducive to the reversible transformation of highly stable PI under environmental conditions. In this study, a PI film integrating shape memory and photo deformation is prepared by constructing a chemical network with PI oligomer as the hard, hexamethylene diisocyanate (HDI) as the soft, and azobenzene as the functional chain segment. The PI films still have a high glass transition temperature Tg ~ 225°C, a high Young's modulus E ~ 3.5 GPa, and a good breakdown strength Eb ~ 176 kV/mm. Moreover, as the network point of the chemical network, the trifunctional crosslinking agent makes the PI produce the shape memory effect induced by light and heat. UV light can drive crosslinked photoresponsivity PI film to have special shape transformation under specific conditions, using azobenzene as photoresponsivity group. This study provides a new idea for the preparation of multifunctional PI, which makes it potentially applicable in the field of smart electric and electronic engineering.