AbyszOne / Abysz-LAB-Ext

Temporal Coherence tools. Automatic1111 extension.
GNU General Public License v3.0
152 stars 9 forks source link

Deflickers Playground Error #9

Open thenolifer opened 1 year ago

thenolifer commented 1 year ago

I am trying to use Deflickers Playground but it is throwing an error. It doesn't seem to like my input path - but I have tried different paths and the error remains the same;

[ WARN:4@70633.878] global loadsave.cpp:244 cv::findDecoder imread_('A:\Downloads\walker_test\processed'): can't open/read file: check file path/integrity Traceback (most recent call last): File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1299, in process_api result = await self.call_function( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1022, in call_function prediction = await anyio.to_thread.run_sync( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "S:\WebUI\stable-diffusion-webui\extensions\Abysz-LAB-Ext\scripts\Abysz_Lab.py", line 671, in deflickers dyndef(ruta_entrada_3, ruta_salida_1, ddf_strength) File "S:\WebUI\stable-diffusion-webui\extensions\Abysz-LAB-Ext\scripts\Abysz_Lab.py", line 416, in dyndef current_img = cv2.addWeighted(current_img, alpha, prev_img, 1-alpha, 0) cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\arithm.cpp:650: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op'

Screenshot 2023-05-13 071503

path

AbyszOne commented 1 year ago

I haven't been able to test it yet, but I received two questions yesterday. I'm afraid the WebUI update has broken some of the code. Please confirm if you are using the latest version of Automatic1111.

gsurus commented 1 year ago

I am trying to use Deflickers Playground but it is throwing an error. It doesn't seem to like my input path - but I have tried different paths and the error remains the same;

[ WARN:4@70633.878] global loadsave.cpp:244 cv::findDecoder imread_('A:\Downloads\walker_test\processed'): can't open/read file: check file path/integrity Traceback (most recent call last): File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1299, in process_api result = await self.call_function( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1022, in call_function prediction = await anyio.to_thread.run_sync( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "S:\WebUI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "S:\WebUI\stable-diffusion-webui\extensions\Abysz-LAB-Ext\scripts\Abysz_Lab.py", line 671, in deflickers dyndef(ruta_entrada_3, ruta_salida_1, ddf_strength) File "S:\WebUI\stable-diffusion-webui\extensions\Abysz-LAB-Ext\scripts\Abysz_Lab.py", line 416, in dyndef current_img = cv2.addWeighted(current_img, alpha, prev_img, 1-alpha, 0) cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\arithm.cpp:650: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op'

Screenshot 2023-05-13 071503

path

I'm pretty sure this issue is caused by a non-image/corrupted image file in the directory specified for your frames folder, which cannot be loaded. Had this issue, it was because my deflicker folder was nested in my frames folder, and the frames folder was being loaded as an element in the imgs array.

def dyndef(ruta_entrada_3, ruta_salida_1, ddf_strength):
    if ddf_strength <= 0: # Condición 1: strength debe ser mayor a 0
        return
    imgs = []
    files = sorted(os.listdir(ruta_entrada_3))

    for file in files:
        img = cv2.imread(os.path.join(ruta_entrada_3, file))
        imgs.append(img)

img = cv2.imread(os.path.join(ruta_entrada_3, file))

that line in particular is causing the problem as it does not filter out non-image items.

thenolifer commented 1 year ago

@gsurus that is exactly the issue - I had an extra folder within the frames folder! It works now :)