Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Properly identify gifs
  • Loading branch information
huchenlei committed Oct 8, 2024
commit 609cf462876a8bee0f603720980b146043c26ead
4 changes: 1 addition & 3 deletions src/components/sidebar/tabs/queue/ResultItem.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<template>
<div class="result-container" ref="resultContainer">
<template
v-if="result.mediaType === 'images' || result.mediaType === 'gifs'"
>
<template v-if="result.isImage">
<ComfyImage
:src="result.url"
class="task-output-image"
Expand Down
14 changes: 13 additions & 1 deletion src/stores/queueStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export class ResultItemImpl {
// 'audio' | 'images' | ...
mediaType: string

// VHS output specific fields
format?: string
frame_rate?: number

get url(): string {
return api.apiURL(`/view?filename=${encodeURIComponent(this.filename)}&type=${this.type}&
subfolder=${encodeURIComponent(this.subfolder || '')}`)
Expand All @@ -44,8 +48,16 @@ export class ResultItemImpl {
return `${this.url}&t=${+new Date()}`
}

get isGif(): boolean {
return this.filename.endsWith('.gif')
}

get isImage(): boolean {
return this.mediaType === 'images' || this.isGif
}

get supportsPreview(): boolean {
return ['images', 'gifs'].includes(this.mediaType)
return this.isImage
}
}

Expand Down