mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
add bypassLOD
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
@pointerdown="handlePointerDown"
|
@pointerdown="handlePointerDown"
|
||||||
@pointermove="handlePointerMove"
|
@pointermove="handlePointerMove"
|
||||||
@pointerup="handlePointerUp"
|
@pointerup="handlePointerUp"
|
||||||
@wheel="handleWheel"
|
@wheel="handleNodeWheel"
|
||||||
>
|
>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<template v-if="isCollapsed">
|
<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
|
// Common condition computations to avoid repetition
|
||||||
const shouldShowWidgets = computed(
|
const shouldShowWidgets = computed(
|
||||||
() => shouldRenderWidgets.value && nodeData.widgets?.length
|
() =>
|
||||||
|
(shouldRenderWidgets.value || hasLODBypassWidgets.value) &&
|
||||||
|
nodeData.widgets?.length
|
||||||
)
|
)
|
||||||
|
|
||||||
const shouldShowContent = computed(
|
const shouldShowContent = computed(
|
||||||
@@ -333,6 +341,18 @@ const handleHeaderTitleUpdate = (newTitle: string) => {
|
|||||||
handleNodeTitleUpdate(nodeData.id, newTitle)
|
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 handleEnterSubgraph = () => {
|
||||||
const graph = app.graph?.rootGraph || app.graph
|
const graph = app.graph?.rootGraph || app.graph
|
||||||
if (!graph) {
|
if (!graph) {
|
||||||
|
|||||||
@@ -125,17 +125,22 @@ const processedWidgets = computed((): ProcessedWidget[] => {
|
|||||||
const widgets = nodeData.widgets as SafeWidgetData[]
|
const widgets = nodeData.widgets as SafeWidgetData[]
|
||||||
const result: ProcessedWidget[] = []
|
const result: ProcessedWidget[] = []
|
||||||
|
|
||||||
if (lodLevel === LODLevel.MINIMAL) {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const widget of widgets) {
|
for (const widget of widgets) {
|
||||||
if (widget.options?.hidden) continue
|
if (widget.options?.hidden) continue
|
||||||
if (widget.options?.canvasOnly) continue
|
if (widget.options?.canvasOnly) continue
|
||||||
if (!widget.type) continue
|
if (!widget.type) continue
|
||||||
if (!shouldRenderAsVue(widget)) 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
|
const vueComponent = getComponent(widget.type) || WidgetInputText
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user