mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 10:59:53 +00:00
[refactor] Improve workflow domain organization (#5584)
* [refactor] move workflow domain to its own folder * [refactor] Fix workflow platform architecture organization - Move workflow rendering functionality to renderer/thumbnail domain - Rename ui folder to management for better semantic clarity - Update all import paths to reflect proper domain boundaries - Fix test imports to use new structure Architecture improvements: - rendering → renderer/thumbnail (belongs with other rendering logic) - ui → management (better name for state management and UI integration) This ensures proper separation of concerns and domain boundaries. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * [fix] Resolve circular dependency between nodeDefStore and subgraphStore * [fix] Update browser test imports to use new workflow platform paths --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import dotenv from 'dotenv'
|
|||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
|
|
||||||
import type { LGraphNode } from '../../src/lib/litegraph/src/litegraph'
|
import type { LGraphNode } from '../../src/lib/litegraph/src/litegraph'
|
||||||
import type { NodeId } from '../../src/schemas/comfyWorkflowSchema'
|
import type { NodeId } from '../../src/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { KeyCombo } from '../../src/schemas/keyBindingSchema'
|
import type { KeyCombo } from '../../src/schemas/keyBindingSchema'
|
||||||
import type { useWorkspaceStore } from '../../src/stores/workspaceStore'
|
import type { useWorkspaceStore } from '../../src/stores/workspaceStore'
|
||||||
import { NodeBadgeMode } from '../../src/types/nodeSource'
|
import { NodeBadgeMode } from '../../src/types/nodeSource'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { Page } from '@playwright/test'
|
import type { Page } from '@playwright/test'
|
||||||
|
|
||||||
import type { NodeId } from '../../../src/schemas/comfyWorkflowSchema'
|
import type { NodeId } from '../../../src/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { ManageGroupNode } from '../../helpers/manageGroupNode'
|
import { ManageGroupNode } from '../../helpers/manageGroupNode'
|
||||||
import type { ComfyPage } from '../ComfyPage'
|
import type { ComfyPage } from '../ComfyPage'
|
||||||
import type { Position, Size } from '../types'
|
import type { Position, Size } from '../types'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import path from 'path'
|
|||||||
import {
|
import {
|
||||||
TemplateInfo,
|
TemplateInfo,
|
||||||
WorkflowTemplates
|
WorkflowTemplates
|
||||||
} from '../../src/types/workflowTemplateTypes'
|
} from '../../src/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
export class ComfyTemplates {
|
export class ComfyTemplates {
|
||||||
readonly content: Locator
|
readonly content: Locator
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { zodToJsonSchema } from 'zod-to-json-schema'
|
|||||||
import {
|
import {
|
||||||
zComfyWorkflow,
|
zComfyWorkflow,
|
||||||
zComfyWorkflow1
|
zComfyWorkflow1
|
||||||
} from '../src/schemas/comfyWorkflowSchema'
|
} from '../src/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { zComfyNodeDef as zComfyNodeDefV2 } from '../src/schemas/nodeDef/nodeDefSchemaV2'
|
import { zComfyNodeDef as zComfyNodeDefV2 } from '../src/schemas/nodeDef/nodeDefSchemaV2'
|
||||||
import { zComfyNodeDef as zComfyNodeDefV1 } from '../src/schemas/nodeDefSchema'
|
import { zComfyNodeDef as zComfyNodeDefV1 } from '../src/schemas/nodeDefSchema'
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ import { computed, onUpdated, ref, watch } from 'vue'
|
|||||||
|
|
||||||
import SubgraphBreadcrumbItem from '@/components/breadcrumb/SubgraphBreadcrumbItem.vue'
|
import SubgraphBreadcrumbItem from '@/components/breadcrumb/SubgraphBreadcrumbItem.vue'
|
||||||
import { useOverflowObserver } from '@/composables/element/useOverflowObserver'
|
import { useOverflowObserver } from '@/composables/element/useOverflowObserver'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
||||||
import { useSubgraphStore } from '@/stores/subgraphStore'
|
import { useSubgraphStore } from '@/stores/subgraphStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { forEachSubgraphNode } from '@/utils/graphTraversalUtil'
|
import { forEachSubgraphNode } from '@/utils/graphTraversalUtil'
|
||||||
|
|
||||||
const MIN_WIDTH = 28
|
const MIN_WIDTH = 28
|
||||||
|
|||||||
@@ -53,11 +53,14 @@ import Tag from 'primevue/tag'
|
|||||||
import { computed, nextTick, ref } from 'vue'
|
import { computed, nextTick, ref } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import {
|
||||||
|
ComfyWorkflow,
|
||||||
|
useWorkflowStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
||||||
import { ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { appendJsonExt } from '@/utils/formatUtil'
|
import { appendJsonExt } from '@/utils/formatUtil'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeUnmount, onMounted } from 'vue'
|
import { onBeforeUnmount, onMounted } from 'vue'
|
||||||
|
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
const settingStore = useSettingStore()
|
const settingStore = useSettingStore()
|
||||||
const workflowStore = useWorkflowStore()
|
const workflowStore = useWorkflowStore()
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ import { useI18n } from 'vue-i18n'
|
|||||||
|
|
||||||
import DotSpinner from '@/components/common/DotSpinner.vue'
|
import DotSpinner from '@/components/common/DotSpinner.vue'
|
||||||
import { useConflictDetection } from '@/composables/useConflictDetection'
|
import { useConflictDetection } from '@/composables/useConflictDetection'
|
||||||
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { useComfyManagerService } from '@/services/comfyManagerService'
|
import { useComfyManagerService } from '@/services/comfyManagerService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import {
|
import {
|
||||||
useComfyManagerStore,
|
useComfyManagerStore,
|
||||||
useManagerProgressDialogStore
|
useManagerProgressDialogStore
|
||||||
|
|||||||
@@ -107,11 +107,13 @@ import { useGlobalLitegraph } from '@/composables/useGlobalLitegraph'
|
|||||||
import { useLitegraphSettings } from '@/composables/useLitegraphSettings'
|
import { useLitegraphSettings } from '@/composables/useLitegraphSettings'
|
||||||
import { usePaste } from '@/composables/usePaste'
|
import { usePaste } from '@/composables/usePaste'
|
||||||
import { useVueFeatureFlags } from '@/composables/useVueFeatureFlags'
|
import { useVueFeatureFlags } from '@/composables/useVueFeatureFlags'
|
||||||
import { useWorkflowAutoSave } from '@/composables/useWorkflowAutoSave'
|
|
||||||
import { useWorkflowPersistence } from '@/composables/useWorkflowPersistence'
|
|
||||||
import { CORE_SETTINGS } from '@/constants/coreSettings'
|
import { CORE_SETTINGS } from '@/constants/coreSettings'
|
||||||
import { i18n, t } from '@/i18n'
|
import { i18n, t } from '@/i18n'
|
||||||
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import { useWorkflowAutoSave } from '@/platform/workflow/persistence/composables/useWorkflowAutoSave'
|
||||||
|
import { useWorkflowPersistence } from '@/platform/workflow/persistence/composables/useWorkflowPersistence'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { SelectedNodeIdsKey } from '@/renderer/core/canvas/injectionKeys'
|
import { SelectedNodeIdsKey } from '@/renderer/core/canvas/injectionKeys'
|
||||||
import TransformPane from '@/renderer/core/layout/transform/TransformPane.vue'
|
import TransformPane from '@/renderer/core/layout/transform/TransformPane.vue'
|
||||||
@@ -125,13 +127,11 @@ import { ChangeTracker } from '@/scripts/changeTracker'
|
|||||||
import { IS_CONTROL_WIDGET, updateControlWidgetLabel } from '@/scripts/widgets'
|
import { IS_CONTROL_WIDGET, updateControlWidgetLabel } from '@/scripts/widgets'
|
||||||
import { useColorPaletteService } from '@/services/colorPaletteService'
|
import { useColorPaletteService } from '@/services/colorPaletteService'
|
||||||
import { newUserService } from '@/services/newUserService'
|
import { newUserService } from '@/services/newUserService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
||||||
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
|
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
|
||||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { createI18n } from 'vue-i18n'
|
|||||||
|
|
||||||
// Import after mocks
|
// Import after mocks
|
||||||
import ColorPickerButton from '@/components/graph/selectionToolbox/ColorPickerButton.vue'
|
import ColorPickerButton from '@/components/graph/selectionToolbox/ColorPickerButton.vue'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
// Mock the litegraph module
|
// Mock the litegraph module
|
||||||
vi.mock('@/lib/litegraph/src/litegraph', async () => {
|
vi.mock('@/lib/litegraph/src/litegraph', async () => {
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ import {
|
|||||||
LiteGraph,
|
LiteGraph,
|
||||||
isColorable
|
isColorable
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
||||||
import { adjustColor } from '@/utils/colorUtil'
|
import { adjustColor } from '@/utils/colorUtil'
|
||||||
import { getItemsColorOption } from '@/utils/litegraphUtil'
|
import { getItemsColorOption } from '@/utils/litegraphUtil'
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ import {
|
|||||||
LiteGraphCanvasEvent
|
LiteGraphCanvasEvent
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
import type { CanvasPointerEvent } from '@/lib/litegraph/src/types/events'
|
import type { CanvasPointerEvent } from '@/lib/litegraph/src/types/events'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
|
import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
|
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
|
||||||
import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes'
|
import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes'
|
||||||
import { FuseFilterWithValue } from '@/utils/fuseUtil'
|
import { FuseFilterWithValue } from '@/utils/fuseUtil'
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ import { useI18n } from 'vue-i18n'
|
|||||||
|
|
||||||
import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
|
import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
|
||||||
import VirtualGrid from '@/components/common/VirtualGrid.vue'
|
import VirtualGrid from '@/components/common/VirtualGrid.vue'
|
||||||
import { ComfyNode } from '@/schemas/comfyWorkflowSchema'
|
import { ComfyNode } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
|
|||||||
@@ -141,13 +141,13 @@ import TreeExplorerTreeNode from '@/components/common/TreeExplorerTreeNode.vue'
|
|||||||
import SidebarTabTemplate from '@/components/sidebar/tabs/SidebarTabTemplate.vue'
|
import SidebarTabTemplate from '@/components/sidebar/tabs/SidebarTabTemplate.vue'
|
||||||
import WorkflowTreeLeaf from '@/components/sidebar/tabs/workflows/WorkflowTreeLeaf.vue'
|
import WorkflowTreeLeaf from '@/components/sidebar/tabs/workflows/WorkflowTreeLeaf.vue'
|
||||||
import { useTreeExpansion } from '@/composables/useTreeExpansion'
|
import { useTreeExpansion } from '@/composables/useTreeExpansion'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
|
||||||
import {
|
import {
|
||||||
useWorkflowBookmarkStore,
|
useWorkflowBookmarkStore,
|
||||||
useWorkflowStore
|
useWorkflowStore
|
||||||
} from '@/stores/workflowStore'
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { ComfyWorkflow } from '@/stores/workflowStore'
|
import { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||||
import type { TreeNode } from '@/types/treeExplorerTypes'
|
import type { TreeNode } from '@/types/treeExplorerTypes'
|
||||||
import { TreeExplorerNode } from '@/types/treeExplorerTypes'
|
import { TreeExplorerNode } from '@/types/treeExplorerTypes'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Galleria from 'primevue/galleria'
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { createApp, nextTick } from 'vue'
|
import { createApp, nextTick } from 'vue'
|
||||||
|
|
||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { ResultItemImpl } from '@/stores/queueStore'
|
import type { ResultItemImpl } from '@/stores/queueStore'
|
||||||
|
|
||||||
import ResultGallery from './ResultGallery.vue'
|
import ResultGallery from './ResultGallery.vue'
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ import Button from 'primevue/button'
|
|||||||
import Tag from 'primevue/tag'
|
import Tag from 'primevue/tag'
|
||||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||||
|
|
||||||
import { ComfyNode } from '@/schemas/comfyWorkflowSchema'
|
import { ComfyNode } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
import { TaskItemDisplayStatus, type TaskItemImpl } from '@/stores/queueStore'
|
import { TaskItemDisplayStatus, type TaskItemImpl } from '@/stores/queueStore'
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ import Button from 'primevue/button'
|
|||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
import TreeExplorerTreeNode from '@/components/common/TreeExplorerTreeNode.vue'
|
import TreeExplorerTreeNode from '@/components/common/TreeExplorerTreeNode.vue'
|
||||||
import { ComfyWorkflow, useWorkflowBookmarkStore } from '@/stores/workflowStore'
|
import {
|
||||||
|
ComfyWorkflow,
|
||||||
|
useWorkflowBookmarkStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import type { RenderedTreeExplorerNode } from '@/types/treeExplorerTypes'
|
import type { RenderedTreeExplorerNode } from '@/types/treeExplorerTypes'
|
||||||
|
|
||||||
const { node } = defineProps<{
|
const { node } = defineProps<{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest'
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
import TemplateWorkflowCard from '@/components/templates/TemplateWorkflowCard.vue'
|
import TemplateWorkflowCard from '@/components/templates/TemplateWorkflowCard.vue'
|
||||||
import { TemplateInfo } from '@/types/workflowTemplateTypes'
|
import { TemplateInfo } from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
vi.mock('@/components/templates/thumbnails/AudioThumbnail.vue', () => ({
|
vi.mock('@/components/templates/thumbnails/AudioThumbnail.vue', () => ({
|
||||||
default: {
|
default: {
|
||||||
@@ -64,13 +64,16 @@ vi.mock('@/stores/dialogStore', () => ({
|
|||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock('@/stores/workflowTemplatesStore', () => ({
|
vi.mock(
|
||||||
useWorkflowTemplatesStore: () => ({
|
'@/platform/workflow/templates/repositories/workflowTemplatesStore',
|
||||||
isLoaded: true,
|
() => ({
|
||||||
loadWorkflowTemplates: vi.fn().mockResolvedValue(true),
|
useWorkflowTemplatesStore: () => ({
|
||||||
groupedTemplates: []
|
isLoaded: true,
|
||||||
|
loadWorkflowTemplates: vi.fn().mockResolvedValue(true),
|
||||||
|
groupedTemplates: []
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}))
|
)
|
||||||
|
|
||||||
vi.mock('vue-i18n', () => ({
|
vi.mock('vue-i18n', () => ({
|
||||||
useI18n: () => ({
|
useI18n: () => ({
|
||||||
@@ -78,35 +81,42 @@ vi.mock('vue-i18n', () => ({
|
|||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock('@/composables/useTemplateWorkflows', () => ({
|
vi.mock(
|
||||||
useTemplateWorkflows: () => ({
|
'@/platform/workflow/templates/composables/useTemplateWorkflows',
|
||||||
getTemplateThumbnailUrl: (
|
() => ({
|
||||||
template: TemplateInfo,
|
useTemplateWorkflows: () => ({
|
||||||
sourceModule: string,
|
getTemplateThumbnailUrl: (
|
||||||
index = ''
|
template: TemplateInfo,
|
||||||
) => {
|
sourceModule: string,
|
||||||
const basePath =
|
index = ''
|
||||||
sourceModule === 'default'
|
) => {
|
||||||
? `/fileURL/templates/${template.name}`
|
const basePath =
|
||||||
: `/apiURL/workflow_templates/${sourceModule}/${template.name}`
|
sourceModule === 'default'
|
||||||
const indexSuffix = sourceModule === 'default' && index ? `-${index}` : ''
|
? `/fileURL/templates/${template.name}`
|
||||||
return `${basePath}${indexSuffix}.${template.mediaSubtype}`
|
: `/apiURL/workflow_templates/${sourceModule}/${template.name}`
|
||||||
},
|
const indexSuffix =
|
||||||
getTemplateTitle: (template: TemplateInfo, sourceModule: string) => {
|
sourceModule === 'default' && index ? `-${index}` : ''
|
||||||
const fallback =
|
return `${basePath}${indexSuffix}.${template.mediaSubtype}`
|
||||||
template.title ?? template.name ?? `${sourceModule} Template`
|
},
|
||||||
return sourceModule === 'default'
|
getTemplateTitle: (template: TemplateInfo, sourceModule: string) => {
|
||||||
? template.localizedTitle ?? fallback
|
const fallback =
|
||||||
: fallback
|
template.title ?? template.name ?? `${sourceModule} Template`
|
||||||
},
|
return sourceModule === 'default'
|
||||||
getTemplateDescription: (template: TemplateInfo, sourceModule: string) => {
|
? template.localizedTitle ?? fallback
|
||||||
return sourceModule === 'default'
|
: fallback
|
||||||
? template.localizedDescription ?? ''
|
},
|
||||||
: template.description?.replace(/[-_]/g, ' ').trim() ?? ''
|
getTemplateDescription: (
|
||||||
},
|
template: TemplateInfo,
|
||||||
loadWorkflowTemplate: vi.fn()
|
sourceModule: string
|
||||||
|
) => {
|
||||||
|
return sourceModule === 'default'
|
||||||
|
? template.localizedDescription ?? ''
|
||||||
|
: template.description?.replace(/[-_]/g, ' ').trim() ?? ''
|
||||||
|
},
|
||||||
|
loadWorkflowTemplate: vi.fn()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}))
|
)
|
||||||
|
|
||||||
describe('TemplateWorkflowCard', () => {
|
describe('TemplateWorkflowCard', () => {
|
||||||
const createTemplate = (overrides = {}): TemplateInfo => ({
|
const createTemplate = (overrides = {}): TemplateInfo => ({
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ import AudioThumbnail from '@/components/templates/thumbnails/AudioThumbnail.vue
|
|||||||
import CompareSliderThumbnail from '@/components/templates/thumbnails/CompareSliderThumbnail.vue'
|
import CompareSliderThumbnail from '@/components/templates/thumbnails/CompareSliderThumbnail.vue'
|
||||||
import DefaultThumbnail from '@/components/templates/thumbnails/DefaultThumbnail.vue'
|
import DefaultThumbnail from '@/components/templates/thumbnails/DefaultThumbnail.vue'
|
||||||
import HoverDissolveThumbnail from '@/components/templates/thumbnails/HoverDissolveThumbnail.vue'
|
import HoverDissolveThumbnail from '@/components/templates/thumbnails/HoverDissolveThumbnail.vue'
|
||||||
import { useTemplateWorkflows } from '@/composables/useTemplateWorkflows'
|
import { useTemplateWorkflows } from '@/platform/workflow/templates/composables/useTemplateWorkflows'
|
||||||
import { TemplateInfo } from '@/types/workflowTemplateTypes'
|
import { TemplateInfo } from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
const UPSCALE_ZOOM_SCALE = 16 // for upscale templates, exaggerate the hover zoom
|
const UPSCALE_ZOOM_SCALE = 16 // for upscale templates, exaggerate the hover zoom
|
||||||
const DEFAULT_ZOOM_SCALE = 5
|
const DEFAULT_ZOOM_SCALE = 5
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ import Column from 'primevue/column'
|
|||||||
import DataTable from 'primevue/datatable'
|
import DataTable from 'primevue/datatable'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
import { useTemplateWorkflows } from '@/composables/useTemplateWorkflows'
|
import { useTemplateWorkflows } from '@/platform/workflow/templates/composables/useTemplateWorkflows'
|
||||||
import type { TemplateInfo } from '@/types/workflowTemplateTypes'
|
import type { TemplateInfo } from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
const { sourceModule, loading, templates } = defineProps<{
|
const { sourceModule, loading, templates } = defineProps<{
|
||||||
sourceModule: string
|
sourceModule: string
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest'
|
|||||||
import { createI18n } from 'vue-i18n'
|
import { createI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import TemplateWorkflowView from '@/components/templates/TemplateWorkflowView.vue'
|
import TemplateWorkflowView from '@/components/templates/TemplateWorkflowView.vue'
|
||||||
import { TemplateInfo } from '@/types/workflowTemplateTypes'
|
import { TemplateInfo } from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
vi.mock('primevue/dataview', () => ({
|
vi.mock('primevue/dataview', () => ({
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ import TemplateWorkflowList from '@/components/templates/TemplateWorkflowList.vu
|
|||||||
import { useIntersectionObserver } from '@/composables/useIntersectionObserver'
|
import { useIntersectionObserver } from '@/composables/useIntersectionObserver'
|
||||||
import { useLazyPagination } from '@/composables/useLazyPagination'
|
import { useLazyPagination } from '@/composables/useLazyPagination'
|
||||||
import { useTemplateFiltering } from '@/composables/useTemplateFiltering'
|
import { useTemplateFiltering } from '@/composables/useTemplateFiltering'
|
||||||
import type { TemplateInfo } from '@/types/workflowTemplateTypes'
|
import type { TemplateInfo } from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ import { watch } from 'vue'
|
|||||||
import TemplateWorkflowView from '@/components/templates/TemplateWorkflowView.vue'
|
import TemplateWorkflowView from '@/components/templates/TemplateWorkflowView.vue'
|
||||||
import TemplateWorkflowsSideNav from '@/components/templates/TemplateWorkflowsSideNav.vue'
|
import TemplateWorkflowsSideNav from '@/components/templates/TemplateWorkflowsSideNav.vue'
|
||||||
import { useResponsiveCollapse } from '@/composables/element/useResponsiveCollapse'
|
import { useResponsiveCollapse } from '@/composables/element/useResponsiveCollapse'
|
||||||
import { useTemplateWorkflows } from '@/composables/useTemplateWorkflows'
|
import { useTemplateWorkflows } from '@/platform/workflow/templates/composables/useTemplateWorkflows'
|
||||||
import type { WorkflowTemplates } from '@/types/workflowTemplateTypes'
|
import type { WorkflowTemplates } from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isSmallScreen,
|
isSmallScreen,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import ScrollPanel from 'primevue/scrollpanel'
|
|||||||
import type {
|
import type {
|
||||||
TemplateGroup,
|
TemplateGroup,
|
||||||
WorkflowTemplates
|
WorkflowTemplates
|
||||||
} from '@/types/workflowTemplateTypes'
|
} from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
tabs: TemplateGroup[]
|
tabs: TemplateGroup[]
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import Button from 'primevue/button'
|
|||||||
import Toast from 'primevue/toast'
|
import Toast from 'primevue/toast'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import type { WorkflowJSON04 } from '@/schemas/comfyWorkflowSchema'
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import type { WorkflowJSON04 } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { migrateLegacyRerouteNodes } from '@/utils/migration/migrateReroute'
|
import { migrateLegacyRerouteNodes } from '@/utils/migration/migrateReroute'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ import Button from 'primevue/button'
|
|||||||
import Menu from 'primevue/menu'
|
import Menu from 'primevue/menu'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
import type { ComfyWorkflow } from '@/stores/workflowStore'
|
import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
workflows: ComfyWorkflow[]
|
workflows: ComfyWorkflow[]
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ import {
|
|||||||
usePragmaticDraggable,
|
usePragmaticDraggable,
|
||||||
usePragmaticDroppable
|
usePragmaticDroppable
|
||||||
} from '@/composables/usePragmaticDragAndDrop'
|
} from '@/composables/usePragmaticDragAndDrop'
|
||||||
import { useWorkflowThumbnail } from '@/renderer/thumbnail/composables/useWorkflowThumbnail'
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
import { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import { useWorkflowThumbnail } from '@/renderer/thumbnail/useWorkflowThumbnail'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { ComfyWorkflow } from '@/stores/workflowStore'
|
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||||
|
|
||||||
import WorkflowTabPopover from './WorkflowTabPopover.vue'
|
import WorkflowTabPopover from './WorkflowTabPopover.vue'
|
||||||
|
|||||||
@@ -81,11 +81,14 @@ import { useI18n } from 'vue-i18n'
|
|||||||
|
|
||||||
import WorkflowTab from '@/components/topbar/WorkflowTab.vue'
|
import WorkflowTab from '@/components/topbar/WorkflowTab.vue'
|
||||||
import { useOverflowObserver } from '@/composables/element/useOverflowObserver'
|
import { useOverflowObserver } from '@/composables/element/useOverflowObserver'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import {
|
||||||
|
ComfyWorkflow,
|
||||||
|
useWorkflowBookmarkStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { ComfyWorkflow, useWorkflowBookmarkStore } from '@/stores/workflowStore'
|
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||||
import { isElectron } from '@/utils/envUtil'
|
import { isElectron } from '@/utils/envUtil'
|
||||||
import { whileMouseDown } from '@/utils/mouseDownUtil'
|
import { whileMouseDown } from '@/utils/mouseDownUtil'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// call nextTick on all changeTracker
|
// call nextTick on all changeTracker
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composable for refreshing nodes in the graph
|
* Composable for refreshing nodes in the graph
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
type LGraphGroup,
|
type LGraphGroup,
|
||||||
type LGraphNode
|
type LGraphNode
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
import { useCanvasRefresh } from './useCanvasRefresh'
|
import { useCanvasRefresh } from './useCanvasRefresh'
|
||||||
import type { MenuOption } from './useMoreOptionsMenu'
|
import type { MenuOption } from './useMoreOptionsMenu'
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
|
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
|
||||||
import { LGraphEventMode } from '@/lib/litegraph/src/litegraph'
|
import { LGraphEventMode } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { filterOutputNodes } from '@/utils/nodeFilterUtil'
|
import { filterOutputNodes } from '@/utils/nodeFilterUtil'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems' // Unused for now
|
// import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems' // Unused for now
|
||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import {
|
import {
|
||||||
useCanvasStore,
|
useCanvasStore,
|
||||||
useTitleEditorStore
|
useTitleEditorStore
|
||||||
@@ -8,7 +9,6 @@ import {
|
|||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composable for handling basic selection operations like copy, paste, duplicate, delete, rename
|
* Composable for handling basic selection operations like copy, paste, duplicate, delete, rename
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
|
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
|
||||||
import { SubgraphNode } from '@/lib/litegraph/src/litegraph'
|
import { SubgraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
||||||
import { useNodeBookmarkStore } from '@/stores/nodeBookmarkStore'
|
import { useNodeBookmarkStore } from '@/stores/nodeBookmarkStore'
|
||||||
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { isLGraphNode } from '@/utils/litegraphUtil'
|
import { isLGraphNode } from '@/utils/litegraphUtil'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { computed, onUnmounted, ref } from 'vue'
|
|||||||
|
|
||||||
import { useNodePacks } from '@/composables/nodePack/useNodePacks'
|
import { useNodePacks } from '@/composables/nodePack/useNodePacks'
|
||||||
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
import { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useComfyRegistryStore } from '@/stores/comfyRegistryStore'
|
import { useComfyRegistryStore } from '@/stores/comfyRegistryStore'
|
||||||
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import { useTitle } from '@vueuse/core'
|
|||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
const DEFAULT_TITLE = 'ComfyUI'
|
const DEFAULT_TITLE = 'ComfyUI'
|
||||||
const TITLE_SUFFIX = ' - ComfyUI'
|
const TITLE_SUFFIX = ' - ComfyUI'
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { Ref } from 'vue'
|
|||||||
import { usePragmaticDroppable } from '@/composables/usePragmaticDragAndDrop'
|
import { usePragmaticDroppable } from '@/composables/usePragmaticDragAndDrop'
|
||||||
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { app as comfyApp } from '@/scripts/app'
|
import { app as comfyApp } from '@/scripts/app'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import { ComfyModelDef } from '@/stores/modelStore'
|
import { ComfyModelDef } from '@/stores/modelStore'
|
||||||
import { ModelNodeProvider } from '@/stores/modelToNodeStore'
|
import { ModelNodeProvider } from '@/stores/modelToNodeStore'
|
||||||
import { useModelToNodeStore } from '@/stores/modelToNodeStore'
|
import { useModelToNodeStore } from '@/stores/modelToNodeStore'
|
||||||
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
|
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
|
||||||
import { ComfyWorkflow } from '@/stores/workflowStore'
|
|
||||||
import { RenderedTreeExplorerNode } from '@/types/treeExplorerTypes'
|
import { RenderedTreeExplorerNode } from '@/types/treeExplorerTypes'
|
||||||
|
|
||||||
export const useCanvasDrop = (canvasRef: Ref<HTMLCanvasElement>) => {
|
export const useCanvasDrop = (canvasRef: Ref<HTMLCanvasElement>) => {
|
||||||
|
|||||||
@@ -15,6 +15,11 @@ import {
|
|||||||
SubgraphNode
|
SubgraphNode
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
import { Point } from '@/lib/litegraph/src/litegraph'
|
import { Point } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import {
|
||||||
|
type ComfyWorkflow,
|
||||||
|
useWorkflowStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import {
|
import {
|
||||||
useCanvasStore,
|
useCanvasStore,
|
||||||
useTitleEditorStore
|
useTitleEditorStore
|
||||||
@@ -23,7 +28,6 @@ import { api } from '@/scripts/api'
|
|||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import type { ComfyCommand } from '@/stores/commandStore'
|
import type { ComfyCommand } from '@/stores/commandStore'
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { useHelpCenterStore } from '@/stores/helpCenterStore'
|
import { useHelpCenterStore } from '@/stores/helpCenterStore'
|
||||||
@@ -33,7 +37,6 @@ import { useSettingStore } from '@/stores/settingStore'
|
|||||||
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
||||||
import { useSubgraphStore } from '@/stores/subgraphStore'
|
import { useSubgraphStore } from '@/stores/subgraphStore'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { type ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore'
|
import { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore'
|
||||||
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
||||||
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
|
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { useEventListener } from '@vueuse/core'
|
|||||||
|
|
||||||
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||||
import { isAudioNode, isImageNode, isVideoNode } from '@/utils/litegraphUtil'
|
import { isAudioNode, isImageNode, isVideoNode } from '@/utils/litegraphUtil'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type Ref, computed, ref } from 'vue'
|
import { type Ref, computed, ref } from 'vue'
|
||||||
|
|
||||||
import type { TemplateInfo } from '@/types/workflowTemplateTypes'
|
import type { TemplateInfo } from '@/platform/workflow/templates/types/template'
|
||||||
|
|
||||||
// @ts-expect-error unused (To be used later?)
|
// @ts-expect-error unused (To be used later?)
|
||||||
interface TemplateFilterOptions {
|
interface TemplateFilterOptions {
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import log from 'loglevel'
|
|||||||
|
|
||||||
import { PYTHON_MIRROR } from '@/constants/uvMirrors'
|
import { PYTHON_MIRROR } from '@/constants/uvMirrors'
|
||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||||
import { checkMirrorReachable } from '@/utils/networkUtil'
|
import { checkMirrorReachable } from '@/utils/networkUtil'
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
ComfyLink,
|
ComfyLink,
|
||||||
ComfyNode,
|
ComfyNode,
|
||||||
ComfyWorkflowJSON
|
ComfyWorkflowJSON
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
|
|||||||
@@ -3,20 +3,22 @@ import { toRaw } from 'vue'
|
|||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
import { LGraph, LGraphCanvas } from '@/lib/litegraph/src/litegraph'
|
import { LGraph, LGraphCanvas } from '@/lib/litegraph/src/litegraph'
|
||||||
import type { SerialisableGraph, Vector2 } from '@/lib/litegraph/src/litegraph'
|
import type { SerialisableGraph, Vector2 } from '@/lib/litegraph/src/litegraph'
|
||||||
import { useWorkflowThumbnail } from '@/renderer/thumbnail/composables/useWorkflowThumbnail'
|
import {
|
||||||
import { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
ComfyWorkflow,
|
||||||
|
useWorkflowStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
import { useWorkflowThumbnail } from '@/renderer/thumbnail/useWorkflowThumbnail'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { blankGraph, defaultGraph } from '@/scripts/defaultGraph'
|
import { blankGraph, defaultGraph } from '@/scripts/defaultGraph'
|
||||||
import { downloadBlob } from '@/scripts/utils'
|
import { downloadBlob } from '@/scripts/utils'
|
||||||
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useDomWidgetStore } from '@/stores/domWidgetStore'
|
import { useDomWidgetStore } from '@/stores/domWidgetStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||||
import { appendJsonExt, generateUUID } from '@/utils/formatUtil'
|
import { appendJsonExt, generateUUID } from '@/utils/formatUtil'
|
||||||
|
|
||||||
import { useDialogService } from './dialogService'
|
|
||||||
|
|
||||||
export const useWorkflowService = () => {
|
export const useWorkflowService = () => {
|
||||||
const settingStore = useSettingStore()
|
const settingStore = useSettingStore()
|
||||||
const workflowStore = useWorkflowStore()
|
const workflowStore = useWorkflowStore()
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { markRaw } from 'vue'
|
import { markRaw } from 'vue'
|
||||||
|
|
||||||
import WorkflowsSidebarTab from '@/components/sidebar/tabs/WorkflowsSidebarTab.vue'
|
import WorkflowsSidebarTab from '@/components/sidebar/tabs/WorkflowsSidebarTab.vue'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import type { SidebarTabExtension } from '@/types/extensionTypes'
|
import type { SidebarTabExtension } from '@/types/extensionTypes'
|
||||||
|
|
||||||
export const useWorkflowsSidebarTab = (): SidebarTabExtension => {
|
export const useWorkflowsSidebarTab = (): SidebarTabExtension => {
|
||||||
@@ -4,14 +4,15 @@ import { type Raw, computed, markRaw, ref, shallowRef, watch } from 'vue'
|
|||||||
|
|
||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
import type { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph'
|
import type { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph'
|
||||||
import { useWorkflowThumbnail } from '@/renderer/thumbnail/composables/useWorkflowThumbnail'
|
import { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
import { useWorkflowThumbnail } from '@/renderer/thumbnail/useWorkflowThumbnail'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { app as comfyApp } from '@/scripts/app'
|
import { app as comfyApp } from '@/scripts/app'
|
||||||
import { ChangeTracker } from '@/scripts/changeTracker'
|
import { ChangeTracker } from '@/scripts/changeTracker'
|
||||||
import { defaultGraphJSON } from '@/scripts/defaultGraph'
|
import { defaultGraphJSON } from '@/scripts/defaultGraph'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
|
import { UserFile } from '@/stores/userFileStore'
|
||||||
import type { NodeExecutionId, NodeLocatorId } from '@/types/nodeIdentification'
|
import type { NodeExecutionId, NodeLocatorId } from '@/types/nodeIdentification'
|
||||||
import {
|
import {
|
||||||
createNodeExecutionId,
|
createNodeExecutionId,
|
||||||
@@ -23,8 +24,6 @@ import { getPathDetails } from '@/utils/formatUtil'
|
|||||||
import { syncEntities } from '@/utils/syncUtil'
|
import { syncEntities } from '@/utils/syncUtil'
|
||||||
import { isSubgraph } from '@/utils/typeGuardUtil'
|
import { isSubgraph } from '@/utils/typeGuardUtil'
|
||||||
|
|
||||||
import { UserFile } from './userFileStore'
|
|
||||||
|
|
||||||
export class ComfyWorkflow extends UserFile {
|
export class ComfyWorkflow extends UserFile {
|
||||||
static readonly basePath: string = 'workflows/'
|
static readonly basePath: string = 'workflows/'
|
||||||
readonly tintCanvasBg?: string
|
readonly tintCanvasBg?: string
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import { computed, onUnmounted, watch } from 'vue'
|
import { computed, onUnmounted, watch } from 'vue'
|
||||||
|
|
||||||
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
export function useWorkflowAutoSave() {
|
export function useWorkflowAutoSave() {
|
||||||
const workflowStore = useWorkflowStore()
|
const workflowStore = useWorkflowStore()
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import { tryOnScopeDispose } from '@vueuse/core'
|
import { tryOnScopeDispose } from '@vueuse/core'
|
||||||
import { computed, watch } from 'vue'
|
import { computed, watch } from 'vue'
|
||||||
|
|
||||||
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { app as comfyApp } from '@/scripts/app'
|
import { app as comfyApp } from '@/scripts/app'
|
||||||
import { getStorageValue, setStorageValue } from '@/scripts/utils'
|
import { getStorageValue, setStorageValue } from '@/scripts/utils'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
export function useWorkflowPersistence() {
|
export function useWorkflowPersistence() {
|
||||||
const workflowStore = useWorkflowStore()
|
const workflowStore = useWorkflowStore()
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import { api } from '@/scripts/api'
|
import { useWorkflowTemplatesStore } from '@/platform/workflow/templates/repositories/workflowTemplatesStore'
|
||||||
import { app } from '@/scripts/app'
|
|
||||||
import { useDialogStore } from '@/stores/dialogStore'
|
|
||||||
import { useWorkflowTemplatesStore } from '@/stores/workflowTemplatesStore'
|
|
||||||
import type {
|
import type {
|
||||||
TemplateGroup,
|
TemplateGroup,
|
||||||
TemplateInfo,
|
TemplateInfo,
|
||||||
WorkflowTemplates
|
WorkflowTemplates
|
||||||
} from '@/types/workflowTemplateTypes'
|
} from '@/platform/workflow/templates/types/template'
|
||||||
|
import { api } from '@/scripts/api'
|
||||||
|
import { app } from '@/scripts/app'
|
||||||
|
import { useDialogStore } from '@/stores/dialogStore'
|
||||||
|
|
||||||
export function useTemplateWorkflows() {
|
export function useTemplateWorkflows() {
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
@@ -3,12 +3,12 @@ import { defineStore } from 'pinia'
|
|||||||
import { computed, ref, shallowRef } from 'vue'
|
import { computed, ref, shallowRef } from 'vue'
|
||||||
|
|
||||||
import { st } from '@/i18n'
|
import { st } from '@/i18n'
|
||||||
import { api } from '@/scripts/api'
|
|
||||||
import type {
|
import type {
|
||||||
TemplateGroup,
|
TemplateGroup,
|
||||||
TemplateInfo,
|
TemplateInfo,
|
||||||
WorkflowTemplates
|
WorkflowTemplates
|
||||||
} from '@/types/workflowTemplateTypes'
|
} from '@/platform/workflow/templates/types/template'
|
||||||
|
import { api } from '@/scripts/api'
|
||||||
import { normalizeI18nKey } from '@/utils/formatUtil'
|
import { normalizeI18nKey } from '@/utils/formatUtil'
|
||||||
|
|
||||||
const SHOULD_SORT_CATEGORIES = new Set([
|
const SHOULD_SORT_CATEGORIES = new Set([
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { ISerialisedGraph } from '@/lib/litegraph/src/types/serialisation'
|
import type { ISerialisedGraph } from '@/lib/litegraph/src/types/serialisation'
|
||||||
import type { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { validateComfyWorkflow } from '@/schemas/comfyWorkflowSchema'
|
import { validateComfyWorkflow } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { fixBadLinks } from '@/utils/linkFixer'
|
import { fixBadLinks } from '@/utils/linkFixer'
|
||||||
|
|
||||||
@@ -2,9 +2,9 @@ import { useRafFn } from '@vueuse/core'
|
|||||||
import { computed, nextTick, ref, watch } from 'vue'
|
import { computed, nextTick, ref, watch } from 'vue'
|
||||||
|
|
||||||
import type { LGraph } from '@/lib/litegraph/src/litegraph'
|
import type { LGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
import type { MinimapCanvas, MinimapSettingsKey } from '../types'
|
import type { MinimapCanvas, MinimapSettingsKey } from '../types'
|
||||||
import { useMinimapGraph } from './useMinimapGraph'
|
import { useMinimapGraph } from './useMinimapGraph'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ref } from 'vue'
|
|||||||
import type { Ref } from 'vue'
|
import type { Ref } from 'vue'
|
||||||
|
|
||||||
import type { LGraph, LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraph, LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
|
|
||||||
import type { UpdateFlags } from '../types'
|
import type { UpdateFlags } from '../types'
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
* Provides focused functionality for managing node layering through z-index.
|
* Provides focused functionality for managing node layering through z-index.
|
||||||
* Integrates with the layout system to ensure proper visual ordering.
|
* Integrates with the layout system to ensure proper visual ordering.
|
||||||
*/
|
*/
|
||||||
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { useLayoutMutations } from '@/renderer/core/layout/operations/layoutMutations'
|
import { useLayoutMutations } from '@/renderer/core/layout/operations/layoutMutations'
|
||||||
import { LayoutSource } from '@/renderer/core/layout/types'
|
import { LayoutSource } from '@/renderer/core/layout/types'
|
||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
|
||||||
|
|
||||||
interface NodeZIndexOptions {
|
interface NodeZIndexOptions {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import type { LGraph } from '@/lib/litegraph/src/litegraph'
|
import type { LGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import {
|
import {
|
||||||
calculateMinimapScale,
|
calculateMinimapScale,
|
||||||
calculateNodeBounds
|
calculateNodeBounds
|
||||||
} from '@/renderer/core/spatial/boundsCalculator'
|
} from '@/renderer/core/spatial/boundsCalculator'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
import { renderMinimapToCanvas } from '../extensions/minimap/minimapCanvasRenderer'
|
import { renderMinimapToCanvas } from '../extensions/minimap/minimapCanvasRenderer'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
import { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { createGraphThumbnail } from '@/renderer/thumbnail/graphThumbnailRenderer'
|
import { createGraphThumbnail } from '@/renderer/thumbnail/graphThumbnailRenderer'
|
||||||
import { ComfyWorkflow } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
// Store thumbnails for each workflow
|
// Store thumbnails for each workflow
|
||||||
const workflowThumbnails = ref<Map<string, string>>(new Map())
|
const workflowThumbnails = ref<Map<string, string>>(new Map())
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
|
|
||||||
import { LinkMarkerShape } from '@/lib/litegraph/src/litegraph'
|
import { LinkMarkerShape } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import {
|
||||||
|
zComfyWorkflow,
|
||||||
|
zNodeId
|
||||||
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { colorPalettesSchema } from '@/schemas/colorPaletteSchema'
|
import { colorPalettesSchema } from '@/schemas/colorPaletteSchema'
|
||||||
import { zComfyWorkflow, zNodeId } from '@/schemas/comfyWorkflowSchema'
|
|
||||||
import { zKeybinding } from '@/schemas/keyBindingSchema'
|
import { zKeybinding } from '@/schemas/keyBindingSchema'
|
||||||
import { NodeBadgeMode } from '@/types/nodeSource'
|
import { NodeBadgeMode } from '@/types/nodeSource'
|
||||||
import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes'
|
import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes'
|
||||||
|
|||||||
@@ -2,6 +2,12 @@ import axios from 'axios'
|
|||||||
import { get } from 'es-toolkit/compat'
|
import { get } from 'es-toolkit/compat'
|
||||||
|
|
||||||
import defaultClientFeatureFlags from '@/config/clientFeatureFlags.json' with { type: 'json' }
|
import defaultClientFeatureFlags from '@/config/clientFeatureFlags.json' with { type: 'json' }
|
||||||
|
import { WorkflowTemplates } from '@/platform/workflow/templates/types/template'
|
||||||
|
import type {
|
||||||
|
ComfyApiWorkflow,
|
||||||
|
ComfyWorkflowJSON,
|
||||||
|
NodeId
|
||||||
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type {
|
import type {
|
||||||
DisplayComponentWsMessage,
|
DisplayComponentWsMessage,
|
||||||
EmbeddingsResponse,
|
EmbeddingsResponse,
|
||||||
@@ -31,15 +37,9 @@ import type {
|
|||||||
UserDataFullInfo
|
UserDataFullInfo
|
||||||
} from '@/schemas/apiSchema'
|
} from '@/schemas/apiSchema'
|
||||||
import type { ModelFile, ModelFolderInfo } from '@/schemas/assetSchema'
|
import type { ModelFile, ModelFolderInfo } from '@/schemas/assetSchema'
|
||||||
import type {
|
|
||||||
ComfyApiWorkflow,
|
|
||||||
ComfyWorkflowJSON,
|
|
||||||
NodeId
|
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
|
||||||
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import type { NodeExecutionId } from '@/types/nodeIdentification'
|
import type { NodeExecutionId } from '@/types/nodeIdentification'
|
||||||
import { WorkflowTemplates } from '@/types/workflowTemplateTypes'
|
|
||||||
|
|
||||||
interface QueuePromptRequestBody {
|
interface QueuePromptRequestBody {
|
||||||
client_id: string
|
client_id: string
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import type { ToastMessageOptions } from 'primevue/toast'
|
|||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
|
|
||||||
import { useCanvasPositionConversion } from '@/composables/element/useCanvasPositionConversion'
|
import { useCanvasPositionConversion } from '@/composables/element/useCanvasPositionConversion'
|
||||||
import { useWorkflowValidation } from '@/composables/useWorkflowValidation'
|
|
||||||
import { st, t } from '@/i18n'
|
import { st, t } from '@/i18n'
|
||||||
import {
|
import {
|
||||||
LGraph,
|
LGraph,
|
||||||
@@ -14,18 +13,21 @@ import {
|
|||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
import type { Vector2 } from '@/lib/litegraph/src/litegraph'
|
import type { Vector2 } from '@/lib/litegraph/src/litegraph'
|
||||||
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
|
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
|
||||||
import type {
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
ExecutionErrorWsMessage,
|
import { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
NodeError,
|
import { useWorkflowValidation } from '@/platform/workflow/validation/composables/useWorkflowValidation'
|
||||||
ResultItem
|
|
||||||
} from '@/schemas/apiSchema'
|
|
||||||
import {
|
import {
|
||||||
ComfyApiWorkflow,
|
ComfyApiWorkflow,
|
||||||
type ComfyWorkflowJSON,
|
type ComfyWorkflowJSON,
|
||||||
type ModelFile,
|
type ModelFile,
|
||||||
type NodeId,
|
type NodeId,
|
||||||
isSubgraphDefinition
|
isSubgraphDefinition
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
import type {
|
||||||
|
ExecutionErrorWsMessage,
|
||||||
|
NodeError,
|
||||||
|
ResultItem
|
||||||
|
} from '@/schemas/apiSchema'
|
||||||
import {
|
import {
|
||||||
type ComfyNodeDef as ComfyNodeDefV1,
|
type ComfyNodeDef as ComfyNodeDefV1,
|
||||||
isComboInputSpecV1,
|
isComboInputSpecV1,
|
||||||
@@ -41,7 +43,6 @@ import { useDialogService } from '@/services/dialogService'
|
|||||||
import { useExtensionService } from '@/services/extensionService'
|
import { useExtensionService } from '@/services/extensionService'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
import { useSubgraphService } from '@/services/subgraphService'
|
import { useSubgraphService } from '@/services/subgraphService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
|
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useDomWidgetStore } from '@/stores/domWidgetStore'
|
import { useDomWidgetStore } from '@/stores/domWidgetStore'
|
||||||
@@ -56,7 +57,6 @@ import { useSettingStore } from '@/stores/settingStore'
|
|||||||
import { useSubgraphStore } from '@/stores/subgraphStore'
|
import { useSubgraphStore } from '@/stores/subgraphStore'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
import { useWidgetStore } from '@/stores/widgetStore'
|
import { useWidgetStore } from '@/stores/widgetStore'
|
||||||
import { ComfyWorkflow } from '@/stores/workflowStore'
|
|
||||||
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
||||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||||
import type { ComfyExtension, MissingNodeType } from '@/types/comfy'
|
import type { ComfyExtension, MissingNodeType } from '@/types/comfy'
|
||||||
|
|||||||
@@ -3,11 +3,14 @@ import * as jsondiffpatch from 'jsondiffpatch'
|
|||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
|
|
||||||
import { LGraphCanvas, LiteGraph } from '@/lib/litegraph/src/litegraph'
|
import { LGraphCanvas, LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import {
|
||||||
|
ComfyWorkflow,
|
||||||
|
useWorkflowStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { ExecutedWsMessage } from '@/schemas/apiSchema'
|
import type { ExecutedWsMessage } from '@/schemas/apiSchema'
|
||||||
import type { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
||||||
import { ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
import { api } from './api'
|
import { api } from './api'
|
||||||
import type { ComfyApp } from './app'
|
import type { ComfyApp } from './app'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
|
||||||
export const defaultGraph: ComfyWorkflowJSON = {
|
export const defaultGraph: ComfyWorkflowJSON = {
|
||||||
last_node_id: 9,
|
last_node_id: 9,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
type ComfyApiWorkflow,
|
type ComfyApiWorkflow,
|
||||||
type ComfyWorkflowJSON
|
type ComfyWorkflowJSON
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import {
|
import {
|
||||||
ComfyMetadata,
|
ComfyMetadata,
|
||||||
ComfyMetadataTags,
|
ComfyMetadataTags,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
ComfyApiWorkflow,
|
ComfyApiWorkflow,
|
||||||
ComfyWorkflowJSON
|
ComfyWorkflowJSON
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import {
|
import {
|
||||||
ASCII,
|
ASCII,
|
||||||
ComfyMetadata,
|
ComfyMetadata,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
ComfyApiWorkflow,
|
ComfyApiWorkflow,
|
||||||
ComfyWorkflowJSON
|
ComfyWorkflowJSON
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import {
|
import {
|
||||||
ASCII,
|
ASCII,
|
||||||
ComfyMetadata,
|
ComfyMetadata,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WORKFLOW_ACCEPT_STRING } from '@/constants/supportedWorkflowFormats'
|
import { WORKFLOW_ACCEPT_STRING } from '@/platform/workflow/core/types/formats'
|
||||||
import { type StatusWsMessageStatus, TaskItem } from '@/schemas/apiSchema'
|
import { type StatusWsMessageStatus, TaskItem } from '@/schemas/apiSchema'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useLitegraphService } from '@/services/litegraphService'
|
import { useLitegraphService } from '@/services/litegraphService'
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ import type {
|
|||||||
ISerialisableNodeOutput,
|
ISerialisableNodeOutput,
|
||||||
ISerialisedNode
|
ISerialisedNode
|
||||||
} from '@/lib/litegraph/src/types/serialisation'
|
} from '@/lib/litegraph/src/types/serialisation'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
|
||||||
import { transformInputSpecV2ToV1 } from '@/schemas/nodeDef/migration'
|
import { transformInputSpecV2ToV1 } from '@/schemas/nodeDef/migration'
|
||||||
import type {
|
import type {
|
||||||
ComfyNodeDef as ComfyNodeDefV2,
|
ComfyNodeDef as ComfyNodeDefV2,
|
||||||
@@ -44,7 +45,6 @@ import { useSettingStore } from '@/stores/settingStore'
|
|||||||
import { useSubgraphStore } from '@/stores/subgraphStore'
|
import { useSubgraphStore } from '@/stores/subgraphStore'
|
||||||
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,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useLoad3dViewer } from '@/composables/useLoad3dViewer'
|
|||||||
import Load3d from '@/extensions/core/load3d/Load3d'
|
import Load3d from '@/extensions/core/load3d/Load3d'
|
||||||
import Load3dAnimation from '@/extensions/core/load3d/Load3dAnimation'
|
import Load3dAnimation from '@/extensions/core/load3d/Load3dAnimation'
|
||||||
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import { NodeId } from '@/schemas/comfyWorkflowSchema'
|
import { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { CustomInputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
import type { CustomInputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||||
|
|
||||||
type Load3dReadyCallback = (load3d: Load3d | Load3dAnimation) => void
|
type Load3dReadyCallback = (load3d: Load3d | Load3dAnimation) => void
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
type ExportedSubgraphInstance,
|
type ExportedSubgraphInstance,
|
||||||
type Subgraph
|
type Subgraph
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
import type { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { ComfyNodeDef as ComfyNodeDefV1 } from '@/schemas/nodeDefSchema'
|
import type { ComfyNodeDef as ComfyNodeDefV1 } from '@/schemas/nodeDefSchema'
|
||||||
import { app as comfyApp } from '@/scripts/app'
|
import { app as comfyApp } from '@/scripts/app'
|
||||||
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
||||||
|
|||||||
@@ -5,6 +5,15 @@ import type ChatHistoryWidget from '@/components/graph/widgets/ChatHistoryWidget
|
|||||||
import { useNodeChatHistory } from '@/composables/node/useNodeChatHistory'
|
import { useNodeChatHistory } from '@/composables/node/useNodeChatHistory'
|
||||||
import { useNodeProgressText } from '@/composables/node/useNodeProgressText'
|
import { useNodeProgressText } from '@/composables/node/useNodeProgressText'
|
||||||
import type { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph'
|
import type { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import {
|
||||||
|
ComfyWorkflow,
|
||||||
|
useWorkflowStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import type {
|
||||||
|
ComfyNode,
|
||||||
|
ComfyWorkflowJSON,
|
||||||
|
NodeId
|
||||||
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import type {
|
import type {
|
||||||
DisplayComponentWsMessage,
|
DisplayComponentWsMessage,
|
||||||
@@ -18,19 +27,12 @@ import type {
|
|||||||
ProgressTextWsMessage,
|
ProgressTextWsMessage,
|
||||||
ProgressWsMessage
|
ProgressWsMessage
|
||||||
} from '@/schemas/apiSchema'
|
} from '@/schemas/apiSchema'
|
||||||
import type {
|
|
||||||
ComfyNode,
|
|
||||||
ComfyWorkflowJSON,
|
|
||||||
NodeId
|
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
||||||
import type { NodeLocatorId } from '@/types/nodeIdentification'
|
import type { NodeLocatorId } from '@/types/nodeIdentification'
|
||||||
import { createNodeLocatorId } from '@/types/nodeIdentification'
|
import { createNodeLocatorId } from '@/types/nodeIdentification'
|
||||||
|
|
||||||
import { ComfyWorkflow, useWorkflowStore } from './workflowStore'
|
|
||||||
|
|
||||||
interface QueuedPrompt {
|
interface QueuedPrompt {
|
||||||
/**
|
/**
|
||||||
* The nodes that are queued to be executed. The key is the node id and the
|
* The nodes that are queued to be executed. The key is the node id and the
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
Subgraph,
|
Subgraph,
|
||||||
SubgraphNode
|
SubgraphNode
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import {
|
import {
|
||||||
ExecutedWsMessage,
|
ExecutedWsMessage,
|
||||||
ResultItem,
|
ResultItem,
|
||||||
@@ -14,7 +15,6 @@ import {
|
|||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import type { NodeLocatorId } from '@/types/nodeIdentification'
|
import type { NodeLocatorId } from '@/types/nodeIdentification'
|
||||||
import { parseFilePath } from '@/utils/formatUtil'
|
import { parseFilePath } from '@/utils/formatUtil'
|
||||||
import { isVideoNode } from '@/utils/litegraphUtil'
|
import { isVideoNode } from '@/utils/litegraphUtil'
|
||||||
|
|||||||
@@ -292,9 +292,9 @@ export const useNodeDefStore = defineStore('nodeDef', () => {
|
|||||||
const showDeprecated = ref(false)
|
const showDeprecated = ref(false)
|
||||||
const showExperimental = ref(false)
|
const showExperimental = ref(false)
|
||||||
const nodeDefFilters = ref<NodeDefFilter[]>([])
|
const nodeDefFilters = ref<NodeDefFilter[]>([])
|
||||||
const subgraphStore = useSubgraphStore()
|
|
||||||
|
|
||||||
const nodeDefs = computed(() => {
|
const nodeDefs = computed(() => {
|
||||||
|
const subgraphStore = useSubgraphStore()
|
||||||
return [
|
return [
|
||||||
...Object.values(nodeDefsByName.value),
|
...Object.values(nodeDefsByName.value),
|
||||||
...subgraphStore.subgraphBlueprints
|
...subgraphStore.subgraphBlueprints
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ import _ from 'es-toolkit/compat'
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { computed, ref, toRaw } from 'vue'
|
import { computed, ref, toRaw } from 'vue'
|
||||||
|
|
||||||
|
import type {
|
||||||
|
ComfyWorkflowJSON,
|
||||||
|
NodeId
|
||||||
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type {
|
import type {
|
||||||
ResultItem,
|
ResultItem,
|
||||||
StatusWsMessageStatus,
|
StatusWsMessageStatus,
|
||||||
@@ -11,7 +15,6 @@ import type {
|
|||||||
TaskStatus,
|
TaskStatus,
|
||||||
TaskType
|
TaskType
|
||||||
} from '@/schemas/apiSchema'
|
} from '@/schemas/apiSchema'
|
||||||
import type { ComfyWorkflowJSON, NodeId } from '@/schemas/comfyWorkflowSchema'
|
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import type { ComfyApp } from '@/scripts/app'
|
import type { ComfyApp } from '@/scripts/app'
|
||||||
import { useExtensionService } from '@/services/extensionService'
|
import { useExtensionService } from '@/services/extensionService'
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ import { computed, ref, shallowRef, watch } from 'vue'
|
|||||||
|
|
||||||
import type { DragAndScaleState } from '@/lib/litegraph/src/DragAndScale'
|
import type { DragAndScaleState } from '@/lib/litegraph/src/DragAndScale'
|
||||||
import type { Subgraph } from '@/lib/litegraph/src/litegraph'
|
import type { Subgraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { findSubgraphPathById } from '@/utils/graphTraversalUtil'
|
import { findSubgraphPathById } from '@/utils/graphTraversalUtil'
|
||||||
import { isNonNullish } from '@/utils/typeGuardUtil'
|
import { isNonNullish } from '@/utils/typeGuardUtil'
|
||||||
|
|
||||||
import { useWorkflowStore } from './workflowStore'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the current subgraph navigation state; a stack representing subgraph
|
* Stores the current subgraph navigation state; a stack representing subgraph
|
||||||
* navigation history from the root graph to the subgraph that is currently
|
* navigation history from the root graph to the subgraph that is currently
|
||||||
|
|||||||
@@ -3,30 +3,30 @@ import { computed, ref } from 'vue'
|
|||||||
|
|
||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
import { SubgraphNode } from '@/lib/litegraph/src/litegraph'
|
import { SubgraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
import type { NodeError } from '@/schemas/apiSchema'
|
import {
|
||||||
|
ComfyWorkflow,
|
||||||
|
LoadedComfyWorkflow,
|
||||||
|
useWorkflowStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import type {
|
import type {
|
||||||
ComfyNode,
|
ComfyNode,
|
||||||
ComfyWorkflowJSON,
|
ComfyWorkflowJSON,
|
||||||
NodeId
|
NodeId
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
|
import type { NodeError } from '@/schemas/apiSchema'
|
||||||
import type {
|
import type {
|
||||||
ComfyNodeDef as ComfyNodeDefV1,
|
ComfyNodeDef as ComfyNodeDefV1,
|
||||||
InputSpec
|
InputSpec
|
||||||
} from '@/schemas/nodeDefSchema'
|
} from '@/schemas/nodeDefSchema'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
|
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 { UserFile } from '@/stores/userFileStore'
|
import { UserFile } from '@/stores/userFileStore'
|
||||||
import {
|
|
||||||
ComfyWorkflow,
|
|
||||||
LoadedComfyWorkflow,
|
|
||||||
useWorkflowStore
|
|
||||||
} from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
async function confirmOverwrite(name: string): Promise<boolean | null> {
|
async function confirmOverwrite(name: string): Promise<boolean | null> {
|
||||||
return await useDialogService().confirm({
|
return await useDialogService().confirm({
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { computed, ref } from 'vue'
|
|||||||
import { useModelLibrarySidebarTab } from '@/composables/sidebarTabs/useModelLibrarySidebarTab'
|
import { useModelLibrarySidebarTab } from '@/composables/sidebarTabs/useModelLibrarySidebarTab'
|
||||||
import { useNodeLibrarySidebarTab } from '@/composables/sidebarTabs/useNodeLibrarySidebarTab'
|
import { useNodeLibrarySidebarTab } from '@/composables/sidebarTabs/useNodeLibrarySidebarTab'
|
||||||
import { useQueueSidebarTab } from '@/composables/sidebarTabs/useQueueSidebarTab'
|
import { useQueueSidebarTab } from '@/composables/sidebarTabs/useQueueSidebarTab'
|
||||||
import { useWorkflowsSidebarTab } from '@/composables/sidebarTabs/useWorkflowsSidebarTab'
|
|
||||||
import { t, te } from '@/i18n'
|
import { t, te } from '@/i18n'
|
||||||
|
import { useWorkflowsSidebarTab } from '@/platform/workflow/management/composables/useWorkflowsSidebarTab'
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useMenuItemStore } from '@/stores/menuItemStore'
|
import { useMenuItemStore } from '@/stores/menuItemStore'
|
||||||
import { SidebarTabExtension } from '@/types/extensionTypes'
|
import { SidebarTabExtension } from '@/types/extensionTypes'
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import type { Settings } from '@/schemas/apiSchema'
|
import type { Settings } from '@/schemas/apiSchema'
|
||||||
import { useColorPaletteService } from '@/services/colorPaletteService'
|
import { useColorPaletteService } from '@/services/colorPaletteService'
|
||||||
import { useDialogService } from '@/services/dialogService'
|
import { useDialogService } from '@/services/dialogService'
|
||||||
@@ -12,7 +13,6 @@ import { useFirebaseAuthStore } from './firebaseAuthStore'
|
|||||||
import { useQueueSettingsStore } from './queueStore'
|
import { useQueueSettingsStore } from './queueStore'
|
||||||
import { useSettingStore } from './settingStore'
|
import { useSettingStore } from './settingStore'
|
||||||
import { useToastStore } from './toastStore'
|
import { useToastStore } from './toastStore'
|
||||||
import { useWorkflowStore } from './workflowStore'
|
|
||||||
import { useBottomPanelStore } from './workspace/bottomPanelStore'
|
import { useBottomPanelStore } from './workspace/bottomPanelStore'
|
||||||
import { useSidebarTabStore } from './workspace/sidebarTabStore'
|
import { useSidebarTabStore } from './workspace/sidebarTabStore'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Positionable } from '@/lib/litegraph/src/interfaces'
|
import { Positionable } from '@/lib/litegraph/src/interfaces'
|
||||||
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import type { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
|
import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { Keybinding } from '@/schemas/keyBindingSchema'
|
import type { Keybinding } from '@/schemas/keyBindingSchema'
|
||||||
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
||||||
import type { ComfyApp } from '@/scripts/app'
|
import type { ComfyApp } from '@/scripts/app'
|
||||||
|
|||||||
3
src/types/litegraph-augmentation.d.ts
vendored
3
src/types/litegraph-augmentation.d.ts
vendored
@@ -5,12 +5,11 @@ import type {
|
|||||||
ExecutionId
|
ExecutionId
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
|
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
|
||||||
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { ComfyNodeDef as ComfyNodeDefV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
import type { ComfyNodeDef as ComfyNodeDefV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||||
import type { ComfyNodeDef as ComfyNodeDefV1 } from '@/schemas/nodeDefSchema'
|
import type { ComfyNodeDef as ComfyNodeDefV1 } from '@/schemas/nodeDefSchema'
|
||||||
import type { DOMWidget, DOMWidgetOptions } from '@/scripts/domWidget'
|
import type { DOMWidget, DOMWidgetOptions } from '@/scripts/domWidget'
|
||||||
|
|
||||||
import type { NodeId } from '../schemas/comfyWorkflowSchema'
|
|
||||||
|
|
||||||
/** ComfyUI extensions of litegraph */
|
/** ComfyUI extensions of litegraph */
|
||||||
declare module '@/lib/litegraph/src/types/widgets' {
|
declare module '@/lib/litegraph/src/types/widgets' {
|
||||||
interface IWidgetOptions {
|
interface IWidgetOptions {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type {
|
import type {
|
||||||
ComfyApiWorkflow,
|
ComfyApiWorkflow,
|
||||||
ComfyWorkflowJSON
|
ComfyWorkflowJSON
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag names used in ComfyUI metadata
|
* Tag names used in ComfyUI metadata
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A globally unique identifier for nodes that maintains consistency across
|
* A globally unique identifier for nodes that maintains consistency across
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { ISerialisedGraph } from '@/lib/litegraph/src/litegraph'
|
import type { ISerialisedGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import type { SystemStats } from '@/schemas/apiSchema'
|
import type { SystemStats } from '@/schemas/apiSchema'
|
||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
|
||||||
|
|
||||||
export interface ErrorReportData {
|
export interface ErrorReportData {
|
||||||
exceptionType: string
|
exceptionType: string
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
import type {
|
import type {
|
||||||
ComfyApiWorkflow,
|
ComfyApiWorkflow,
|
||||||
ComfyWorkflowJSON
|
ComfyWorkflowJSON
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
|
||||||
import { ExecutableGroupNodeDTO, isGroupNode } from './executableGroupNodeDto'
|
import { ExecutableGroupNodeDTO, isGroupNode } from './executableGroupNodeDto'
|
||||||
import { compressWidgetInputSlots } from './litegraphUtil'
|
import { compressWidgetInputSlots } from './litegraphUtil'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import type {
|
|||||||
NodeId,
|
NodeId,
|
||||||
Reroute,
|
Reroute,
|
||||||
WorkflowJSON04
|
WorkflowJSON04
|
||||||
} from '@/schemas/comfyWorkflowSchema'
|
} from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
|
||||||
type RerouteNode = ComfyNode & {
|
type RerouteNode = ComfyNode & {
|
||||||
type: 'Reroute'
|
type: 'Reroute'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ModelFile } from '@/schemas/comfyWorkflowSchema'
|
import type { ModelFile } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets models from the node's `properties.models` field, excluding those
|
* Gets models from the node's `properties.models` field, excluding those
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Basic setup for testing Pinia stores:
|
|||||||
import { createPinia, setActivePinia } from 'pinia'
|
import { createPinia, setActivePinia } from 'pinia'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
import { useWorkflowStore } from '@/domains/workflow/ui/stores/workflowStore'
|
||||||
|
|
||||||
describe('useWorkflowStore', () => {
|
describe('useWorkflowStore', () => {
|
||||||
let store: ReturnType<typeof useWorkflowStore>
|
let store: ReturnType<typeof useWorkflowStore>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { validateComfyWorkflow } from '@/schemas/comfyWorkflowSchema'
|
import { validateComfyWorkflow } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { defaultGraph } from '@/scripts/defaultGraph'
|
import { defaultGraph } from '@/scripts/defaultGraph'
|
||||||
|
|
||||||
const WORKFLOW_DIR = 'tests-ui/workflows'
|
const WORKFLOW_DIR = 'tests-ui/workflows'
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ vi.mock('@vueuse/core', async () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
vi.mock('@/services/workflowService', () => ({
|
vi.mock('@/platform/workflow/core/services/workflowService', () => ({
|
||||||
useWorkflowService: vi.fn(() => ({
|
useWorkflowService: vi.fn(() => ({
|
||||||
reloadCurrentWorkflow: vi.fn().mockResolvedValue(undefined)
|
reloadCurrentWorkflow: vi.fn().mockResolvedValue(undefined)
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ vi.mock('@/stores/settingStore', () => ({
|
|||||||
const workflowStore = reactive({
|
const workflowStore = reactive({
|
||||||
activeWorkflow: null as any
|
activeWorkflow: null as any
|
||||||
})
|
})
|
||||||
vi.mock('@/stores/workflowStore', () => ({
|
vi.mock('@/platform/workflow/management/stores/workflowStore', () => ({
|
||||||
useWorkflowStore: () => workflowStore
|
useWorkflowStore: () => workflowStore
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ vi.mock('firebase/auth', () => ({
|
|||||||
onAuthStateChanged: vi.fn()
|
onAuthStateChanged: vi.fn()
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock('@/services/workflowService', () => ({
|
vi.mock('@/platform/workflow/core/services/workflowService', () => ({
|
||||||
useWorkflowService: vi.fn(() => ({}))
|
useWorkflowService: vi.fn(() => ({}))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ vi.mock('@/stores/toastStore', () => ({
|
|||||||
useToastStore: vi.fn(() => ({}))
|
useToastStore: vi.fn(() => ({}))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock('@/stores/workflowStore', () => ({
|
vi.mock('@/platform/workflow/management/stores/workflowStore', () => ({
|
||||||
useWorkflowStore: vi.fn(() => ({}))
|
useWorkflowStore: vi.fn(() => ({}))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ vi.mock('@/scripts/app', () => ({
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock('@/stores/workflowStore', () => ({
|
vi.mock('@/platform/workflow/management/stores/workflowStore', () => ({
|
||||||
useWorkflowStore: vi.fn(() => ({
|
useWorkflowStore: vi.fn(() => ({
|
||||||
activeSubgraph: null
|
activeSubgraph: null
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import { flushPromises } from '@vue/test-utils'
|
import { flushPromises } from '@vue/test-utils'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { useTemplateWorkflows } from '@/composables/useTemplateWorkflows'
|
import { useTemplateWorkflows } from '@/platform/workflow/templates/composables/useTemplateWorkflows'
|
||||||
import { useWorkflowTemplatesStore } from '@/stores/workflowTemplatesStore'
|
import { useWorkflowTemplatesStore } from '@/platform/workflow/templates/repositories/workflowTemplatesStore'
|
||||||
|
|
||||||
// Mock the store
|
// Mock the store
|
||||||
vi.mock('@/stores/workflowTemplatesStore', () => ({
|
vi.mock(
|
||||||
useWorkflowTemplatesStore: vi.fn()
|
'@/platform/workflow/templates/repositories/workflowTemplatesStore',
|
||||||
}))
|
() => ({
|
||||||
|
useWorkflowTemplatesStore: vi.fn()
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
// Mock the API
|
// Mock the API
|
||||||
vi.mock('@/scripts/api', () => ({
|
vi.mock('@/scripts/api', () => ({
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { useWorkflowAutoSave } from '@/composables/useWorkflowAutoSave'
|
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
|
||||||
|
import { useWorkflowAutoSave } from '@/platform/workflow/persistence/composables/useWorkflowAutoSave'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { useWorkflowService } from '@/services/workflowService'
|
|
||||||
|
|
||||||
vi.mock('@/scripts/api', () => ({
|
vi.mock('@/scripts/api', () => ({
|
||||||
api: {
|
api: {
|
||||||
@@ -12,7 +12,7 @@ vi.mock('@/scripts/api', () => ({
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock('@/services/workflowService', () => ({
|
vi.mock('@/platform/workflow/core/services/workflowService', () => ({
|
||||||
useWorkflowService: vi.fn(() => ({
|
useWorkflowService: vi.fn(() => ({
|
||||||
saveWorkflow: vi.fn()
|
saveWorkflow: vi.fn()
|
||||||
}))
|
}))
|
||||||
@@ -28,7 +28,7 @@ vi.mock('@/stores/settingStore', () => ({
|
|||||||
}))
|
}))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
vi.mock('@/stores/workflowStore', () => ({
|
vi.mock('@/platform/workflow/management/stores/workflowStore', () => ({
|
||||||
useWorkflowStore: vi.fn(() => ({
|
useWorkflowStore: vi.fn(() => ({
|
||||||
activeWorkflow: mockActiveWorkflow
|
activeWorkflow: mockActiveWorkflow
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import { createPinia, setActivePinia } from 'pinia'
|
import { createPinia, setActivePinia } from 'pinia'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'
|
import {
|
||||||
|
ComfyWorkflow,
|
||||||
|
useWorkflowStore
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
|
||||||
vi.mock('@/renderer/thumbnail/graphThumbnailRenderer', () => ({
|
vi.mock('@/renderer/thumbnail/graphThumbnailRenderer', () => ({
|
||||||
createGraphThumbnail: vi.fn()
|
createGraphThumbnail: vi.fn()
|
||||||
@@ -19,7 +22,7 @@ vi.mock('@/scripts/api', () => ({
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
const { useWorkflowThumbnail } = await import(
|
const { useWorkflowThumbnail } = await import(
|
||||||
'@/renderer/thumbnail/composables/useWorkflowThumbnail'
|
'@/renderer/thumbnail/useWorkflowThumbnail'
|
||||||
)
|
)
|
||||||
const { createGraphThumbnail } = await import(
|
const { createGraphThumbnail } = await import(
|
||||||
'@/renderer/thumbnail/graphThumbnailRenderer'
|
'@/renderer/thumbnail/graphThumbnailRenderer'
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { createPinia, setActivePinia } from 'pinia'
|
import { createPinia, setActivePinia } from 'pinia'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useExecutionStore } from '@/stores/executionStore'
|
import { useExecutionStore } from '@/stores/executionStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
// Mock the workflowStore
|
// Mock the workflowStore
|
||||||
vi.mock('@/stores/workflowStore', () => ({
|
vi.mock('@/platform/workflow/management/stores/workflowStore', () => ({
|
||||||
useWorkflowStore: vi.fn(() => ({
|
useWorkflowStore: vi.fn(() => ({
|
||||||
nodeExecutionIdToNodeLocatorId: vi.fn(),
|
nodeExecutionIdToNodeLocatorId: vi.fn(),
|
||||||
nodeIdToNodeLocatorId: vi.fn(),
|
nodeIdToNodeLocatorId: vi.fn(),
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { createPinia, setActivePinia } from 'pinia'
|
|||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import type { ComfyWorkflow } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
vi.mock('@/scripts/app', () => {
|
vi.mock('@/scripts/app', () => {
|
||||||
const mockCanvas = {
|
const mockCanvas = {
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { createPinia, setActivePinia } from 'pinia'
|
|||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
|
||||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
|
||||||
import type { ComfyWorkflow } from '@/stores/workflowStore'
|
|
||||||
|
|
||||||
vi.mock('@/scripts/app', () => {
|
vi.mock('@/scripts/app', () => {
|
||||||
const mockCanvas = {
|
const mockCanvas = {
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
import type { Subgraph } from '@/lib/litegraph/src/litegraph'
|
import type { Subgraph } from '@/lib/litegraph/src/litegraph'
|
||||||
import { api } from '@/scripts/api'
|
|
||||||
import { app as comfyApp } from '@/scripts/app'
|
|
||||||
import { defaultGraph, defaultGraphJSON } from '@/scripts/defaultGraph'
|
|
||||||
import {
|
import {
|
||||||
ComfyWorkflow,
|
ComfyWorkflow,
|
||||||
LoadedComfyWorkflow,
|
LoadedComfyWorkflow,
|
||||||
useWorkflowBookmarkStore,
|
useWorkflowBookmarkStore,
|
||||||
useWorkflowStore
|
useWorkflowStore
|
||||||
} from '@/stores/workflowStore'
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import { api } from '@/scripts/api'
|
||||||
|
import { app as comfyApp } from '@/scripts/app'
|
||||||
|
import { defaultGraph, defaultGraphJSON } from '@/scripts/defaultGraph'
|
||||||
import { isSubgraph } from '@/utils/typeGuardUtil'
|
import { isSubgraph } from '@/utils/typeGuardUtil'
|
||||||
|
|
||||||
// Add mock for api at the top of the file
|
// Add mock for api at the top of the file
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
|
import type { NodeId } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import {
|
import {
|
||||||
type NodeLocatorId,
|
type NodeLocatorId,
|
||||||
createNodeExecutionId,
|
createNodeExecutionId,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import fs from 'node:fs'
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import type { WorkflowJSON04 } from '@/schemas/comfyWorkflowSchema'
|
import type { WorkflowJSON04 } from '@/platform/workflow/validation/schemas/workflowSchema'
|
||||||
import { migrateLegacyRerouteNodes } from '@/utils/migration/migrateReroute'
|
import { migrateLegacyRerouteNodes } from '@/utils/migration/migrateReroute'
|
||||||
|
|
||||||
describe('migrateReroute', () => {
|
describe('migrateReroute', () => {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user