mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
[BugFix] Remove outputs.animated in queueStore (#2740)
This commit is contained in:
@@ -142,7 +142,15 @@ export class TaskItemImpl {
|
|||||||
this.taskType = taskType
|
this.taskType = taskType
|
||||||
this.prompt = prompt
|
this.prompt = prompt
|
||||||
this.status = status
|
this.status = status
|
||||||
this.outputs = outputs ?? {}
|
// Remove animated outputs from the outputs object
|
||||||
|
// outputs.animated is an array of boolean values that indicates if the images
|
||||||
|
// array in the result are animated or not.
|
||||||
|
// The queueStore does not use this information.
|
||||||
|
// It is part of the legacy API response. We should redesign the backend API.
|
||||||
|
// https://github.com/Comfy-Org/ComfyUI_frontend/issues/2739
|
||||||
|
this.outputs = _.mapValues(outputs ?? {}, (nodeOutputs) =>
|
||||||
|
_.omit(nodeOutputs, 'animated')
|
||||||
|
)
|
||||||
this.flatOutputs = flatOutputs ?? this.calculateFlatOutputs()
|
this.flatOutputs = flatOutputs ?? this.calculateFlatOutputs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
42
tests-ui/tests/store/queueStore.test.ts
Normal file
42
tests-ui/tests/store/queueStore.test.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
// @ts-strict-ignore
|
||||||
|
import { TaskItemImpl } from '@/stores/queueStore'
|
||||||
|
|
||||||
|
describe('TaskItemImpl', () => {
|
||||||
|
it('should remove animated property from outputs during construction', () => {
|
||||||
|
const taskItem = new TaskItemImpl(
|
||||||
|
'History',
|
||||||
|
[0, 'prompt-id', {}, {}, []],
|
||||||
|
{ status_str: 'success', messages: [] },
|
||||||
|
{
|
||||||
|
'node-1': {
|
||||||
|
images: [{ filename: 'test.png', type: 'output', subfolder: '' }],
|
||||||
|
animated: [false]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// Check that animated property was removed
|
||||||
|
expect('animated' in taskItem.outputs['node-1']).toBe(false)
|
||||||
|
|
||||||
|
// Verify other output properties remain intact
|
||||||
|
expect(taskItem.outputs['node-1'].images).toBeDefined()
|
||||||
|
expect(taskItem.outputs['node-1'].images[0].filename).toBe('test.png')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should handle outputs without animated property', () => {
|
||||||
|
const taskItem = new TaskItemImpl(
|
||||||
|
'History',
|
||||||
|
[0, 'prompt-id', {}, {}, []],
|
||||||
|
{ status_str: 'success', messages: [] },
|
||||||
|
{
|
||||||
|
'node-1': {
|
||||||
|
images: [{ filename: 'test.png', type: 'output', subfolder: '' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// Verify outputs are preserved when no animated property exists
|
||||||
|
expect(taskItem.outputs['node-1'].images).toBeDefined()
|
||||||
|
expect(taskItem.outputs['node-1'].images[0].filename).toBe('test.png')
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user