Image Validator Script for Training Datasets: Move Corrupted Images
Image validator script that scans a training dataset folder and its subfolders, logs invalid images and moves corrupted ones that would break training.

Highlights
Made after a supporter had corrupted images among 100k+ training images. Set folder_path, broken_folder_path and move_broken, then run the .bat file on Windows or the Python script on Linux or RunPod.
What it does
Corrupted images can break training. This script tests every image in a folder and its subfolders, writes the invalid ones to an invalid_images_log.txt file so you can find and fix broken images, and moves corrupted images into a separate folder. Moving is enabled by default and can be turned off.
It was written when a supporter had corrupted images among more than 100,000 training images.
What you get
- image_files_verifier.py, the validator script
- run_image_files_verifier.bat to run it on Windows with a double click
- Instructions for running it on Linux and RunPod
Requirements
- Python on Windows, Linux or RunPod
- First edit image_files_verifier.py and set folder_path, broken_folder_path and move_broken (True or False)
- On Windows, double click run_image_files_verifier.bat; on Linux or RunPod, run python image_files_verifier.py from a command line
Related

Ultimate Image Processing App: 1-Click Batch Cropping, SAM 3.1 Masking
Ultimate Image Processing Premium turns raw photo folders into training-ready datasets with nine tools, from SAM 3.1 cropping to duplicate removal.

All JoyCaption Apps: 1-Click Installers With Batch Captioning
JoyCaption in four improved Gradio apps: Pre-Alpha, Alpha One, Alpha Two and the newest, fastest Joy Caption Beta One, all with batch and multi-GPU captioning.

Ultimate Image Captioner Pro: Qwen3 VL & JoyCaption JSON Captioning
Ultimate Image Captioner Pro writes JSON and text captions with Qwen3 VL 8B Instruct and Joy Caption models for Ideogram 4 JSON prompting and training.