Skip to content

Commit 12a77aa

Browse files
simula-rgithub-actions
authored andcommitted
fix: remove LOD from vue nodes (#6950)
Refactor to remove LOD from vue nodes. Also, hide Litegraph LOD settings in vue nodes to prevent confusion / stale setting. Keep litegraph LOD the exact same. - **What**: settings, all LOD related code in vue nodes ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6950-fix-remove-LOD-from-vue-nodes-2b76d73d365081568723f8cbc7be7e17) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <[email protected]> (cherry picked from commit 4b87b1f)
1 parent ac4c553 commit 12a77aa

File tree

27 files changed

+50
-479
lines changed

27 files changed

+50
-479
lines changed
1.69 KB
Loading

browser_tests/tests/vueNodes/nodeStates/lod.spec.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.
-1.53 KB
Loading

packages/design-system/src/css/style.css

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,57 +1329,6 @@ audio.comfy-audio.empty-audio-widget {
13291329
will-change: transform;
13301330
}
13311331

1332-
/* START LOD specific styles */
1333-
/* LOD styles - Custom CSS avoids 100+ Tailwind selectors that would slow style recalculation when .isLOD toggles */
1334-
1335-
.isLOD .lg-node {
1336-
box-shadow: none;
1337-
filter: none;
1338-
backdrop-filter: none;
1339-
text-shadow: none;
1340-
mask-image: none;
1341-
clip-path: none;
1342-
background-image: none;
1343-
text-rendering: optimizeSpeed;
1344-
border-radius: 0;
1345-
contain: layout style;
1346-
transition: none;
1347-
}
1348-
1349-
.isLOD .lg-node-header {
1350-
border-radius: 0;
1351-
pointer-events: none;
1352-
}
1353-
1354-
.isLOD .lg-node-widgets {
1355-
pointer-events: none;
1356-
}
1357-
1358-
.lod-toggle {
1359-
visibility: visible;
1360-
}
1361-
1362-
.isLOD .lod-toggle {
1363-
visibility: hidden;
1364-
}
1365-
1366-
.lod-fallback {
1367-
display: none;
1368-
}
1369-
1370-
.isLOD .lod-fallback {
1371-
display: block;
1372-
}
1373-
1374-
.isLOD .image-preview img {
1375-
image-rendering: pixelated;
1376-
}
1377-
1378-
.isLOD .slot-dot {
1379-
border-radius: 0;
1380-
}
1381-
/* END LOD specific styles */
1382-
13831332
/* ===================== Mask Editor Styles ===================== */
13841333
/* To be migrated to Tailwind later */
13851334
#maskEditor_brush {

src/composables/graph/useVueNodeLifecycle.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { shallowRef, watch } from 'vue'
33

44
import { useGraphNodeManager } from '@/composables/graph/useGraphNodeManager'
55
import type { GraphNodeManager } from '@/composables/graph/useGraphNodeManager'
6-
import { useRenderModeSetting } from '@/composables/settings/useRenderModeSetting'
76
import { useVueFeatureFlags } from '@/composables/useVueFeatureFlags'
87
import { useVueNodesMigrationDismissed } from '@/composables/useVueNodesMigrationDismissed'
98
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
@@ -26,11 +25,6 @@ function useVueNodeLifecycleIndividual() {
2625

2726
let hasShownMigrationToast = false
2827

29-
useRenderModeSetting(
30-
{ setting: 'LiteGraph.Canvas.MinFontSizeForLOD', vue: 0, litegraph: 8 },
31-
shouldRenderVueNodes
32-
)
33-
3428
const initializeNodeManager = () => {
3529
// Use canvas graph if available (handles subgraph contexts), fallback to app graph
3630
const activeGraph = comfyApp.canvas?.graph

src/composables/settings/useRenderModeSetting.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/platform/settings/composables/useSettingSearch.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import {
88
} from '@/platform/settings/settingStore'
99
import type { ISettingGroup, SettingParams } from '@/platform/settings/types'
1010
import { normalizeI18nKey } from '@/utils/formatUtil'
11+
import { useVueFeatureFlags } from '@/composables/useVueFeatureFlags'
1112

1213
export function useSettingSearch() {
1314
const settingStore = useSettingStore()
15+
const { shouldRenderVueNodes } = useVueFeatureFlags()
1416

1517
const searchQuery = ref<string>('')
1618
const filteredSettingIds = ref<string[]>([])
@@ -54,7 +56,11 @@ export function useSettingSearch() {
5456
const allSettings = Object.values(settingStore.settingsById)
5557
const filteredSettings = allSettings.filter((setting) => {
5658
// Filter out hidden and deprecated settings, just like in normal settings tree
57-
if (setting.type === 'hidden' || setting.deprecated) {
59+
if (
60+
setting.type === 'hidden' ||
61+
setting.deprecated ||
62+
(shouldRenderVueNodes.value && setting.hideInVueNodes)
63+
) {
5864
return false
5965
}
6066

src/platform/settings/composables/useSettingUI.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { SettingParams } from '@/platform/settings/types'
1010
import { isElectron } from '@/utils/envUtil'
1111
import { normalizeI18nKey } from '@/utils/formatUtil'
1212
import { buildTree } from '@/utils/treeUtil'
13+
import { useVueFeatureFlags } from '@/composables/useVueFeatureFlags'
1314

1415
interface SettingPanelItem {
1516
node: SettingTreeNode
@@ -31,10 +32,14 @@ export function useSettingUI(
3132
const settingStore = useSettingStore()
3233
const activeCategory = ref<SettingTreeNode | null>(null)
3334

35+
const { shouldRenderVueNodes } = useVueFeatureFlags()
36+
3437
const settingRoot = computed<SettingTreeNode>(() => {
3538
const root = buildTree(
3639
Object.values(settingStore.settingsById).filter(
37-
(setting: SettingParams) => setting.type !== 'hidden'
40+
(setting: SettingParams) =>
41+
setting.type !== 'hidden' &&
42+
!(shouldRenderVueNodes.value && setting.hideInVueNodes)
3843
),
3944
(setting: SettingParams) => setting.category || setting.id.split('.')
4045
)

src/platform/settings/constants/coreSettings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,8 @@ export const CORE_SETTINGS: SettingParams[] = [
919919
step: 1
920920
},
921921
defaultValue: 8,
922-
versionAdded: '1.26.7'
922+
versionAdded: '1.26.7',
923+
hideInVueNodes: true
923924
},
924925
{
925926
id: 'Comfy.Canvas.SelectionToolbox',

src/platform/settings/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface SettingParams<TValue = unknown> extends FormItem {
4747
// sortOrder for sorting settings within a group. Higher values appear first.
4848
// Default is 0 if not specified.
4949
sortOrder?: number
50+
hideInVueNodes?: boolean
5051
}
5152

5253
/**

0 commit comments

Comments
 (0)