mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Move linkRenderMode extension to core (#1359)
This commit is contained in:
@@ -105,6 +105,14 @@ watchEffect(() => {
|
||||
})
|
||||
})
|
||||
|
||||
watchEffect(() => {
|
||||
const linkRenderMode = settingStore.get('Comfy.LinkRenderMode')
|
||||
if (canvasStore.canvas) {
|
||||
canvasStore.canvas.links_render_mode = linkRenderMode
|
||||
canvasStore.canvas.setDirty(/* fg */ false, /* bg */ true)
|
||||
}
|
||||
})
|
||||
|
||||
watchEffect(() => {
|
||||
if (!canvasStore.canvas) return
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import './groupNodeManage'
|
||||
import './groupOptions'
|
||||
import './invertMenuScrolling'
|
||||
import './keybinds'
|
||||
import './linkRenderMode'
|
||||
import './maskeditor'
|
||||
import './nodeTemplates'
|
||||
import './noteNode'
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import { app, ComfyApp } from '../../scripts/app'
|
||||
import { LiteGraph } from '@comfyorg/litegraph'
|
||||
const id = 'Comfy.LinkRenderMode'
|
||||
const ext = {
|
||||
name: id,
|
||||
async setup(app: ComfyApp) {
|
||||
app.ui.settings.addSetting({
|
||||
id,
|
||||
category: ['Comfy', 'Graph', 'LinkRenderMode'],
|
||||
name: 'Link Render Mode',
|
||||
defaultValue: 2,
|
||||
type: 'combo',
|
||||
options: [
|
||||
{ value: LiteGraph.STRAIGHT_LINK.toString(), text: 'Straight' },
|
||||
{ value: LiteGraph.LINEAR_LINK.toString(), text: 'Linear' },
|
||||
{ value: LiteGraph.SPLINE_LINK.toString(), text: 'Spline' },
|
||||
{ value: LiteGraph.HIDDEN_LINK.toString(), text: 'Hidden' }
|
||||
],
|
||||
onChange(value: number) {
|
||||
app.canvas.links_render_mode = +value
|
||||
app.canvas.setDirty(/* fg */ false, /* bg */ true)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
app.registerExtension(ext)
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
LinkReleaseTriggerMode
|
||||
} from '@/types/searchBoxTypes'
|
||||
import type { SettingParams } from '@/types/settingTypes'
|
||||
import { LiteGraph } from '@comfyorg/litegraph'
|
||||
|
||||
export const CORE_SETTINGS: SettingParams[] = [
|
||||
{
|
||||
@@ -444,5 +445,18 @@ export const CORE_SETTINGS: SettingParams[] = [
|
||||
'Recommended for node developers. This will validate all node definitions on startup.',
|
||||
defaultValue: false,
|
||||
versionAdded: '1.3.14'
|
||||
},
|
||||
{
|
||||
id: 'Comfy.LinkRenderMode',
|
||||
category: ['Comfy', 'Graph', 'LinkRenderMode'],
|
||||
name: 'Link Render Mode',
|
||||
defaultValue: 2,
|
||||
type: 'combo',
|
||||
options: [
|
||||
{ value: LiteGraph.STRAIGHT_LINK, text: 'Straight' },
|
||||
{ value: LiteGraph.LINEAR_LINK, text: 'Linear' },
|
||||
{ value: LiteGraph.SPLINE_LINK, text: 'Spline' },
|
||||
{ value: LiteGraph.HIDDEN_LINK, text: 'Hidden' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -511,7 +511,8 @@ const zSettings = z.record(z.any()).and(
|
||||
'Comfy.Keybinding.UnsetBindings': z.array(zKeybinding),
|
||||
'Comfy.Keybinding.NewBindings': z.array(zKeybinding),
|
||||
'Comfy.Extension.Disabled': z.array(z.string()),
|
||||
'Comfy.Settings.ExtensionPanel': z.boolean()
|
||||
'Comfy.Settings.ExtensionPanel': z.boolean(),
|
||||
'Comfy.LinkRenderMode': z.number()
|
||||
})
|
||||
.optional()
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ export type SettingCustomRenderer = (
|
||||
|
||||
export interface SettingOption {
|
||||
text: string
|
||||
value?: string
|
||||
value?: any
|
||||
}
|
||||
|
||||
export interface Setting {
|
||||
|
||||
Reference in New Issue
Block a user