From 1c4af5918a5ffb022606e56ab2d31e510dcccec2 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 17 May 2024 14:02:09 -0400 Subject: [PATCH] Better error message if the webcam node doesn't work. --- web/extensions/core/webcamCapture.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/extensions/core/webcamCapture.js b/web/extensions/core/webcamCapture.js index ea1f597e..dd5725bd 100644 --- a/web/extensions/core/webcamCapture.js +++ b/web/extensions/core/webcamCapture.js @@ -33,7 +33,13 @@ app.registerExtension({ label.style.overflow = "auto"; label.style.maxHeight = "100%"; label.style.whiteSpace = "pre-wrap"; - label.textContent = "Unable to load webcam, please ensure access is granted:\n" + error.message; + + if (window.isSecureContext) { + label.textContent = "Unable to load webcam, please ensure access is granted:\n" + error.message; + } else { + label.textContent = "Unable to load webcam. A secure context is required, if you are not accessing ComfyUI on localhost (127.0.0.1) you will have to enable TLS (https)\n\n" + error.message; + } + container.replaceChildren(label); } };