Merge pull request #93 from Quasimondo/patch-1

Update image_nodes.py
This commit is contained in:
Jukka Seppänen 2024-07-26 22:17:06 +02:00 committed by GitHub
commit adb35ee233
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -496,6 +496,11 @@ Can be used for realtime diffusion with autoqueue.
self.cap.release() self.cap.release()
self.current_cam_index = cam_index self.current_cam_index = cam_index
self.cap = cv2.VideoCapture(cam_index) self.cap = cv2.VideoCapture(cam_index)
try:
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
except:
pass
if not self.cap.isOpened(): if not self.cap.isOpened():
raise Exception("Could not open webcam") raise Exception("Could not open webcam")
@ -1663,4 +1668,4 @@ class LoadAndResizeImage:
if not folder_paths.exists_annotated_filepath(image): if not folder_paths.exists_annotated_filepath(image):
return "Invalid image file: {}".format(image) return "Invalid image file: {}".format(image)
return True return True