In this study, a superior hydrophilic polyethersulfone (PES) membrane modified with L-Lysine (C, N codoped)-TiO2/WO3 (LTW) photocatalyst is presented to endow self-antifouling properties and amelioration of the membrane performance in versatile wastewater treatment. ATR-FTIR spectra, FESEM, 3D AFM images, and water contact angle (WCA) measurement indicated that successful connection of LTW photocatalyst on PES membrane surface led to improved membrane properties like hydrophilicity and surface roughness. The PES/LTW membranes demonstrated significant enhancement in water permeability (49.79 L/m2.h) and antifouling feature (flux recovery rate (FRR) of 96.96 %). The optimal membrane (M-2, 0.03 wt%) with the highest hydrophilicity, pure water flux (PWF), and fouling resistance, was used to evaluate the filtration performance in a cross-flow setup. Response surface methodology (RSM) was utilized to model and optimize the filtration process. The effects of three influential variables, including operating pressure (P, 3–5 bar), feed COD concentration (C, 500–1500 mg/l), and effect of irradiation on four responses, i.e., flux (L/m2.h), FRR (%), dye removal efficiency (%), and COD removal efficiency (%) were assessed in a continuous regime using nanofiltration of biologically treated baker's yeast (BTY) effluent. The optimum conditions were found to be 693 mg/l of feed COD concentration and 4.44 bar of operating pressure under visible light irradiation. The experimental data compared to the predicted ones indicated a good agreement that confirms the validity of the models describing the performance of the photocatalytic membrane.