Homodyne detection can dramatically enhance measurement sensitivity for weak signals. In nonlinear optical microscopy it can make accessible a range of novel, intrinsic, contrast like nonlinear absorption and nonlinear phase contrast. Here a compact and rapid pulse shaper is developed, implemented, and demonstrated for homodyne detection in nonlinear microscopy with high-repetition rate mode-locked femtosecond lasers. With this method we generate two-photon absorption (TPA) and self-phase modulation images of gold nanostars in biological samples. Simultaneous imaging of two-photon luminescence and TPA also enables us to produce two-photon quantum yield images.