mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Update node create to use active subgraph
This commit is contained in:
@@ -38,6 +38,7 @@ import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
|
|||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { useWidgetStore } from '@/stores/widgetStore'
|
import { useWidgetStore } from '@/stores/widgetStore'
|
||||||
|
import { useWorkflowStore } from '@/stores/workflowStore'
|
||||||
import { normalizeI18nKey } from '@/utils/formatUtil'
|
import { normalizeI18nKey } from '@/utils/formatUtil'
|
||||||
import {
|
import {
|
||||||
isImageNode,
|
isImageNode,
|
||||||
@@ -879,8 +880,10 @@ export const useLitegraphService = () => {
|
|||||||
options
|
options
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const graph = useWorkflowStore().activeSubgraph ?? app.graph
|
||||||
|
|
||||||
// @ts-expect-error fixme ts strict error
|
// @ts-expect-error fixme ts strict error
|
||||||
app.graph.add(node)
|
graph.add(node)
|
||||||
// @ts-expect-error fixme ts strict error
|
// @ts-expect-error fixme ts strict error
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user