Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"@comfyorg/comfyui-electron-types": "0.4.73-0",
"@comfyorg/design-system": "workspace:*",
"@comfyorg/registry-types": "workspace:*",
"@comfyorg/shared-frontend-utils": "workspace:*",
"@comfyorg/tailwind-utils": "workspace:*",
"@iconify/json": "catalog:",
"@primeuix/forms": "catalog:",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2036,8 +2036,18 @@
"downloadStarted": "Downloading {count} files...",
"downloadsStarted": "Started downloading {count} file(s)",
"assetsDeletedSuccessfully": "{count} asset(s) deleted successfully",
"failedToDeleteAssets": "Failed to delete selected assets"
}
"failedToDeleteAssets": "Failed to delete selected assets",
"partialDeleteSuccess": "{succeeded} deleted successfully, {failed} failed"
},
"noJobIdFound": "No job ID found for this asset",
"unsupportedFileType": "Unsupported file type for loader node",
"nodeTypeNotFound": "Node type {nodeType} not found",
"failedToCreateNode": "Failed to create node",
"nodeAddedToWorkflow": "{nodeType} node added to workflow",
"noWorkflowDataFound": "No workflow data found in this asset",
"workflowOpenedInNewTab": "Workflow opened in new tab",
"failedToExportWorkflow": "Failed to export workflow",
"workflowExportedSuccessfully": "Workflow exported successfully"
},
"actionbar": {
"dockToTop": "Dock to top",
Expand Down
1 change: 0 additions & 1 deletion src/platform/assets/components/MediaAssetCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
:context="{ type: assetType }"
@view="handleZoomClick"
@download="actions.downloadAsset()"
@play="actions.playAsset(asset.id)"
@video-playing-state-changed="isVideoPlaying = $event"
@video-controls-changed="showVideoControls = $event"
@image-loaded="handleImageLoaded"
Expand Down
51 changes: 42 additions & 9 deletions src/platform/assets/components/MediaAssetMoreMenu.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div class="flex flex-col">
<!-- TODO: 3D assets currently excluded from inspection.
When 3D loader nodes are implemented, update detectNodeTypeFromFilename
to return appropriate node type for .gltf, .glb files and remove this exclusion -->
<IconTextButton
v-if="asset?.kind !== '3D'"
type="transparent"
Expand All @@ -12,7 +15,7 @@
</IconTextButton>

<IconTextButton
v-if="showWorkflowOptions"
v-if="showAddToWorkflow"
type="transparent"
label="Add to current workflow"
@click="handleAddToWorkflow"
Expand All @@ -28,10 +31,10 @@
</template>
</IconTextButton>

<MediaAssetButtonDivider v-if="showWorkflowOptions" />
<MediaAssetButtonDivider v-if="showAddToWorkflow || showWorkflowActions" />

<IconTextButton
v-if="showWorkflowOptions"
v-if="showWorkflowActions"
type="transparent"
label="Open as workflow in new tab"
@click="handleOpenWorkflow"
Expand All @@ -42,7 +45,7 @@
</IconTextButton>

<IconTextButton
v-if="showWorkflowOptions"
v-if="showWorkflowActions"
type="transparent"
label="Export workflow"
@click="handleExportWorkflow"
Expand All @@ -52,7 +55,7 @@
</template>
</IconTextButton>

<MediaAssetButtonDivider v-if="showWorkflowOptions && showCopyJobId" />
<MediaAssetButtonDivider v-if="showWorkflowActions && showCopyJobId" />

<IconTextButton
v-if="showCopyJobId"
Expand Down Expand Up @@ -85,6 +88,8 @@ import { computed, inject } from 'vue'

import IconTextButton from '@/components/button/IconTextButton.vue'
import { isCloud } from '@/platform/distribution/types'
import { supportsWorkflowMetadata } from '@/platform/workflow/utils/workflowExtractionUtil'
import { detectNodeTypeFromFilename } from '@/utils/loaderNodeUtil'

import { useMediaAssetActions } from '../composables/useMediaAssetActions'
import { MediaAssetKey } from '../schemas/mediaAssetSchema'
Expand All @@ -107,7 +112,35 @@ const assetType = computed(() => {
return asset.value?.tags?.[0] || context.value?.type || 'output'
})

const showWorkflowOptions = computed(() => assetType.value === 'output')
// Show "Add to current workflow" for all media files (images, videos, audio)
// This works for any file type that has a corresponding loader node
const showAddToWorkflow = computed(() => {
// Output assets can always be added
if (assetType.value === 'output') return true

// Input assets: check if file type is supported by loader nodes
// Use the same utility as the actual addWorkflow function for consistency
if (assetType.value === 'input' && asset.value?.name) {
const { nodeType } = detectNodeTypeFromFilename(asset.value.name)
return nodeType !== null
}

return false
})

// Show "Open/Export workflow" only for files with workflow metadata
// This is more restrictive - only PNG, WEBP, FLAC support embedded workflows
const showWorkflowActions = computed(() => {
// Output assets always have workflow metadata
if (assetType.value === 'output') return true

// Input assets: only formats that support workflow metadata
if (assetType.value === 'input' && asset.value?.name) {
return supportsWorkflowMetadata(asset.value.name)
}

return false
})

// Only show Copy Job ID for output assets (not for imported/input assets)
const showCopyJobId = computed(() => {
Expand All @@ -129,7 +162,7 @@ const handleInspect = () => {

const handleAddToWorkflow = () => {
if (asset.value) {
actions.addWorkflow(asset.value.id)
actions.addWorkflow()
}
close()
}
Expand All @@ -143,14 +176,14 @@ const handleDownload = () => {

const handleOpenWorkflow = () => {
if (asset.value) {
actions.openWorkflow(asset.value.id)
actions.openWorkflow()
}
close()
}

const handleExportWorkflow = () => {
if (asset.value) {
actions.exportWorkflow(asset.value.id)
actions.exportWorkflow()
}
close()
}
Expand Down
Loading