apple / ml-stable-diffusion

Stable Diffusion with Core ML on Apple Silicon
MIT License
16.79k stars 935 forks source link

filename too long running with runwayml/stable-diffusion-v1-5 #45

Open brunoamaral opened 1 year ago

brunoamaral commented 1 year ago

python -m python_coreml_stable_diffusion.pipeline --prompt $prompt -i output-ml-packages -o ~/Desktop/ --compute-unit ALL --seed 93 --model-version runwayml/stable-diffusion-v1-5

The output :

INFO:__main__:Generated image has nsfw concept=False
Traceback (most recent call last):
  File "/Users/brunoamaral/.pyenv/versions/3.10.6/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/brunoamaral/.pyenv/versions/3.10.6/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/brunoamaral/Labs/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py", line 534, in <module>
    main(args)
  File "/Users/brunoamaral/Labs/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py", line 485, in main
    out_path = get_image_path(args)
  File "/Users/brunoamaral/Labs/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py", line 444, in get_image_path
    os.makedirs(out_folder, exist_ok=True)
  File "/Users/brunoamaral/.pyenv/versions/3.10.6/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [Errno 63] File name too long: '/Users/brunoamaral/Desktop/${$((_p9k_on_expand()...

Running on MacOS Ventura 13.0.1, M2

brunoamaral commented 1 year ago

ran new tests, seems that when I replace $prompt with the actual string with ', the command runs as it should.

soulteary commented 1 year ago

not only v1.5, if you use long prompt text, you will get the file name too long error. @brunoamaral

https://github.com/apple/ml-stable-diffusion/issues/52

dec2-anon commented 1 year ago

19

relevant

cypggs commented 1 year ago

me too, INFO:main:Generated image has nsfw concept=False Traceback (most recent call last): File "/Users/case/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/Users/case/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/case/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py", line 540, in main(args) File "/Users/case/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py", line 486, in main out_path = get_image_path(args) File "/Users/case/ml-stable-diffusion/python_coreml_stable_diffusion/pipeline.py", line 444, in get_image_path os.makedirs(out_folder, exist_ok=True) File "/Users/case/miniconda3/envs/coreml_stable_diffusion/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 63] File name too long: '/Users/case/Downloads/Dressed_in_embroidery_and_carved_at_the_top,_the_mountain_is_wide_and_its_eyes_are_wide,_and_Chuanze_condescends_to_its_foresight._Lu_Yan_flapping_to_the_ground,_Zhong_Ming_Ding_food_home;_the_warship_Mi_Jin,_the_blue_sparrow_and_the_yellow_dragon._The_cloud_sells_the_rain,_the_color_is_bright._Luoxia_flies_with_loneliness,_and_the_autumn_waters_grow_in_the_same_color._The_fishing_boat_sang_late,_ringing_the_shore_of_poor_Peng_Li;_the_wild_goose_array_was_frightened_by_the_cold,_and_the_sound_cut_off_the_pool_of_Hengyang.'

CheneyLin commented 1 year ago

48 https://github.com/apple/ml-stable-diffusion/issues/48