Skip to content

[Bug]: CLIP Interrogator ignoring ".top3." option in file names of category list #14771

@martin-rizzo

Description

@martin-rizzo

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

I am experiencing an issue with the CLIP interrogator. It seems that the option ".top3" in the filename for category listings is not functioning as expected, as described in the documentation:

CLIP Interrogator Documentation

If you add ".top3." to filename, for example, flavors.top3.txt, three most relevant lines from this file will be added to the prompt (other numbers also work).

Steps to reproduce the problem

  1. Navigate to the "webui/interrogate" directory.
  2. Rename the file "artists.txt" to "artists.top3.txt"
  3. Start webui.
  4. Go to the img2img tab.
  5. Drag an image into the "Drop Image Here" box.
  6. Press the "CLIP" button to initiate the CLIP interrogator.
  7. Observe that instead of displaying the top 3 most relevant artists, only one artist is shown.

What should have happened?

Upon renaming "artists.txt" to "artists.top3.txt", the CLIP interrogator should display the top 3 most relevant artists associated with the provided image. This behavior is in accordance with the documented functionality, where adding ".top3." to the filename is expected to fetch and display the three most relevant lines from the file.

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

sysinfo-2024-01-26-23-21.json

Console logs

Python 3.10.13 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Launching Web UI with arguments: --xformers --theme dark
Style database not found: /home/XXXXXX/webui/styles.csv
Loading weights [ec41bd2a82] from /home/XXXXXX/Models/Stable-diffusion/Photon_v1.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 4.8s (prepare environment: 0.9s, import torch: 1.5s, import gradio: 0.4s, setup paths: 0.7s, initialize shared: 0.1s, other imports: 0.3s, setup codeformer: 0.1s, load scripts: 0.3s, create ui: 0.3s).
Creating model from config: /home/XXXXXX/webui/configs/v1-inference.yaml
## pretrained_model_name_or_path: openai/clip-vit-large-patch14
Applying attention optimization: xformers... done.
Model loaded in 1.8s (load weights from disk: 0.4s, create model: 0.8s, apply weights to model: 0.3s).
load checkpoint from /home/XXXXXX/webui/models/BLIP/model_base_caption_capfilt_large.pth

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-reportReport of a bug, yet to be confirmed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions