mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-25 16:59:45 +00:00
Filter cached/canceled results (#1586)
* Filter cached/canceled results * Highlight if on * Update setting
This commit is contained in:
@@ -198,6 +198,25 @@ export const CORE_SETTINGS: SettingParams[] = [
|
||||
type: 'hidden',
|
||||
defaultValue: 'cover'
|
||||
},
|
||||
// Hidden setting used by the queue for if the results should be grouped by prompt
|
||||
{
|
||||
id: 'Comfy.Queue.ShowFlatList',
|
||||
name: 'Queue show flat list',
|
||||
type: 'hidden',
|
||||
defaultValue: false
|
||||
},
|
||||
|
||||
// Hidden setting used by the queue to filter certain results
|
||||
{
|
||||
id: 'Comfy.Queue.Filter',
|
||||
name: 'Queue output filters',
|
||||
type: 'hidden',
|
||||
defaultValue: {
|
||||
hideCanceled: false,
|
||||
hideCached: false
|
||||
},
|
||||
versionAdded: '1.4.3'
|
||||
},
|
||||
{
|
||||
id: 'Comfy.GroupSelectedNodes.Padding',
|
||||
category: ['LiteGraph', 'Group', 'Padding'],
|
||||
|
||||
@@ -30,6 +30,7 @@ export class ResultItemImpl {
|
||||
filename: string
|
||||
subfolder: string
|
||||
type: string
|
||||
cached: boolean
|
||||
|
||||
nodeId: NodeId
|
||||
// 'audio' | 'images' | ...
|
||||
@@ -43,6 +44,7 @@ export class ResultItemImpl {
|
||||
this.filename = obj.filename ?? ''
|
||||
this.subfolder = obj.subfolder ?? ''
|
||||
this.type = obj.type ?? ''
|
||||
this.cached = obj.cached
|
||||
|
||||
this.nodeId = obj.nodeId
|
||||
this.mediaType = obj.mediaType
|
||||
@@ -149,6 +151,13 @@ export class TaskItemImpl {
|
||||
if (!this.outputs) {
|
||||
return []
|
||||
}
|
||||
|
||||
const cachedEntries = new Set(
|
||||
this.status?.messages?.find((message) => {
|
||||
return message[0] === 'execution_cached'
|
||||
})?.[1].nodes
|
||||
)
|
||||
|
||||
return Object.entries(this.outputs).flatMap(([nodeId, nodeOutputs]) =>
|
||||
Object.entries(nodeOutputs).flatMap(([mediaType, items]) =>
|
||||
(items as ResultItem[]).map(
|
||||
@@ -156,7 +165,8 @@ export class TaskItemImpl {
|
||||
new ResultItemImpl({
|
||||
...item,
|
||||
nodeId,
|
||||
mediaType
|
||||
mediaType,
|
||||
cached: cachedEntries.has(nodeId)
|
||||
})
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user