Skip to content

Commit

Permalink
Better error message if the webcam node doesn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed May 17, 2024
1 parent 91590ad commit 1c4af59
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/extensions/core/webcamCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down

0 comments on commit 1c4af59

Please sign in to comment.