Load workflows from webm files (#2772)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
bymyself
2025-02-28 14:00:02 -07:00
committed by GitHub
parent 96768bba97
commit 792c5f2246
8 changed files with 416 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import {
validateComfyWorkflow
} from '@/schemas/comfyWorkflowSchema'
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
import { getFromWebmFile } from '@/scripts/metadata/ebml'
import { useDialogService } from '@/services/dialogService'
import { useExtensionService } from '@/services/extensionService'
import { useLitegraphService } from '@/services/litegraphService'
@@ -1408,6 +1409,15 @@ export class ComfyApp {
} else {
this.showErrorOnFileLoad(file)
}
} else if (file.type === 'video/webm') {
const webmInfo = await getFromWebmFile(file)
if (webmInfo.workflow) {
this.loadGraphData(webmInfo.workflow, true, true, fileName)
} else if (webmInfo.prompt) {
this.loadApiJson(webmInfo.prompt, fileName)
} else {
this.showErrorOnFileLoad(file)
}
} else if (
file.type === 'application/json' ||
file.name?.endsWith('.json')