You could look for UPS (Uninterruptible Power Supply) systems, as the iMac and any other device that needs electric power come with a power cord, that fit into such a device.
You could also look for just battery packs, that offer 300 Watt output, with a plug for electric devices.