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
284 stars 43 forks source link

[Bug]: Tile Count not working #141

Closed bankenichi closed 6 months ago

bankenichi commented 7 months ago

Describe the bug.

Looks like tile count isnt working, it will only show 15 tiles per page no matter what it is actually set to.

Steps to reproduce the problem.

  1. Go to Browser
  2. Set tile count to 100
  3. Run any search with 16+ results
  4. Returns 15 tiles on page 1
  5. Set tile count to 10
    1. Run any search with 11+ results
  6. Still returns 15 tiles on page 1

Expected behavior

Each page should show tiles equal to tile count

System info

Console logs



Already up to date.
venv "E:\Stable Diffusion\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Installing Miaoshou assistant requirement: gpt_index==0.4.24
Installing Miaoshou assistant requirement: langchain==0.0.132
Installing Miaoshou assistant requirement: gradio_client==0.5.0
Installing Miaoshou assistant requirement: requests==2.31.0
Installing Miaoshou assistant requirement: urllib3==2.0.6
Installing Miaoshou assistant requirement: tqdm==4.64.0
ReActor preheating... Device: CUDA
#######################################################################################################
Initializing Civitai Link
If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Civitai Link revision: 136983e89859fd0477b4a437ed333142a6aa29a4
SD-WebUI revision: cf2772fab0af5573da775e7437e6acdca424f26e

Checking Civitai Link requirements...

#######################################################################################################
Launching Web UI with arguments: --opt-sdp-attention --no-half-vae --theme dark --autolaunch
No module 'xformers'. Proceeding without it.
Civitai Helper: Get Custom Model Folder
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
[-] ADetailer initialized. version: 23.11.1, num models: 27
logs_location: E:\Stable Diffusion\stable-diffusion-webui\extensions\miaoshouai-assistant\logs
CivitAI Browser+: Aria2 RPC started
[AddNet] Updating model hashes...
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 330.60it/s]
[AddNet] Updating model hashes...
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 500.51it/s]
ControlNet preprocessor location: E:\Stable Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-12-18 22:53:27,656 - ControlNet - INFO - ControlNet v1.1.423
2023-12-18 22:53:27,934 - ControlNet - INFO - ControlNet v1.1.423
[sd-webui-freeu] Controlnet support: *enabled*
22:53:29 - ReActor - STATUS - Running v0.6.0-a2
Civitai: API loaded
Loading weights [cccb73cda9] from E:\Stable Diffusion\stable-diffusion-webui\models\Stable-diffusion\sexyToon3D_v10.safetensors
2023-12-18 22:53:30,389 - AnimateDiff - INFO - Injecting LCM to UI.
Creating model from config: E:\Stable Diffusion\stable-diffusion-webui\configs\v1-inference.yaml
2023-12-18 22:53:33,442 - AnimateDiff - INFO - Hacking i2i-batch.
Civitai Helper: Set Proxy:
add tab
[([button, button, button, button, button], button, gallery), ([button, button, button, button, button], button, gallery)]
Loading VAE weights specified in settings: E:\Stable Diffusion\stable-diffusion-webui\models\VAE\anythingKlF8Anime2VaeFtMse840000_anything.safetensors
Applying attention optimization: sdp... done.
2023-12-18 22:54:03,177 - AnimateDiff - INFO - Hacking i2i-batch is already done.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Civitai: Check resources for missing info files
Civitai Link: Connecting to Civitai Link Server
Model loaded in 40.0s (load weights from disk: 2.1s, create model: 0.6s, apply weights to model: 25.2s, load VAE: 1.7s, move model to device: 1.9s, load textual inversion embeddings: 5.3s, calculate empty prompt: 3.2s).
Civitai Link: Connected to Civitai Link Server
Civitai: Check resources for missing preview images
Startup time: 131.9s (initial startup: 0.1s, prepare environment: 54.2s, import torch: 11.1s, import gradio: 2.8s, setup paths: 1.6s, initialize shared: 1.2s, other imports: 1.5s, setup codeformer: 0.3s, list SD models: 1.3s, load scripts: 17.4s, create ui: 34.0s, gradio launch: 2.9s, app_started_callback: 3.2s).
Civitai Link: Joined room 
Civitai Link: Presence update: SD: 1, Clients: 1
Civitai Link: Connected to Civitai Instance
Civitai Link: Incoming Command: activities:list
Civitai Link: Incoming Command: resources:list
Civitai: Found 0 resources missing info files
Civitai: No info found on Civitai
Civitai: Found 57 resources missing preview images
Civitai: No preview images found on Civitai
CivitAI Browser+: Cannot save settings, failed to open "<_io.TextIOWrapper name='E:\\Stable Diffusion\\stable-diffusion-webui\\ui-config.json' mode='r' encoding='cp1252'>"
Please try to manually repair the file or remove it to reset settings.

