comment that format field is for frontend backward compatibility

This commit is contained in:
Richard Yu 2025-12-16 20:34:58 -08:00
parent 03a7f1cfb3
commit 724fbf827a

View File

@ -41,6 +41,7 @@ def is_previewable(media_type: str, item: dict) -> bool:
"""
Check if an output item is previewable.
Matches frontend logic in ComfyUI_frontend/src/stores/queueStore.ts
Maintains backwards compatibility with existing logic.
Priority:
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:
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', '')
if fmt and (fmt.startswith('video/') or fmt.startswith('audio/')):
return True