Automaticism/Promptvision

Subdirectories give: 500 Internal Server Error

egormly opened this issue · 3 comments

500 Internal Server Error
ValueError occurred. Please try again.
Sample larger than population or is negative

I assume this is due to the number of images and sub folders? if I run it on one folder, it works fine.
Nice work but not useful if it cannot handle large numbers or subfolders.

I have ran it on one folder containing thousands of images. It doesn’t yet support multiple folders or subdirectories.

Do you see anything else in the logs? You can change line 60 in gallery.py from console_handler.setLevel(logging.ERROR) to console_handler.setLevel(logging.DEBUG) which will help me with debugging.

You explained the problem and it shows in debug as well.

(replaced my directory with MyDir)

DEBUG 2023-03-22 14:19:33,741 [DEBUG][] line:940 Sat image_folder from args.imagedir: MyDir
DEBUG 2023-03-22 14:19:33,741 [DEBUG][] line:964 Creating bulk exif data
DEBUG 2023-03-22 14:19:33,852 [DEBUG][get_image_names_in_image_dir] line:735 MyDir
DEBUG 2023-03-22 14:19:33,852 [DEBUG][get_image_names_in_image_dir] line:738 0
DEBUG 2023-03-22 14:19:35,148 [DEBUG][mp_bulk_exif_read] line:886 pool joined
DEBUG 2023-03-22 14:19:35,150 [DEBUG][get_image_names_in_image_dir] line:735 MyDir
DEBUG 2023-03-22 14:19:35,150 [DEBUG][get_image_names_in_image_dir] line:738 0
DEBUG 2023-03-22 14:19:35,164 [DEBUG][mp_bulk_exif_read] line:901 Empty DataFrame
Columns: [Positive prompt, Negative prompt, Sampler settings, Steps, Sampler, CFG scale, Seed, Size, Model hash, Model, Postprocessing, Extras]
Index: []
DEBUG 2023-03-22 14:19:35,166 [DEBUG][] line:979 Initializing imgview data
DEBUG 2023-03-22 14:19:35,166 [DEBUG][get_image_names_in_image_dir] line:735 MyDir
DEBUG 2023-03-22 14:19:35,166 [DEBUG][get_image_names_in_image_dir] line:738 0
DEBUG 2023-03-22 14:19:35,167 [DEBUG][metadata_initialization] line:767 Empty DataFrame
Columns: []
Index: []
Preamble time: 1.43 seconds

  • Serving Flask app 'gallery'
  • Debug mode: on
    INFO 2023-03-22 14:19:35,184 [INFO][_log] line:224 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:8000
  • Running on http://192.168.0.124:8000
    INFO 2023-03-22 14:19:35,186 [INFO][_log] line:224 Press CTRL+C to quit
    INFO 2023-03-22 14:19:35,187 [INFO][_log] line:224 * Restarting with stat
    DEBUG 2023-03-22 14:19:35,517 [DEBUG][] line:940 Sat image_folder from args.imagedir: MyDir
    WARNING 2023-03-22 14:19:35,524 [WARNING][] line:958 0
    DEBUG 2023-03-22 14:19:35,621 [DEBUG][get_image_names_in_image_dir] line:735 MyDir
    DEBUG 2023-03-22 14:19:35,621 [DEBUG][get_image_names_in_image_dir] line:738 0
    DEBUG 2023-03-22 14:19:36,452 [DEBUG][mp_bulk_exif_read] line:886 pool joined
    DEBUG 2023-03-22 14:19:36,453 [DEBUG][get_image_names_in_image_dir] line:735 MyDir
    DEBUG 2023-03-22 14:19:36,453 [DEBUG][get_image_names_in_image_dir] line:738 0
    DEBUG 2023-03-22 14:19:36,454 [DEBUG][mp_bulk_exif_read] line:901 Empty DataFrame
    Columns: [Positive prompt, Negative prompt, Sampler settings, Steps, Sampler, CFG scale, Seed, Size, Model hash, Model, Postprocessing, Extras]
    Index: []
    WARNING 2023-03-22 14:19:36,459 [WARNING][] line:973 0
    DEBUG 2023-03-22 14:19:36,460 [DEBUG][get_image_names_in_image_dir] line:735 MyDir
    DEBUG 2023-03-22 14:19:36,460 [DEBUG][get_image_names_in_image_dir] line:738 0
    Preamble time: 0.94 seconds
    WARNING 2023-03-22 14:19:36,464 [WARNING][_log] line:224 * Debugger is active!
    INFO 2023-03-22 14:19:36,464 [INFO][_log] line:224 * Debugger PIN: 374-594-347

IMO it should start up regardless of if there are images and give an option to select a new dir or store a default one.

Pull #2 fixed this issue.