mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 00:20:07 +00:00
add bypassLOD
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user