Treatment of produced water in oil fields has become a tough challenge for oil producers. Nanofiltration, a promising method for water treatment, has been proposed as a solution. The phase inversion technique was used for the synthesis of nanofiltration membranes of polyethersulfone embedded with graphene oxide nanoparticles and polyethersulfone embedded with titanium nanoribbons. As a realistic situation, water samples taken from the oil field were filtered using synthetic membranes at an operating pressure of 0.3 MPa. Physiochemical properties such as water flux, membrane morphology, flux recovery ratio, pore size and hydrophilicity were investigated. Additionally, filtration efficiency for removal of constituent ions, oil traces in water removal, and fouling tendency were evaluated. The constituent ions of produced water act as the scaling agent which threatens the blocking of the reservoir bores of the disposal wells. Adding graphene oxide (GO) and titanium nanoribbons (TNR) to polyethersulfone (PES) enhanced filtration efficiency, water flux, and anti-fouling properties while also boosting hydrophilicity and porosity. The PES-0.7GO membrane has the best filtering performance, followed by the PES-0.7TNR and pure-PES membranes, with chloride salt rejection rates of 81%, 78%, and 35%; oil rejection rates of 88%, 85%, and 71%; and water fluxes of 85, 82, and 42.5 kg/m2 h, respectively. Because of its higher hydrophilicity and physicochemical qualities, the PES-0.7GO membrane outperformed the PES-0.7TNR membrane. Nanofiltration membranes embedded with nanomaterial described in this work revealed encouraging long-term performance for oil-in-water trace separation and scaling agent removal.