diff --git a/src/compel/compel.py b/src/compel/compel.py index 3c34dfc..7e78f8d 100644 --- a/src/compel/compel.py +++ b/src/compel/compel.py @@ -188,7 +188,9 @@ def build_conditioning_tensor_for_conjunction(self, conjunction: Conjunction) -> weight = conjunction.weights[i] if weight != 1: # apply weight if we need to - empty_conditioning = self.build_conditioning_tensor('') if empty_conditioning is None else empty_conditioning + if empty_conditioning is None: + empty_conditioning = self.build_conditioning_tensor('') + if isinstance(empty_conditioning, tuple): empty_conditioning = empty_conditioning[0] # discard pooled [padded_empty_conditioning, _] = self.pad_conditioning_tensors_to_same_length([empty_conditioning, this_conditioning]) this_conditioning = padded_empty_conditioning + (this_conditioning - padded_empty_conditioning) * weight to_concat.append(this_conditioning)