add bypassLOD

This commit is contained in:
Terry Jia
2025-09-22 14:54:50 -04:00
parent f086377307
commit 13261b3621
2 changed files with 32 additions and 7 deletions

View File

@@ -39,7 +39,7 @@
@pointerdown="handlePointerDown"
@pointermove="handlePointerMove"
@pointerup="handlePointerUp"
@wheel="handleWheel"
@wheel="handleNodeWheel"
>
<div class="flex items-center">
<template v-if="isCollapsed">
@@ -292,9 +292,17 @@ const { latestPreviewUrl, shouldShowPreviewImg } = useNodePreviewState(
}
)
// Check if any widget bypasses LOD restrictions
const hasLODBypassWidgets = computed(() => {
if (!nodeData.widgets?.length) return false
return nodeData.widgets.some((w: any) => w.options?.bypassLOD === true)
})
// Common condition computations to avoid repetition
const shouldShowWidgets = computed(
() => shouldRenderWidgets.value && nodeData.widgets?.length
() =>
(shouldRenderWidgets.value || hasLODBypassWidgets.value) &&
nodeData.widgets?.length
)
const shouldShowContent = computed(
@@ -333,6 +341,18 @@ const handleHeaderTitleUpdate = (newTitle: string) => {
handleNodeTitleUpdate(nodeData.id, newTitle)
}
const handleNodeWheel = (event: WheelEvent) => {
const target = event.target as HTMLElement
const isInLoad3D = target?.closest('.comfy-load-3d')
// Don't handle wheel events from Load3D components
if (isInLoad3D) {
return
}
handleWheel(event)
}
const handleEnterSubgraph = () => {
const graph = app.graph?.rootGraph || app.graph
if (!graph) {

View File

@@ -125,17 +125,22 @@ const processedWidgets = computed((): ProcessedWidget[] => {
const widgets = nodeData.widgets as SafeWidgetData[]
const result: ProcessedWidget[] = []
if (lodLevel === LODLevel.MINIMAL) {
return []
}
for (const widget of widgets) {
if (widget.options?.hidden) continue
if (widget.options?.canvasOnly) continue
if (!widget.type) continue
if (!shouldRenderAsVue(widget)) continue
if (lodLevel === LODLevel.REDUCED && !isEssential(widget.type)) continue
const bypassLOD = widget.options?.bypassLOD === true
if (!bypassLOD) {
if (
lodLevel === LODLevel.MINIMAL ||
(lodLevel === LODLevel.REDUCED && !isEssential(widget.type))
) {
continue
}
}
const vueComponent = getComponent(widget.type) || WidgetInputText