Merge branch 'main' into feat/new-workflow-templates

This commit is contained in:
Johnpaul
2025-09-09 02:25:06 +01:00
212 changed files with 4996 additions and 2950 deletions

View File

@@ -53,6 +53,7 @@ import { KeyComboImpl, useKeybindingStore } from '@/stores/keybindingStore'
import { useModelStore } from '@/stores/modelStore'
import { SYSTEM_NODE_DEFS, useNodeDefStore } from '@/stores/nodeDefStore'
import { useSettingStore } from '@/stores/settingStore'
import { useSubgraphStore } from '@/stores/subgraphStore'
import { useToastStore } from '@/stores/toastStore'
import { useWidgetStore } from '@/stores/widgetStore'
import { ComfyWorkflow } from '@/stores/workflowStore'
@@ -797,6 +798,7 @@ export class ComfyApp {
this.resizeCanvas()
await useWorkspaceStore().workflow.syncWorkflows()
await useSubgraphStore().fetchSubgraphs()
await useExtensionService().loadExtensions()
this.#addProcessKeyHandler()
@@ -905,7 +907,7 @@ export class ComfyApp {
LiteGraph.registered_node_types
)) {
// Skip if we already have a backend definition or system definition
if (name in defs || name in SYSTEM_NODE_DEFS) {
if (name in defs || name in SYSTEM_NODE_DEFS || node.skip_list) {
continue
}
@@ -1058,6 +1060,8 @@ export class ComfyApp {
checkForRerouteMigration = false
} = {}
) {
useWorkflowService().beforeLoadNewGraph()
if (clean !== false) {
this.clean()
}
@@ -1093,7 +1097,6 @@ export class ComfyApp {
severity: 'warn'
})
}
useWorkflowService().beforeLoadNewGraph()
useSubgraphService().loadSubgraphs(graphData)
const missingNodeTypes: MissingNodeType[] = []
@@ -1765,6 +1768,12 @@ export class ComfyApp {
executionStore.lastExecutionError = null
useDomWidgetStore().clear()
// Subgraph does not properly implement `clear` and the parent class's
// (`LGraph`) `clear` breaks the subgraph structure.
if (this.graph && !this.canvas.subgraph) {
this.graph.clear()
}
}
clientPosToCanvasPos(pos: Vector2): Vector2 {

View File

@@ -55,7 +55,7 @@ export interface DOMWidget<T extends HTMLElement, V extends object | string>
* - widget: Reference to the widget instance
* - onUpdate:modelValue: The update handler for v-model
*/
export type ComponentWidgetCustomProps = Record<string, unknown>
type ComponentWidgetCustomProps = Record<string, unknown>
/**
* Standard props that are handled separately by DomWidget.vue and should be

View File

@@ -319,7 +319,7 @@ function parseAvifMetadata(buffer: ArrayBuffer): ComfyMetadata {
}
// @ts-expect-error fixme ts strict error
export function parseExifData(exifData) {
function parseExifData(exifData) {
// Check for the correct TIFF header (0x4949 for little-endian or 0x4D4D for big-endian)
const isLittleEndian = String.fromCharCode(...exifData.slice(0, 2)) === 'II'

View File

@@ -1,3 +1,4 @@
/** @knipIgnoreUnusedButUsedByCustomNodes */
export function getFromFlacBuffer(buffer: ArrayBuffer): Record<string, string> {
const dataView = new DataView(buffer)

View File

@@ -1,3 +1,4 @@
/** @knipIgnoreUnusedButUsedByCustomNodes */
export function getFromPngBuffer(buffer: ArrayBuffer) {
// Get the PNG data as a Uint8Array
const pngData = new Uint8Array(buffer)

View File

@@ -634,7 +634,6 @@ export class ComfyUI {
confirm('Clear workflow?')
) {
app.clean()
app.graph.clear()
useLitegraphService().resetView()
api.dispatchCustomEvent('graphCleared')
}