Massive stars lose mass in the form of stellar winds as well as outflows and instantaneous ejections, caused by various processes in binary systems. The lost material forms circumstellar nebulae of diverse shapes, which could be detected with modern infrared telescopes. We present the results of search for massive stars through detection of compact mid-infrared nebulae with Spitzer and WISE. Follow-up spectroscopy of the central stars of these nebulae led to the discovery of several dozens of candidate luminous blue variables (LBVs). Four of them were confirmed to be bona fide LBVs by means of spectroscopic and photometric monitoring. The majority of other central stars of mid-infrared nebulae turns out to be either blue supergiants or Wolf-Rayet stars of the late nitrogen sequence.