I've looked into it.
1. Getting a used sine wave UPS.
I picked up a 3000KVA unit for $500
2. Use a DC generator to charge the batterys and cycle the engine on an off so that it stays in the peak efficiency range.
3. Use a generator switch panel to decide what circuits to power.
I don't need to power the kitchen stove, water heater or sewer lift during a power failure.
4. If you are using a main breaker switch you can connect the same 120V to both phases to automatically disable 240Vac devices
The DC generator I got puts out the ~96 volts I need to charge the batterys in my UPS. It's actually a 120 pound, 240VDC servo motor, but it will generate lower DC voltages at lower RPMs.
I don't have a engine yet, so it's just a large paperweight for now.
I've also contemplated mounting a 20Hp modern compact brushless DC generator in the car where the A/C compressor used to be.