mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Show placeholder image when preview is disabled
When the preview is disabled in the canvas widget, a 1x1 transparent PNG placeholder image is now set to node.imgs. This prevents issues with missing images and ensures consistent UI behavior.
This commit is contained in:
@@ -538,6 +538,10 @@ async function createCanvasWidget(node, widget, app) {
|
||||
const showPreviewWidget = node.widgets.find((w) => w.name === "show_preview");
|
||||
if (showPreviewWidget && !showPreviewWidget.value) {
|
||||
log.debug("Preview disabled, skipping updateOutput");
|
||||
const PLACEHOLDER_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
|
||||
const placeholder = new Image();
|
||||
placeholder.src = PLACEHOLDER_IMAGE;
|
||||
node.imgs = [placeholder];
|
||||
return;
|
||||
}
|
||||
const triggerWidget = node.widgets.find((w) => w.name === "trigger");
|
||||
|
||||
Reference in New Issue
Block a user