BlafKing / sd-civitai-browser-plus

Extension to access CivitAI via WebUI: download, delete, scan for updates, list installed models, assign tags, and boost downloads with multi-threading.
GNU Affero General Public License v3.0
309 stars 53 forks source link

[Bug]: double 'double-quotes' in the saved *model*.html file #118

Closed hakaserver closed 10 months ago

hakaserver commented 10 months ago

Describe the bug.

I'm not very knowledgeable of CSS and html, but from what I speculate, the html file created when using the 'save images' function is supposed to be used by the extension when loading the local models for display when using the 'Load all installed models', and that is probably why the page looks broken when opening the html file directly. However I find very practical to just open these files in a browser to quickly check prompt information or the original model URL. Despite the formatting not exactly working when directly viewing the file in a browser, the sample images aren't loaded at all, since the .html file is created with double 'double-quotes' in the <img> tag:

 <img  data-sampleimg="true" src=""sample_0.png"">

Steps to reproduce the problem.

  1. Download sample images with "save images" button
  2. Manually open the created .html file in a browser
  3. The images are not loaded

Expected behavior

When fixing the double quotes the images are loaded when directly viewing the .html file in a browser. Not sure if this breaks when viewing inside gradio through the extension, if that is really the supposed intention of the file as I imagine.

System info

Console logs

---

Additional information

No response

BlafKing commented 10 months ago

Thanks for the report!

The save_images function has been untouched since this project got initially forked, and I haven't ever used it myself, so thanks for notifying me about the issues!

It's a fair assumption to make that the .html file would be used for the 'Load all installed models' but this is not the case, the load installed models function works by getting the ID of each model, sending an API request and then displaying the return.

The images having double "double-quotes" is a very simple fix, thanks for pointing that out. As for why the file looks "broken", this is because the style.css file is not applied to the final html file, I will create a custom .css file for the html files and then append that to the final HTML file to fix the broken display :)

BlafKing commented 10 months ago

This issue is now fixed in v3.0 :)