castorini / daam

Diffusion attentive attribution maps for interpreting Stable Diffusion.
MIT License
669 stars 61 forks source link

Fixed underscores and made merge indice calculation more robust #17

Closed sALTaccount closed 1 year ago

sALTaccount commented 1 year ago

Previously, the merge indice calculation could fail rather easily, and didn't work with underscores. Now you can have things such as underscores in the middle of words (or at all), quotation marks, every symbol but a space in your search. The previous code would fail with a prompt such as hololive, amane_kanata, 1girl, angel_wings, hairclip, blue eyes and searching for angel_wings, as it would become angel</w> _</w> wings</w>, and the code couldn't handle punctuation anywhere but the end.