if-ai / IF_prompt_MKR

An A1111 extension to let the AI make prompts for SD using Oobabooga
https://ko-fi.com/impactframes/shop
104 stars 10 forks source link

Per Image Mode Batch Higher than 1 UI Issue #5

Closed boricuapab closed 1 year ago

boricuapab commented 1 year ago

When using Per Image mode and batch higher than 1, I get this error and the images dont display in the UI

  File "C:\sdLocal\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\sdLocal\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1326, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "C:\sdLocal\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "C:\sdLocal\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 4461, in postprocess
    file = self.pil_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR)
  File "C:\sdLocal\stable-diffusion-webui\modules\ui_tempdir.py", line 55, in save_pil_to_file
    file_obj = tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 559, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 556, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\gradio\\tmp0f2anzoo.png'

The images do get generated though.

if-ai commented 1 year ago

Umm I can't reproduce it are you in the latest version? I tried even adding a lora and with different counts I always get the result correct. Your error message is pointing to a missing directory on temp maybe you were freeing up space or deleted the recycle bin while generating and the temp files were erased?

if-ai commented 1 year ago

I looks like I had some bad name please try updating the extension sorry for the inconvenience

boricuapab commented 1 year ago

I updated to the latest for the extension but still have this issue occuring.

One strange thing I noticed is that the total steps cound in the cmd window is higher than what I prompted for.

In this case I did a batch of 4 with 28 steps, but total steps it's saying it'll go through is up to 898 which is way higher than the expected total of 112 (28x4)

samplingHigh

if-ai commented 1 year ago

It seems to be a problem with gradio and how Automatic handles the temp files. This is going to take a while to solve the steps are weird I am going to have to spend some time debugging this As on this issue

boricuapab commented 1 year ago

Working after a reinstall of 1.6

batch4Works