Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Lora that breaks the display of other Lora in folders #10

Closed
klintan96 opened this issue Sep 13, 2023 · 5 comments
Closed

[Bug] Lora that breaks the display of other Lora in folders #10

klintan96 opened this issue Sep 13, 2023 · 5 comments
Labels
webui issue is a problem with webui - not this extension

Comments

@klintan96
Copy link

Describe Issue

Lora that breaks the display of other Lora in folders

If the problematic Lora is in folder 1, some or all of the Lora in folder 2 will disappear, but if you move the Lora from 2 to 1 or to the main Lora folder, it will reappear.

This problem occurred in the latest update of the Civitai Helper, when it started to create a JSON file for each Lora.

The problem turned out to be in the json file, specifically in the description section.

"description": "Train LoRa is time and resource expensive, you can support my future works here:\u2764\ufe0fBoosty Donation linkAstarotte no omocha!\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\n\n\n\n\n\nResize, rename to usable format(<title>_), compile to one civit page, and made this page look fine.\n\nIt's same as old one, but much less size with little lost in quality(yes older is seems little better in details, but not so much).\n\n\n\n\n\n",

Here is a link to Lora, all Lora from this page have this problem due to the same description.

https://civitai.com/models/63708?modelVersionId=68326

Screenshot for UI issue

If I remove the descriptions from the problematic Lora json file, all Lora work fine.

1
2

@zixaphir
Copy link
Owner

zixaphir commented Sep 14, 2023

For the time being, this can be worked around by disabling the Show description on card option in Settings -> Extra Networks -> [ ] Show description on card.

@zixaphir zixaphir added invalid This doesn't seem right webui issue is a problem with webui - not this extension labels Sep 21, 2023
@aylz10
Copy link

aylz10 commented Sep 28, 2023

这是因为在description中出现了“<“和”>“符号,可以使用re函数将description中可能出现的“<“和”>“符号去除,像这样:
model_info["description"] = re.sub(r'[<>]', "", model_info["description"])

@zixaphir zixaphir removed the invalid This doesn't seem right label Oct 1, 2023
@zixaphir
Copy link
Owner

zixaphir commented Oct 1, 2023

这是因为在description中出现了“<“和”>“符号,可以使用re函数将description中可能出现的“<“和”>“符号去除,像这样: model_info["description"] = re.sub(r'[<>]', "", model_info["description"])

Unfortunately, this creates other issues for me: What if the user wants to keep <> characters in the model description?

The author of webui and I disagree on the feature of supporting HTML in the model description, so I'll be trying to work on a solution that will allow <> characters without triggering the HTML parser.


不幸的是,这对我而言带来了其他问题:如果用户想在模型描述中保留 <> 字符怎么办?

WebUI的作者和我在支持模型描述中的HTML功能方面存在分歧,因此我将尝试制定一个解决方案,允许 <> 字符而不触发HTML解析器。

翻译提示:此翻译由ChatGPT生成。

@aylz10
Copy link

aylz10 commented Oct 2, 2023

这是因为在description中出现了“<“和”>“符号,可以使用re函数将description中可能出现的“<“和”>“符号去除,像这样: model_info["description"] = re.sub(r'[<>]', "", model_info["description"])

Unfortunately, this creates other issues for me: What if the user wants to keep <> characters in the model description?

The author of webui and I disagree on the feature of supporting HTML in the model description, so I'll be trying to work on a solution that will allow <> characters without triggering the HTML parser.

不幸的是,这对我而言带来了其他问题:如果用户想在模型描述中保留 <> 字符怎么办?

WebUI的作者和我在支持模型描述中的HTML功能方面存在分歧,因此我将尝试制定一个解决方案,允许 <> 字符而不触发HTML解析器。

翻译提示:此翻译由ChatGPT生成。

的确,我没有想到这个情况,或许可以使用转义字符
"&lt;"来替换"<","&gt;"来替换">"

zixaphir added a commit that referenced this issue Oct 5, 2023
This is not ideal but given the ideal solution isn't going to
happen (which is: don't parse the description as HTML), this is
the best middle-ground I can come up with. Mind you, it's not
fool-proof: if for some reason a model author on civitai puts
`<!-- -->` in their model description, it will break, but it
it keeps virtually all models from breaking webui otherwise,
and allows the user to remove them if they want to restore
the description's display within webui's model cards.
@zixaphir
Copy link
Owner

zixaphir commented Oct 7, 2023

I've taken some steps to prevent this from happening in the future, but current files will need to be rescanned with "Replace Old Metadata Formats" enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
webui issue is a problem with webui - not this extension
Projects
None yet
Development

No branches or pull requests

3 participants