mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 09:30:06 +00:00
* knip: Don't ignore exports that are only used within a given file * knip: More pruning after rebase * knip: Vite plugin config fix * knip: vitest plugin config * knip: Playwright config, remove unnecessary ignores. * knip: Simplify project file enumeration. * knip: simplify the config file patterns ?(.optional_segment) * knip: tailwind v4 fix * knip: A little more, explain some of the deps. Should be good for this PR. * knip: remove unused disabling of classMembers. It's opt-in, which we should probably do. * knip: floating comments We should probably delete _one_ of these parallell trees, right? * knip: Add additional entrypoints * knip: Restore UserData that's exposed via the types for now. * knip: Add as an entry file even though knip says it's not necessary. * knip: re-export functions used by nodes (h/t @christian-byrne)
73 lines
1.8 KiB
TypeScript
73 lines
1.8 KiB
TypeScript
/**
|
|
* Supported workflow file formats organized by type category
|
|
*/
|
|
|
|
/**
|
|
* All supported image formats that can contain workflow data
|
|
*/
|
|
const IMAGE_WORKFLOW_FORMATS = {
|
|
extensions: ['.png', '.webp', '.svg', '.avif'],
|
|
mimeTypes: ['image/png', 'image/webp', 'image/svg+xml', 'image/avif']
|
|
}
|
|
|
|
/**
|
|
* All supported audio formats that can contain workflow data
|
|
*/
|
|
const AUDIO_WORKFLOW_FORMATS = {
|
|
extensions: ['.mp3', '.ogg', '.flac'],
|
|
mimeTypes: ['audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/x-flac']
|
|
}
|
|
|
|
/**
|
|
* All supported video formats that can contain workflow data
|
|
*/
|
|
const VIDEO_WORKFLOW_FORMATS = {
|
|
extensions: ['.mp4', '.mov', '.m4v', '.webm'],
|
|
mimeTypes: ['video/mp4', 'video/quicktime', 'video/x-m4v', 'video/webm']
|
|
}
|
|
|
|
/**
|
|
* All supported 3D model formats that can contain workflow data
|
|
*/
|
|
const MODEL_WORKFLOW_FORMATS = {
|
|
extensions: ['.glb'],
|
|
mimeTypes: ['model/gltf-binary']
|
|
}
|
|
|
|
/**
|
|
* All supported data formats that directly contain workflow data
|
|
*/
|
|
const DATA_WORKFLOW_FORMATS = {
|
|
extensions: ['.json', '.latent', '.safetensors'],
|
|
mimeTypes: ['application/json']
|
|
}
|
|
|
|
/**
|
|
* Combines all supported formats into a single object
|
|
*/
|
|
const ALL_WORKFLOW_FORMATS = {
|
|
extensions: [
|
|
...IMAGE_WORKFLOW_FORMATS.extensions,
|
|
...AUDIO_WORKFLOW_FORMATS.extensions,
|
|
...VIDEO_WORKFLOW_FORMATS.extensions,
|
|
...MODEL_WORKFLOW_FORMATS.extensions,
|
|
...DATA_WORKFLOW_FORMATS.extensions
|
|
],
|
|
mimeTypes: [
|
|
...IMAGE_WORKFLOW_FORMATS.mimeTypes,
|
|
...AUDIO_WORKFLOW_FORMATS.mimeTypes,
|
|
...VIDEO_WORKFLOW_FORMATS.mimeTypes,
|
|
...MODEL_WORKFLOW_FORMATS.mimeTypes,
|
|
...DATA_WORKFLOW_FORMATS.mimeTypes
|
|
]
|
|
}
|
|
|
|
/**
|
|
* Generate a comma-separated accept string for file inputs
|
|
* Combines all extensions and mime types
|
|
*/
|
|
export const WORKFLOW_ACCEPT_STRING = [
|
|
...ALL_WORKFLOW_FORMATS.extensions,
|
|
...ALL_WORKFLOW_FORMATS.mimeTypes
|
|
].join(',')
|