Prevent all-regional negative conditioning from aborting sampling
perfloop/comfyui · VALUE KIND CONFUSION
https://perfloop.ai/t/oss/case_vw6ma95rgj
Verdict
VERIFIED · settled 2026-09-22 · pull request opened as Comfy-Org/ComfyUI#16477
Assertion repaired: comparison violated it and final source satisfied it: `During CFGGuider conditioning preprocessing, a conditioning family with global GLIGEN or control source payloads and only regional destination entries must complete without adding a global destination, preserve every regional destination's area and metadata identity, and retain the existing global-destination fill mapping and non-overwrite behavior.`
Hypothesis
An all-regional negative conditioning list can abort sampling before denoising. `process_conds` uses the absence of an existing negative payload as if it proved that a global negative entry exists to receive one, then indexes an empty list. This source-derived failure is deterministic for the stated graph shape, while its use frequency is unmeasured.
`area` is the authoritative kind tag here: entries without it are global conditioning and entries with it are regional conditioning. In `apply_empty_x_to_equal_area`, only no-`area` destination entries become `uncond_cnets` or `uncond_other`. If every destination entry is regional, both lists are empty. The early return tests only `uncond_cnets`; a global positive `gligen` or control then reaches `uncond_other[x % len(uncond_other)]` with a zero divisor.
The core nodes can construct this shape without a custom extension. `nodes.ConditioningSetArea.append` writes `area` onto every entry of a separately wired negative conditioning input. `nodes.GLIGENTextBoxApply.append` writes `gligen` onto a separately wired positive input. `nodes.KSampler` accepts those inputs independently, forwards them through `common_ksampler` and `comfy.sample`, and `CFGGuider.set_conds` inserts positive before negative. With a global positive GLIGEN entry and only regional negative entries, the target's area-pair pass can add an area counterpart to positive but cannot add a global entry to negative. Assuming the model's `extra_conds` does not add one, the subsequent GLIGEN fill call reaches the empty-list calculation.
Case proof target: run a saved core KSampler graph with `ConditioningSetArea` only on negative conditioning and `GLIGENTextBoxApply` only on positive conditioning. Confirm it completes sampling and preserves the supplied regional negative metadata, rather than raising at the fill pass. Instrument the processed lists and compare a control/GLIGEN graph that does include a global negative entry before and after the change, confirming its existing synthesized-fill mapping is unchanged; exercise the shared control path as a regression case. The claim is rejected if normal graph construction always inserts a global negative entry before `process_conds`.
Change to test: When a destination conditioning family has no global (no-`area`) entry, treat it as having no compatible fill slot rather than modulo-indexing an empty list. Preserve all regional entries and the existing round-robin control/GLIGEN fill behavior whenever a global destination entry exists.
Where it lives
perfloop/comfyui · execution.py
Evidence
Checks: 2 of 2 passed. Verification: no defect found.
Timeline
2026-09-22· Case opened2026-09-22· PR opened