Skip to content

Commit

Permalink
Refactor and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ikalinic committed Dec 17, 2024
1 parent 9d48096 commit 9a9a849
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/diffusion/python_stable_diffusion_3/txt2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,9 @@ def encode_token_weights(self, model_name, token_weight_pairs):
def get_embeddings(self, prompt_tokens):
l_out, l_pooled = self.encode_token_weights("clip-l",
prompt_tokens["l"])
# stable-diffusion-3-lite-onnx has swapped outputs for clip-l text encoder
if l_out.shape != (1, 77, 768):
tmp = l_pooled
l_pooled = l_out
l_out = tmp
l_out, l_pooled = l_pooled, l_out

g_out, g_pooled = self.encode_token_weights("clip-g",
prompt_tokens["g"])
Expand Down

0 comments on commit 9a9a849

Please sign in to comment.