mav-rik/facerestore_cf

Inquiry Regarding Recommended OpenCV Version for facerestore_cf

Opened this issue · 7 comments

Hello,

I am currently working on setting up the facerestore_cf project on my local machine. I have OpenCV version 4.8.1 installed, but I am encountering some issues which I suspect may be related to the OpenCV version I am using. Specifically, when I attempt to load ComfyUI, I receive the following error:

Prim = typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly]
AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'

I was wondering if there is a specific version of OpenCV that is recommended or required for this project? It would be very helpful to know the recommended or minimum required version of OpenCV to ensure compatibility and smooth operation of the project.

Additionally, if there are other specific versions of dependencies that are required, it would be great to have that information as well.

Thank you very much for your assistance and for your work on this project.

Hey guys, I just happened to install https://github.com/WASasquatch/was-node-suite-comfyui and the issue was resolved (probably a cross-dependency that fixed the problem).

Anyway, a response would still be interesting.

Hint, now OpenCV is in version 4.7.0 ;D

@JMD2023 I am wondering if adding opencv-python-headless[ffmpeg]<=4.7.0.72 to requirements.txt fixes the issue. I can not check it myself though. Can you check that and reply please?

@mav-rik Correct. facerestore_cf requires OpenCV 4.7.* (latest version of 4.7 branch).

Please, is there any chance that you could look at this and add OpenCV 4.8+ support?

Because OpenCV 4.8 contains lots of fixes for ONNX, CUDA, neural network performance etc:

https://www.phoronix.com/news/OpenCV-4.8

opencv-python-headless[ffmpeg]<=4.7.0.72. i added the code to file the install requirements, cvopenai errors still happend

i uninstall opencv 4.8 and then installing opencv 4.7, facerestore node still show " File "C:\ComfyUI_windows_portable\python_embeded\lib\site-packages\cv2\typing_init_.py", line 157, in
Prim = typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly]
AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'"

@Thanh1122kkll I had a similar issue after a while. Not sure why. So I went back even lower, downgrading opencv to 4.6.*. Now it works. It's ridiculous that so many ComfyUI custom nodes haven't upgraded past a 2 year old version of OpenCV.

Hey guys, I just happened to install https://github.com/WASasquatch/was-node-suite-comfyui and the issue was resolved (probably a cross-dependency that fixed the problem).

Anyway, a response would still be interesting.

Hint, now OpenCV is in version 4.7.0 ;D

omg, this really work, thank you for this. I try to fix this all day but no help. so many thank for this