Skip to content

Commit

Permalink
Fix and() for SDXL damian0815#78
Browse files Browse the repository at this point in the history
  • Loading branch information
kno10 authored Jun 3, 2024
1 parent c79844a commit a1e7cce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compel/compel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a1e7cce

Please sign in to comment.