mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-15 07:52:35 +08:00
comment that format field is for frontend backward compatibility
This commit is contained in:
parent
03a7f1cfb3
commit
724fbf827a
@ -41,6 +41,7 @@ def is_previewable(media_type: str, item: dict) -> bool:
|
|||||||
"""
|
"""
|
||||||
Check if an output item is previewable.
|
Check if an output item is previewable.
|
||||||
Matches frontend logic in ComfyUI_frontend/src/stores/queueStore.ts
|
Matches frontend logic in ComfyUI_frontend/src/stores/queueStore.ts
|
||||||
|
Maintains backwards compatibility with existing logic.
|
||||||
|
|
||||||
Priority:
|
Priority:
|
||||||
1. media_type is 'images', 'video', or 'audio'
|
1. media_type is 'images', 'video', or 'audio'
|
||||||
@ -50,7 +51,8 @@ def is_previewable(media_type: str, item: dict) -> bool:
|
|||||||
if media_type in PREVIEWABLE_MEDIA_TYPES:
|
if media_type in PREVIEWABLE_MEDIA_TYPES:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Check format field (MIME type)
|
# Check format field (MIME type).
|
||||||
|
# Maintains backwards compatibility with how custom node outputs are handled in the frontend.
|
||||||
fmt = item.get('format', '')
|
fmt = item.get('format', '')
|
||||||
if fmt and (fmt.startswith('video/') or fmt.startswith('audio/')):
|
if fmt and (fmt.startswith('video/') or fmt.startswith('audio/')):
|
||||||
return True
|
return True
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user