You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to make an inference with multiple prompt at one time and got:
mat1 and mat2 shapes cannot be multiplied (2x4096 and 2816x1280)
Here is a basic example:
pipe = StableDiffusion ....
compel = Compel(
tokenizer=[pipe.tokenizer, pipe.tokenizer_2] ,
text_encoder=[pipe.text_encoder, pipe.text_encoder_2],
returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED,
requires_pooled=[False, True]
)
prompts_str = [
"a Man wearing (sunglasses)1.2, close up, realistic, 4k",
"a dog in a forest, long distance shot, photo, photography, highly detailed",
]
prompts = [compel(x) for x in prompts_str]
conditioning = torch.cat([e[0] for e in prompts], dim=1)
pooled = torch.cat([e[1] for e in prompts], dim =1 )
image = pipe(
prompt_embeds=conditioning,
pooled_prompt_embeds=pooled,
image_batch_size=2,
prompt_batch_size=2,
...
)
I tried to use list instead of torch.cat, I tried to pass on pooled prompt
Thanks in advance
The text was updated successfully, but these errors were encountered:
I wanted to make an inference with multiple prompt at one time and got:
mat1 and mat2 shapes cannot be multiplied (2x4096 and 2816x1280)
Here is a basic example:
I tried to use list instead of torch.cat, I tried to pass on pooled prompt
Thanks in advance
The text was updated successfully, but these errors were encountered: