|
| 1 | +/** |
| 2 | + * Supported workflow file formats organized by type category |
| 3 | + */ |
| 4 | + |
| 5 | +/** |
| 6 | + * All supported image formats that can contain workflow data |
| 7 | + */ |
| 8 | +export const IMAGE_WORKFLOW_FORMATS = { |
| 9 | + extensions: ['.png', '.webp', '.svg'], |
| 10 | + mimeTypes: ['image/png', 'image/webp', 'image/svg+xml'] |
| 11 | +} |
| 12 | + |
| 13 | +/** |
| 14 | + * All supported audio formats that can contain workflow data |
| 15 | + */ |
| 16 | +export const AUDIO_WORKFLOW_FORMATS = { |
| 17 | + extensions: ['.mp3', '.ogg', '.flac'], |
| 18 | + mimeTypes: ['audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/x-flac'] |
| 19 | +} |
| 20 | + |
| 21 | +/** |
| 22 | + * All supported video formats that can contain workflow data |
| 23 | + */ |
| 24 | +export const VIDEO_WORKFLOW_FORMATS = { |
| 25 | + extensions: ['.mp4', '.mov', '.m4v', '.webm'], |
| 26 | + mimeTypes: ['video/mp4', 'video/quicktime', 'video/x-m4v', 'video/webm'] |
| 27 | +} |
| 28 | + |
| 29 | +/** |
| 30 | + * All supported 3D model formats that can contain workflow data |
| 31 | + */ |
| 32 | +export const MODEL_WORKFLOW_FORMATS = { |
| 33 | + extensions: ['.glb'], |
| 34 | + mimeTypes: ['model/gltf-binary'] |
| 35 | +} |
| 36 | + |
| 37 | +/** |
| 38 | + * All supported data formats that directly contain workflow data |
| 39 | + */ |
| 40 | +export const DATA_WORKFLOW_FORMATS = { |
| 41 | + extensions: ['.json', '.latent', '.safetensors'], |
| 42 | + mimeTypes: ['application/json'] |
| 43 | +} |
| 44 | + |
| 45 | +/** |
| 46 | + * Combines all supported formats into a single object |
| 47 | + */ |
| 48 | +export const ALL_WORKFLOW_FORMATS = { |
| 49 | + extensions: [ |
| 50 | + ...IMAGE_WORKFLOW_FORMATS.extensions, |
| 51 | + ...AUDIO_WORKFLOW_FORMATS.extensions, |
| 52 | + ...VIDEO_WORKFLOW_FORMATS.extensions, |
| 53 | + ...MODEL_WORKFLOW_FORMATS.extensions, |
| 54 | + ...DATA_WORKFLOW_FORMATS.extensions |
| 55 | + ], |
| 56 | + mimeTypes: [ |
| 57 | + ...IMAGE_WORKFLOW_FORMATS.mimeTypes, |
| 58 | + ...AUDIO_WORKFLOW_FORMATS.mimeTypes, |
| 59 | + ...VIDEO_WORKFLOW_FORMATS.mimeTypes, |
| 60 | + ...MODEL_WORKFLOW_FORMATS.mimeTypes, |
| 61 | + ...DATA_WORKFLOW_FORMATS.mimeTypes |
| 62 | + ] |
| 63 | +} |
| 64 | + |
| 65 | +/** |
| 66 | + * Generate a comma-separated accept string for file inputs |
| 67 | + * Combines all extensions and mime types |
| 68 | + */ |
| 69 | +export const WORKFLOW_ACCEPT_STRING = [ |
| 70 | + ...ALL_WORKFLOW_FORMATS.extensions, |
| 71 | + ...ALL_WORKFLOW_FORMATS.mimeTypes |
| 72 | +].join(',') |
0 commit comments