olegchomp / TDDiffusionAPI

TouchDesigner interface for AUTOMATIC1111
170 stars 6 forks source link

Controlnet error #9

Closed Niutonian closed 4 months ago

Niutonian commented 10 months ago

Hello I have a very weird error happening when I use controlnet, the controlnet is connected similarly in the example picture but I get this in stable diffusion console:

''' 2023-10-24 15:58:38,518 - ControlNet - INFO - Loaded state_dict from [D:\stable\stable-diffusion-webui_2023\models\ControlNet\control_sd15_canny.pth] 2023-10-24 15:58:38,520 - ControlNet - INFO - controlnet_default_config 2023-10-24 15:58:41,319 - ControlNet - INFO - ControlNet model control_sd15_canny [fef5e48e] loaded. 2023-10-24 15:58:41,766 - ControlNet - INFO - Loading preprocessor: none 2023-10-24 15:58:41,766 - ControlNet - INFO - preprocessor resolution = 0 2023-10-24 15:58:42,282 - ControlNet - INFO - ControlNet Hooked - Time = 92.25670766830444 100%|██████████████████████████████████████████████████████████████████████████████| 20/20 [00:19<00:00, 1.04it/s] Total progress: 100%|██████████████████████████████████████████████████████████████| 20/20 [00:18<00:00, 1.05it/s] 2023-10-24 15:59:04,667 - ControlNet - INFO - Loading model from cache: control_sd15_canny [fef5e48e]00, 1.21it/s] 2023-10-24 15:59:04,686 - ControlNet - INFO - Loading preprocessor: canny 2023-10-24 15:59:04,686 - ControlNet - INFO - preprocessor resolution = 0 Error running before_process_batch: D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\controlnet.py Traceback (most recent call last): File "D:\stable\stable-diffusion-webui_2023\modules\scripts.py", line 627, in before_process_batch script.before_process_batch(p, script_args, kwargs) File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\controlnet.py", line 987, in before_process_batch self.controlnet_hack(p) File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\controlnet.py", line 966, in controlnet_hack self.controlnet_main_entry(p) File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\controlnet.py", line 808, in controlnet_main_entry detected_map, is_image = preprocessor( File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\utils.py", line 75, in decorated_func return cached_func(*args, kwargs) File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\utils.py", line 63, in cached_func return func(*args, *kwargs) File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\global_state.py", line 35, in unified_preprocessor return preprocessor_modules[preprocessor_name](args, kwargs) File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\processor.py", line 42, in canny img, remove_pad = resize_image_with_pad(img, res) File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\processor.py", line 27, in resize_image_with_pad img = cv2.resize(img, (W_target, H_target), interpolation=interpolation) cv2.error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4065: error: (-215:Assertion failed) inv_scale_x > 0 in function 'cv::resize'


100%|██████████████████████████████████████████████████████████████████████████████| 20/20 [00:13<00:00, 1.51it/s] Total progress: 100%|██████████████████████████████████████████████████████████████| 20/20 [00:14<00:00, 1.40it/s] Total progress: 100%|██████████████████████████████████████████████████████████████| 20/20 [00:14<00:00, 1.64it/s]

'''

I am using SD 1.6 with the latest version of ControlNet v1.1.411, I would be eternally grateful if you could help me out

Niutonian commented 10 months ago

and this is the message when detect the preprocessor under controller:

""" 2023-10-24 16:09:02,476 - ControlNet - INFO - Detecting 1 images with the openpose_face module.12<00:00, 1.74it/s] *** API error: POST: http://127.0.0.1:7860/controlnet/detect {'error': 'error', 'detail': '', 'body': '', 'errors': "OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4065: error: (-215:Assertion failed) inv_scale_x > 0 in function 'cv::resize'\n"} Traceback (most recent call last): File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\anyio\streams\memory.py", line 98, in receive return self.receive_nowait() File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\anyio\streams\memory.py", line 93, in receive_nowait raise WouldBlock anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\base.py", line 78, in call_next
    message = await recv_stream.receive()
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\anyio\streams\memory.py", line 118, in receive
    raise EndOfStream
anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\stable\stable-diffusion-webui_2023\modules\api\api.py", line 187, in exception_handling
    return await call_next(request)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
    raise app_exc
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\base.py", line 108, in __call__
    response = await self.dispatch_func(request, call_next)
  File "D:\stable\stable-diffusion-webui_2023\modules\api\api.py", line 151, in log_and_time
    res: Response = await call_next(req)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
    raise app_exc
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\gzip.py", line 26, in __call__
    await self.app(scope, receive, send)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\fastapi\routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "D:\stable\stable-diffusion-webui_2023\venv\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\api.py", line 130, in detect
    processor_module(
  File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\utils.py", line 75, in decorated_func
    return cached_func(*args, **kwargs)
  File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\utils.py", line 63, in cached_func
    return func(*args, **kwargs)
  File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\global_state.py", line 35, in unified_preprocessor
    return preprocessor_modules[preprocessor_name](*args, **kwargs)
  File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\processor.py", line 246, in run_model
    img, remove_pad = resize_image_with_pad(img, res)
  File "D:\stable\stable-diffusion-webui_2023\extensions\sd-webui-controlnet\scripts\processor.py", line 27, in resize_image_with_pad
    img = cv2.resize(img, (W_target, H_target), interpolation=interpolation)
cv2.error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4065: error: (-215:Assertion failed) inv_scale_x > 0 in function 'cv::resize'

"""

olegchomp commented 9 months ago

2023-10-24 15:58:38,520 - ControlNet - INFO - controlnet_default_config 2023-10-24 15:58:41,319 - ControlNet - INFO - ControlNet model control_sd15_canny [fef5e48e] loaded. 2023-10-24 15:58:41,766 - ControlNet - INFO - Loading preprocessor: none 2023-10-24 15:58:41,766 - ControlNet - INFO - preprocessor resolution = 0

Looks like you didn't set canny preprocessor and nothing connected to controlnet input