Files
ComfyUI/comfy
Kosinkadink 019261ed96 Simplify Hunyuan 3D 2.1 swap_cfg_halves gate to a shape check
The previous gate (len(cond_or_uncond) == 2 and set == {0, 1}) was
intended to skip the cond/uncond swap when only one half was present
under MultiGPU CFG Split, but it was too restrictive: it also skipped
batch_size > 1 + CFG (cond_or_uncond like [0, 0, 1, 1] or [0,0,0,0,
1,1,1,1]), where chunk(2) still splits the batch cleanly into a cond
half and an uncond half and the swap is still required.

Switch to context.shape[0] >= 2, matching the parallel fix landed on
master in #13699. The swap is a permutation-invariant no-op when the
two halves don't form a CFG pair (since the output swap_cfg_halves
block immediately undoes the permutation), so the only thing the gate
actually needs to do is guard against chunk(2) on a batch of one.

Amp-Thread-ID: https://ampcode.com/threads/T-019e4a00-fe3d-76bd-a2f2-a8c8c4040082
Co-authored-by: Amp <amp@ampcode.com>
2026-05-21 12:14:02 -07:00
..
2024-06-27 18:43:11 -04:00
2026-02-26 01:30:31 -05:00
2025-01-24 06:15:54 -05:00
2026-03-14 18:36:29 -04:00
2025-07-06 07:07:39 -04:00
2026-05-08 17:14:45 +08:00
2026-05-20 05:45:04 +08:00