There is no way to delete photos only from Mac without removing them from iCloud as iCloud is, in a way, a copy of your Photo Library on Mac. However, you can use alternate cloud storage services to store your photos and delete them from your Mac.