Silver nanoparticles (AgNPs) play a crucial role in biology and medical research as their extensive and efficient antibacterial activity and high electrical and thermal conductivity. However, the generation of them with a certain morphology under mild conditions (under air, solvent-free, room temperature, etc.,) is still a huge challenge. Herein, a simple one-step method is proposed to generate AgNPs in situ at room temperature under air by combining the photopolymerization process with the formation process of AgNPs within a few minutes. In detailed, 12 different dyes based on 2,5-diethylene-cyclopentan-1-one were first synthesized and used as high-performance type II photoinitiator. When using in conjunction of bis-(4-tertbutylphenyl) iodonium hexafluorophosphate (Iod) and ethyl 4-dimethylaminobenzoate (EDB), they can effectively boost the free radical photopolymerization (FRP) of polyethylene glycol diacrylate (PEG-DA) and the cationic photopolymerization (CP) of 3,4-epoxycyclohexylmethyl-3,4-epoxycyclohexane carboxylate (EPOX) upon irradiation with LED@405 nm. Furthermore, all the formulations containing/without AgNPs can be successfully used to perform the direct laser write experiment. However, even if all of the obtained 3D patterns exhibited reversible swelling performance and shape-memory effects caused by swelling and dehydration for the access to 4D printing, the presence of AgNPs will affect these properties.