How can I switch from ArduinoOTA to ESPhome safely? I have an ESP8266 (ESP-12F), which I flashed with ElegantOTA, a variation of ArduinoOTA with just a different interface. I never managed to flash anything else, so it's a bare OTA I flashed using a dedicated programmer. The device has not even pins for further flashing.

The ESP is already in a device that I would like to avoid opening, and I would like to avoid soldering pins and flashing locally the ESPhome firmware (which is also configured for future OTA).

I'm not sure the bootloader or whatever is used to self-flash the chip is compatible. How can I do it?

Or should I just open the ArduinoOTA webpage, upload a ESPhome firmware and go on?
I've found that when a flash fails with a space error, I've usually specified the wrong flash size option in Arduino (under Tools->Flash Size).  Depending on the version of Arduino you're using, try picking the one with "No SPIFFS" or FS:none that matches the size of your flash memory.  Once you make that change, recompile and reupload.