Closed junhwanlee2316 closed 1 year ago
Hi, I am also working on a similar project. I manually reshaped negative_prompt_embeds to (1, 77, 768), and although it runs without errors, the results are not satisfactory. I would like to know the correct usage.
Please make sure to load the negative vector with load_textual_inversion
as explained here: https://github.com/huggingface/diffusers/issues/3198
I am struggling to implement the negative_prompt_embeds parameter to the pipeline for calling.
I tried to convert the pytorch file(.pt) negative_embedding to the torch.FloatTensor using torch.load. However, I am running into the error "RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 768 but got size 77 for tensor number 1 in the list."
Figured that the transformed tensor has a size of [67, 768].
Link to the pipeline document: https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.__call__.negative_prompt_embeds
Code:
Log