From 380b6aec8e05feaf75994345fdf1ba55dbe4dbed Mon Sep 17 00:00:00 2001 From: Richard Yu Date: Tue, 2 Dec 2025 19:33:22 -0800 Subject: [PATCH] fix ruff --- comfy_execution/jobs.py | 26 ++++++++++---------------- tests/execution/test_jobs.py | 5 ----- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/comfy_execution/jobs.py b/comfy_execution/jobs.py index 4f5758e07..a5a6b53d4 100644 --- a/comfy_execution/jobs.py +++ b/comfy_execution/jobs.py @@ -133,22 +133,16 @@ def get_outputs_summary(outputs): for item in items: count += 1 - if preview_output is not None: - continue - - if not is_previewable(media_type, item): - continue - - enriched = { - **item, - 'nodeId': node_id, - 'mediaType': media_type - } - - if item.get('type') == 'output': - preview_output = enriched - elif fallback_preview is None: - fallback_preview = enriched + if preview_output is None and is_previewable(media_type, item): + enriched = { + **item, + 'nodeId': node_id, + 'mediaType': media_type + } + if item.get('type') == 'output': + preview_output = enriched + elif fallback_preview is None: + fallback_preview = enriched return count, preview_output or fallback_preview diff --git a/tests/execution/test_jobs.py b/tests/execution/test_jobs.py index 07f882cac..8c0a6ce06 100644 --- a/tests/execution/test_jobs.py +++ b/tests/execution/test_jobs.py @@ -1,12 +1,7 @@ """Unit tests for comfy_execution/jobs.py""" -import pytest -from pytest import fixture -from unittest.mock import MagicMock from comfy_execution.jobs import ( JobStatus, - PREVIEWABLE_MEDIA_TYPES, - THREE_D_EXTENSIONS, is_previewable, normalize_queue_item, normalize_history_item,