Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/node/NodePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
https://github.com/Nuked88/ComfyUI-N-Sidebar/blob/7ae7da4a9761009fb6629bc04c683087a3e168db/app/js/functions/sb_fn.js#L149
-->
<template>
<LGraphNodePreview v-if="shouldRenderVueNodes" :node-def="nodeDef" />
<LGraphNodePreview
v-if="shouldRenderVueNodes"
:node-def="nodeDef"
:position="position"
/>
<div v-else class="_sb_node_preview bg-component-node-background">
<div class="_sb_table">
<div
Expand Down Expand Up @@ -92,8 +96,9 @@ import { useWidgetStore } from '@/stores/widgetStore'
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
import { renderMarkdownToHtml } from '@/utils/markdownRendererUtil'

const { nodeDef } = defineProps<{
const { nodeDef, position = 'absolute' } = defineProps<{
nodeDef: ComfyNodeDefV2
position?: 'absolute' | 'relative'
}>()

const { shouldRenderVueNodes } = useVueFeatureFlags()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<template>
<div
:data-node-id="nodeData.id"
class="bg-component-node-background lg-node absolute pb-1 contain-style contain-layout w-[350px] rounded-2xl touch-none flex flex-col border-1 border-solid outline-transparent outline-2 border-node-stroke"
:class="
cn(
'bg-component-node-background lg-node pb-1 contain-style contain-layout w-[350px] rounded-2xl touch-none flex flex-col border-1 border-solid outline-transparent outline-2 border-node-stroke',
position
)
"
>
<div
class="flex flex-col justify-center items-center relative pointer-events-none"
Expand Down Expand Up @@ -37,9 +42,11 @@ import NodeSlots from '@/renderer/extensions/vueNodes/components/NodeSlots.vue'
import NodeWidgets from '@/renderer/extensions/vueNodes/components/NodeWidgets.vue'
import type { ComfyNodeDef as ComfyNodeDefV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
import { useWidgetStore } from '@/stores/widgetStore'
import { cn } from '@/utils/tailwindUtil'

const { nodeDef } = defineProps<{
const { nodeDef, position = 'absolute' } = defineProps<{
nodeDef: ComfyNodeDefV2
position?: 'absolute' | 'relative'
}>()

const widgetStore = useWidgetStore()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
:key="createNodeDefKey(nodeDef)"
class="rounded-lg border p-4"
>
<NodePreview :node-def="nodeDef" class="min-w-full! text-[.625rem]!" />
<div class="[zoom:0.6]">
<NodePreview
:node-def="nodeDef"
position="relative"
class="min-w-full! text-[.625rem]!"
/>
</div>
</div>
</template>
<template v-else-if="isLoading">
Expand Down
Loading