mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-07 20:12:35 +08:00
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Build package / Build Test (3.10) (push) Waiting to run
Build package / Build Test (3.11) (push) Waiting to run
Build package / Build Test (3.12) (push) Waiting to run
Build package / Build Test (3.13) (push) Waiting to run
Build package / Build Test (3.14) (push) Waiting to run
Amp-Thread-ID: https://ampcode.com/threads/T-019c3236-1417-74aa-82a3-bcb365fbe9d1
39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
import nodes
|
|
import folder_paths
|
|
|
|
MAX_RESOLUTION = nodes.MAX_RESOLUTION
|
|
|
|
|
|
class WebcamCapture(nodes.LoadImage):
|
|
SEARCH_ALIASES = ["camera input", "live capture", "camera feed", "snapshot"]
|
|
@classmethod
|
|
def INPUT_TYPES(s):
|
|
return {
|
|
"required": {
|
|
"image": ("WEBCAM", {}),
|
|
"width": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
|
|
"height": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION, "step": 1}),
|
|
"capture_on_queue": ("BOOLEAN", {"default": True}),
|
|
}
|
|
}
|
|
RETURN_TYPES = ("IMAGE",)
|
|
FUNCTION = "load_capture"
|
|
|
|
CATEGORY = "image"
|
|
|
|
def load_capture(self, image, **kwargs):
|
|
return super().load_image(folder_paths.get_annotated_filepath(image))
|
|
|
|
@classmethod
|
|
def IS_CHANGED(cls, image, width, height, capture_on_queue):
|
|
return super().IS_CHANGED(image)
|
|
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"WebcamCapture": WebcamCapture,
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"WebcamCapture": "Webcam Capture",
|
|
}
|