n.chunk(2) assumes that we sample both uncond and cond in a single batch, but some nodes (like Perturbed-attention guidance) require only cond for sampling, causing either ValueError: not enough values to unpack (expected 2, got 1) or wrong behavior (depending on the batch size).
This PR should fix that issue.
n.chunk(2)
assumes that we sample both uncond and cond in a single batch, but some nodes (like Perturbed-attention guidance) require only cond for sampling, causing eitherValueError: not enough values to unpack (expected 2, got 1)
or wrong behavior (depending on the batch size). This PR should fix that issue.