Skip to content

Commit 3aace5c

Browse files
fix: count non-dict items in outputs_count (#12166)
Move count increment before isinstance(item, dict) check so that non-dict output items (like text strings from PreviewAny node) are included in outputs_count. This aligns OSS Python with Cloud's Go implementation which uses len(itemsArray) to count ALL items regardless of type. Amp-Thread-ID: https://ampcode.com/threads/T-019c0bb5-14e0-744f-8808-1e57653f3ae3 Co-authored-by: Amp <amp@ampcode.com>
1 parent b0d9708 commit 3aace5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

comfy_execution/jobs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ def get_outputs_summary(outputs: dict) -> tuple[int, Optional[dict]]:
171171
continue
172172

173173
for item in items:
174+
count += 1
175+
174176
if not isinstance(item, dict):
175177
continue
176-
count += 1
177178

178179
if preview_output is None and is_previewable(media_type, item):
179180
enriched = {

0 commit comments

Comments
 (0)