mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +00:00
Prefer saved media over preview media as task cover media (#576)
This commit is contained in:
@@ -10,7 +10,7 @@ import type {
|
|||||||
ResultItem
|
ResultItem
|
||||||
} from '@/types/apiTypes'
|
} from '@/types/apiTypes'
|
||||||
import type { NodeId } from '@/types/comfyWorkflow'
|
import type { NodeId } from '@/types/comfyWorkflow'
|
||||||
import { instanceToPlain, plainToClass } from 'class-transformer'
|
import { plainToClass } from 'class-transformer'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { toRaw } from 'vue'
|
import { toRaw } from 'vue'
|
||||||
@@ -88,7 +88,12 @@ export class TaskItemImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get previewOutput(): ResultItemImpl | undefined {
|
get previewOutput(): ResultItemImpl | undefined {
|
||||||
return this.flatOutputs.find((output) => output.supportsPreview)
|
return (
|
||||||
|
this.flatOutputs.find(
|
||||||
|
// Prefer saved media files over the temp previews
|
||||||
|
(output) => output.type === 'output' && output.supportsPreview
|
||||||
|
) ?? this.flatOutputs.find((output) => output.supportsPreview)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
get apiTaskType(): APITaskType {
|
get apiTaskType(): APITaskType {
|
||||||
|
|||||||
Reference in New Issue
Block a user