### Additional information

Kept trying an eventually got that last message on the log,
BlafKing commented 7 months ago

Thanks for reporting.

I can't seem to re-create the issue you described:

https://github.com/BlafKing/sd-civitai-browser-plus/assets/9644716/e0e00696-6748-4682-8a35-1d8e6dbd3a43

Just to verify, did you try to load the pages in the same way that I did in the preview above?

I can't really think of anything that could cause this issue, since no one else has reported this before, and the code for page count insertion has remained the same for a long time. There's unfortunately not much I can do without more info/error logs :/

(The issue where it was unable to save the settings also shouldn't be able to affect this)

AbsolomTDaak commented 7 months ago

I get this issue as well, temp fix I did was, after initial only 15 images being shown, went back into setting for filter and changed to 99 images, and then it would show. I believe it has something to do with the update to 1.7.0 (which coincided when it started to take effect). Also noticed the not saving to the json file to set the default search. I think it has to do with the upgrade of gradio that they are using now. Side note, I use Automatic1111 using stability matrix, and although updated with a git pull in the webui-user.bat file stability matrix shows 1.6.0 but when running it shows as being 1.7.0 (strange problem). Here is what I get in console when I try to save default filter.

To create a public link, set share=True in launch(). Applying attention optimization: xformers... done. Startup time: 55.7s (prepare environment: 10.4s, import torch: 10.1s, import gradio: 1.5s, setup paths: 0.9s, initialize shared: 0.2s, other imports: 0.8s, setup codeformer: 0.2s, list SD models: 0.7s, load scripts: 13.4s, create ui: 11.6s, gradio launch: 3.1s, add APIs: 0.2s, app_started_callback: 2.3s). Model loaded in 26.7s (load weights from disk: 2.1s, create model: 4.8s, apply weights to model: 6.8s, apply half(): 0.1s, load VAE: 0.5s, move model to device: 0.3s, load textual inversion embeddings: 11.5s, calculate empty prompt: 0.5s). CivitAI Browser+: Cannot save settings, failed to open "<_io.TextIOWrapper name='D:\\AI\\Stability Matrix\\Data\\Packages\\Stable Diffusion WebUI\\ui-config.json' mode='r' encoding='cp1252'>" Please try to manually repair the file or remove it to reset settings.

So maybe this might help with the problem mentioned above. BTW really tempted to do a fresh install of Automatic1111 skipping the stability matrix middleman.

BlafKing commented 7 months ago

Thanks for chipping in! @AbsolomTDaak

I'll look into the issue a bit further, I myself don't experience any issues with 1.7.0, but upon inspection I see that some issues could maybe arise from the way that I currently implement fetching and setting the tile_count.

It's pretty bodgie, I currently set it as a global variable, instead of fetching the value when it should be used, which should be a better and more robust approach, so I'll go and implement that to see if it helps fix the issue! :)

AbsolomTDaak commented 7 months ago

Thanks for listening. Keep up the great work. And have a good festive period and a happy new year.

bankenichi commented 7 months ago

I went and manually edited ui-config.json and set the tile count to 15, that seems to have gotten it unstuck, but it will still return the same error message if I try to save a different tile count as default from the webui.

Thanks for all your hard work.

bankenichi commented 7 months ago

Thanks for reporting.

I can't seem to re-create the issue you described:

Preview_tile.mp4 Just to verify, did you try to load the pages in the same way that I did in the preview above?

I can't really think of anything that could cause this issue, since no one else has reported this before, and the code for page count insertion has remained the same for a long time. There's unfortunately not much I can do without more info/error logs :/

(The issue where it was unable to save the settings also shouldn't be able to affect this)

I did follow those steps exactly the first time I noticed.

It seems that my defaults were set to 15 at some point and the extension wasn't able to update it from webui. I actually went and set it to 100 in the ui-config and closed and reopned a1111, it didn't work. I went back and set it to 15 and it started working, so when I change it in webui it will work for that session.

It will still not save the defaults tho.

Edit: Wish I could share more logs with you, but there isn't anything else in them.

BlafKing commented 7 months ago

The latest version (v3.2.0) should now hopefully fix the issues mentioned in this thread!

It looks like the error with saving the filter settings was caused by an incorrect encoding, so I've forced it to be "utf8", which should be what the ui-config.json is encoded in.

The tile count being incorrect should also hopefully be fixed now, since I've used a better method of providing the actual tile count to the API request!

Please let me know if you're still experiencing any issues! :)

BlafKing commented 6 months ago

Since there have been no updates in a while I will close this bug report. Please feel free to send another message here if the issue still exists! :)