mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Only show reroute migration dialog when native reroute is not present (#3318)
This commit is contained in:
@@ -48,7 +48,10 @@ import { ExtensionManager } from '@/types/extensionTypes'
|
|||||||
import { ColorAdjustOptions, adjustColor } from '@/utils/colorUtil'
|
import { ColorAdjustOptions, adjustColor } from '@/utils/colorUtil'
|
||||||
import { graphToPrompt } from '@/utils/executionUtil'
|
import { graphToPrompt } from '@/utils/executionUtil'
|
||||||
import { executeWidgetsCallback, isImageNode } from '@/utils/litegraphUtil'
|
import { executeWidgetsCallback, isImageNode } from '@/utils/litegraphUtil'
|
||||||
import { findLegacyRerouteNodes } from '@/utils/migration/migrateReroute'
|
import {
|
||||||
|
findLegacyRerouteNodes,
|
||||||
|
noNativeReroutes
|
||||||
|
} from '@/utils/migration/migrateReroute'
|
||||||
import { deserialiseAndCreate } from '@/utils/vintageClipboard'
|
import { deserialiseAndCreate } from '@/utils/vintageClipboard'
|
||||||
|
|
||||||
import { type ComfyApi, PromptExecutionError, api } from './api'
|
import { type ComfyApi, PromptExecutionError, api } from './api'
|
||||||
@@ -986,11 +989,15 @@ export class ComfyApp {
|
|||||||
// Ideally we should not block users from loading the workflow.
|
// Ideally we should not block users from loading the workflow.
|
||||||
graphData = validatedGraphData ?? graphData
|
graphData = validatedGraphData ?? graphData
|
||||||
}
|
}
|
||||||
|
// Only show the reroute migration warning if the workflow does not have native
|
||||||
|
// reroutes. Merging reroute network has great complexity, and it is not supported
|
||||||
|
// for now.
|
||||||
|
// See: https://github.com/Comfy-Org/ComfyUI_frontend/issues/3317
|
||||||
if (
|
if (
|
||||||
checkForRerouteMigration &&
|
checkForRerouteMigration &&
|
||||||
graphData.version === 0.4 &&
|
graphData.version === 0.4 &&
|
||||||
findLegacyRerouteNodes(graphData).length
|
findLegacyRerouteNodes(graphData).length &&
|
||||||
|
noNativeReroutes(graphData)
|
||||||
) {
|
) {
|
||||||
useToastStore().add({
|
useToastStore().add({
|
||||||
group: 'reroute-migration',
|
group: 'reroute-migration',
|
||||||
|
|||||||
@@ -28,6 +28,15 @@ export function findLegacyRerouteNodes(
|
|||||||
) as RerouteNode[]
|
) as RerouteNode[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the workflow has no native reroutes
|
||||||
|
*/
|
||||||
|
export function noNativeReroutes(workflow: WorkflowJSON04): boolean {
|
||||||
|
return (
|
||||||
|
!workflow.extra?.reroutes?.length && !workflow.extra?.linkExtensions?.length
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the center position of a node
|
* Gets the center position of a node
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user