Allow for selecting an empty tagFile to disable booru suggestions

This commit is contained in:
ctwrs
2022-12-23 21:34:00 +01:00
parent 16bf9d9a51
commit f11abe60c2
2 changed files with 2 additions and 2 deletions

View File

@@ -132,7 +132,7 @@ var translations = new Map();
async function loadTags(c) {
// Load main tags and aliases
if (allTags.length === 0) {
if (allTags.length === 0 && c.tagFile && c.tagFile !== "None") {
try {
allTags = await loadCSV(`${tagBasePath}/${c.tagFile}?${new Date().getTime()}`);
} catch (e) {

View File

@@ -153,7 +153,7 @@ if EMB_PATH.exists():
def on_ui_settings():
TAC_SECTION = ("tac", "Tag Autocomplete")
# Main tag file
shared.opts.add_option("tac_tagFile", shared.OptionInfo("danbooru.csv", "Tag filename", gr.Dropdown, lambda: {"choices": csv_files}, refresh=update_tag_files, section=TAC_SECTION))
shared.opts.add_option("tac_tagFile", shared.OptionInfo("danbooru.csv", "Tag filename", gr.Dropdown, lambda: {"choices": csv_files_withnone}, refresh=update_tag_files, section=TAC_SECTION))
# Active in settings
shared.opts.add_option("tac_active", shared.OptionInfo(True, "Enable Tag Autocompletion", section=TAC_SECTION))
shared.opts.add_option("tac_activeIn.txt2img", shared.OptionInfo(True, "Active in txt2img (Requires restart)", section=TAC_SECTION))