mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-31 13:29:55 +00:00
Add reroute migration toast (#3286)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -47,7 +47,7 @@ import { ExtensionManager } from '@/types/extensionTypes'
|
||||
import { ColorAdjustOptions, adjustColor } from '@/utils/colorUtil'
|
||||
import { graphToPrompt } from '@/utils/executionUtil'
|
||||
import { executeWidgetsCallback, isImageNode } from '@/utils/litegraphUtil'
|
||||
import { migrateLegacyRerouteNodes } from '@/utils/migration/migrateReroute'
|
||||
import { findLegacyRerouteNodes } from '@/utils/migration/migrateReroute'
|
||||
import { deserialiseAndCreate } from '@/utils/vintageClipboard'
|
||||
|
||||
import { type ComfyApi, PromptExecutionError, api } from './api'
|
||||
@@ -945,7 +945,11 @@ export class ComfyApp {
|
||||
clean: boolean = true,
|
||||
restore_view: boolean = true,
|
||||
workflow: string | null | ComfyWorkflow = null,
|
||||
{ showMissingNodesDialog = true, showMissingModelsDialog = true } = {}
|
||||
{
|
||||
showMissingNodesDialog = true,
|
||||
showMissingModelsDialog = true,
|
||||
checkForRerouteMigration = true
|
||||
} = {}
|
||||
) {
|
||||
if (clean !== false) {
|
||||
this.clean()
|
||||
@@ -972,11 +976,16 @@ export class ComfyApp {
|
||||
graphData = validatedGraphData ?? graphData
|
||||
}
|
||||
|
||||
// Migrate legacy reroute nodes to the new format
|
||||
if (graphData.version === 0.4) {
|
||||
graphData = migrateLegacyRerouteNodes(graphData)
|
||||
if (
|
||||
checkForRerouteMigration &&
|
||||
graphData.version === 0.4 &&
|
||||
findLegacyRerouteNodes(graphData).length
|
||||
) {
|
||||
useToastStore().add({
|
||||
group: 'reroute-migration',
|
||||
severity: 'warn'
|
||||
})
|
||||
}
|
||||
|
||||
useWorkflowService().beforeLoadNewGraph()
|
||||
|
||||
const missingNodeTypes: MissingNodeType[] = []
|
||||
|
||||
@@ -135,7 +135,8 @@ export class ChangeTracker {
|
||||
try {
|
||||
await this.app.loadGraphData(prevState, false, false, this.workflow, {
|
||||
showMissingModelsDialog: false,
|
||||
showMissingNodesDialog: false
|
||||
showMissingNodesDialog: false,
|
||||
checkForRerouteMigration: false
|
||||
})
|
||||
this.activeState = prevState
|
||||
this.updateModified()
|
||||
|
||||
Reference in New Issue
Block a user