Image upload via FTP to wordpress media library

You can upload your images to your host, and then use media_sideload_image() to upload each file. Let’s assume you upload all of your images to a folder named wpse, in the root of your WordPress installation:

// Set the directory
$dir = ABSPATH .'/wpse';
// Define the file type
$images = glob($directory . "*.jpg");
// Run a loop and upload every file to media library
foreach($images as $image) {
    // Upload a single image
    media_sideload_image($image,'SOME POST ID HERE');
}

Images must be attached to a post, but you can detach them afterward.