mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 21:04:41 +08:00
Update image_nodes.py
Trying to set capture size for cameras that support multiple resolutions. Might be better to use two separate values for that or query the camera's native resolutions, but for now that's what I needed.
This commit is contained in:
parent
6e3af6e7b9
commit
5568cff68a
@ -496,6 +496,11 @@ Can be used for realtime diffusion with autoqueue.
|
||||
self.cap.release()
|
||||
self.current_cam_index = 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():
|
||||
raise Exception("Could not open webcam")
|
||||
|
||||
@ -1663,4 +1668,4 @@ class LoadAndResizeImage:
|
||||
if not folder_paths.exists_annotated_filepath(image):
|
||||
return "Invalid image file: {}".format(image)
|
||||
|
||||
return True
|
||||
return True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user