toyxyz / ComfyUI_toyxyz_test_nodes

Custom node and script for sending webcam to ComfyUI
GNU General Public License v3.0
460 stars 29 forks source link

Release camera on server shutdown #37

Closed worthy7 closed 2 months ago

worthy7 commented 2 months ago

I don't know how to get the camera to release when the node is deleted or when workflow changes. It seems there is no hook in comfy for this. So for now it means that the camera will be locked into comfy for as long as the server is online... not ideal.

worthy7 commented 2 months ago

Perhaps there is a different/faster way to "open and get and close" the camera in one go during a loop so it remains safe? cv2 takes 20 seconds which is way longer than any other camera app I've ever used.

toyxyz commented 2 months ago

Yes. That's the annoying part. That's why I added a separate camera capture app.

worthy7 commented 2 months ago

I will try this solution too, it seems MUCH faster https://answers.opencv.org/question/215586/why-does-videocapture1-take-so-long/