Image dimensions output for image upload widget

This commit is contained in:
space-nuko
2023-05-08 19:32:57 -05:00
parent 0f50dbae87
commit 92fbe1ea6b
5 changed files with 63 additions and 15 deletions

View File

@@ -37,8 +37,7 @@
};
let style: Styles = {
grid_cols: [4],
grid_rows: [4],
grid_cols: [3],
object_fit: "cover",
}
let element: HTMLDivElement;
@@ -125,11 +124,11 @@
}
</script>
{#if widget && node && nodeValue && $nodeValue != null}
{#if widget && node && nodeValue}
{#if widget.attrs.variant === "image"}
<div class="wrapper comfy-image-widget" style={widget.attrs.style || ""} bind:this={element}>
<Block variant="solid" padding={false}>
{#if $nodeValue.length > 0}
{#if $nodeValue && $nodeValue.length > 0}
<StaticImage
value={$nodeValue[$nodeValue.length-1].data}
show_label={widget.attrs.title != ""}