klimaleksus / stable-diffusion-webui-embedding-merge

Extension for AUTOMATIC1111/stable-diffusion-webui for creating and merging Textual Inversion embeddings at runtime from string literals.
The Unlicense
106 stars 10 forks source link

Error when enlarging with SDXL and Forge #18

Closed slashedstar closed 2 months ago

slashedstar commented 2 months ago

When trying the <'artstation' + 'artstation' :4 :+2> example with SDXL and forge it gives

Traceback (most recent call last):
  File "E:\stable-diffusion-webui-forge\extensions\stable-diffusion-webui-embedding-merge\scripts\embedding_merge.py", line 1339, in merge_one_prompt
    (res,err) = merge_parser(part,only_count)
  File "E:\stable-diffusion-webui-forge\extensions\stable-diffusion-webui-embedding-merge\scripts\embedding_merge.py", line 808, in merge_parser
    target[1][0:vectors] = right[1]
RuntimeError: The expanded size of the tensor (768) must match the existing size (1280) at non-singleton dimension 1.  Target sizes: [2, 768].  Tensor sizes: [2, 1280]

Forge Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7 Merge hash: 72181d77ed95ebe0f9073cf6791a97a966e9fbe7

aleksusklim commented 2 months ago

Thank you for finding this!

The bug was in calculating hidden dimension for zero padding, I forgot that it will be different too. Fixed now.