Update to v1.14.5
parent
be5b0f372d
commit
4f199fc9f7
|
|
@ -19,7 +19,7 @@ body:
|
|||
id: steps
|
||||
attributes:
|
||||
label: Steps to reproduce the problem.
|
||||
description: Please provide me with precise step by step instructions on how to reproduce the bug.
|
||||
description: Precise step by step instructions on how to reproduce the bug.
|
||||
value: |
|
||||
1. Go to ....
|
||||
2. Press ....
|
||||
|
|
@ -49,7 +49,7 @@ body:
|
|||
id: logs
|
||||
attributes:
|
||||
label: Console logs
|
||||
description: Please provide **full** cmd/terminal logs from the moment you started UI to the end of it, after your bug happened. If it's very long, provide a link to pastebin or similar service.
|
||||
description: Please share the complete cmd/terminal logs from the time the error occurred, ensuring you include all associated error messages.
|
||||
render: Shell
|
||||
validations:
|
||||
required: true
|
||||
|
|
@ -57,4 +57,4 @@ body:
|
|||
id: misc
|
||||
attributes:
|
||||
label: Additional information
|
||||
description: Please provide me with any relevant additional info or context.
|
||||
description: Please provide any relevant additional info or context.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
blank_issues_enabled: true
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: "🌟 Feature Request"
|
||||
url: "https://github.com/BlafKing/sd-civitai-browser-plus/discussions/new?category=ideas"
|
||||
about: "Feature requests are handled in the Discussions tab under 'Ideas'."
|
||||
- name: "❓ Questions"
|
||||
- name: "❓ Question"
|
||||
url: "https://github.com/BlafKing/sd-civitai-browser-plus/discussions/new?category=q-a"
|
||||
about: "If you have questions, please ask them in the Discussions tab under 'Q&A'."
|
||||
|
|
|
|||
11
README.md
11
README.md
|
|
@ -91,11 +91,18 @@ https://github.com/BlafKing/sd-civitai-browser/assets/9644716/ea873c3e-a7e4-44a8
|
|||
|
||||
# Changelog 📋
|
||||
|
||||
<h3>v1.14.5</h3>
|
||||
|
||||
* Feature: Base Model filter now impacts search results.
|
||||
* Feature: Ability to input model URL into search bar to find corresponding model.
|
||||
* Bug fix: Adetailer models now get placed in the correct folder
|
||||
|
||||
---
|
||||
<h3>v1.14.4</h3>
|
||||
|
||||
* Bug fix: Page slider broke the Next Page button when loaded from "Update Models".
|
||||
* Bug fix: Save settings as default inserted broken .json data.
|
||||
* Bug fix: Triggering "Scan for available updates" resulted in an error.
|
||||
* Bug fix: "Save settings as default" button inserted broken .json data.
|
||||
* Bug fix: Triggering "Scan for available updates" twice resulted in an error.
|
||||
|
||||
---
|
||||
<h3>v1.14.3</h3>
|
||||
|
|
|
|||
|
|
@ -58,43 +58,6 @@ function addOrUpdateRule(styleSheet, selector, newRules) {
|
|||
styleSheet.insertRule(`${selector} { ${newRules} }`, styleSheet.cssRules.length);
|
||||
}
|
||||
|
||||
function filterByBaseModel(selectedBaseModels) {
|
||||
if (!selectedBaseModels || selectedBaseModels.length === 0) {
|
||||
document.querySelectorAll('.civmodelcard').forEach(card => {
|
||||
card.style.opacity = '1';
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Array.isArray(selectedBaseModels)) {
|
||||
selectedBaseModels = [selectedBaseModels];
|
||||
}
|
||||
|
||||
document.querySelectorAll('.civmodelcard').forEach(card => {
|
||||
const cardBaseModel = card.getAttribute('base-model');
|
||||
let shouldDisplay = false;
|
||||
|
||||
for (let i = 0; i < selectedBaseModels.length; i++) {
|
||||
if (cardBaseModel === selectedBaseModels[i]) {
|
||||
shouldDisplay = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (selectedBaseModels[i] === "SD 2.0" && (cardBaseModel === "SD 2.0" || cardBaseModel === "SD 2.0 768")) {
|
||||
shouldDisplay = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (selectedBaseModels[i] === "SD 2.1" && ["SD 2.1", "SD 2.1 768", "SD 2.1 Unclip"].includes(cardBaseModel)) {
|
||||
shouldDisplay = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
card.style.opacity = shouldDisplay ? '1' : '0.1';
|
||||
});
|
||||
}
|
||||
|
||||
function updateCard(modelNameWithSuffix) {
|
||||
const lastDotIndex = modelNameWithSuffix.lastIndexOf('.');
|
||||
const modelName = modelNameWithSuffix.slice(0, lastDotIndex);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,10 @@ def contenttype_folder(content_type, desc=None, fromCheck=False):
|
|||
folder = os.path.join(models_path,"Workflows")
|
||||
|
||||
elif content_type == "Other":
|
||||
folder = os.path.join(models_path,"Other")
|
||||
if "ADETAILER" in desc:
|
||||
folder = os.path.join(models_path,"adetailer")
|
||||
else:
|
||||
folder = os.path.join(models_path,"Other")
|
||||
|
||||
elif content_type == "Wildcards":
|
||||
folder = os.path.join(extensions_dir, "UnivAICharGen", "wildcards")
|
||||
|
|
@ -125,7 +128,7 @@ def contenttype_folder(content_type, desc=None, fromCheck=False):
|
|||
|
||||
return folder
|
||||
|
||||
def api_to_data(content_type, sort_type, period_type, use_search_term, current_page, search_term=None, timeOut=None, isNext=None):
|
||||
def api_to_data(content_type, sort_type, period_type, use_search_term, current_page, base_filter, search_term=None, timeOut=None, isNext=None):
|
||||
if current_page in [0, None, ""]:
|
||||
current_page = 1
|
||||
if search_term != gl.previous_search_term or gl.tile_count != gl.previous_tile_count or gl.inputs_changed or gl.contentChange:
|
||||
|
|
@ -158,13 +161,21 @@ def api_to_data(content_type, sort_type, period_type, use_search_term, current_p
|
|||
query_str += types_query_str
|
||||
|
||||
if use_search_term != "None" and search_term:
|
||||
if use_search_term == "User name":
|
||||
if "civitai.com" in search_term:
|
||||
match = re.search(r'models/(\d+)', search_term)
|
||||
model_number = match.group(1)
|
||||
query_str = f"&ids={urllib.parse.quote(model_number)}"
|
||||
elif use_search_term == "User name":
|
||||
query_str += f"&username={urllib.parse.quote(search_term)}"
|
||||
elif use_search_term == "Tag":
|
||||
query_str += f"&tag={urllib.parse.quote(search_term)}"
|
||||
else:
|
||||
query_str += f"&query={urllib.parse.quote(search_term)}"
|
||||
|
||||
if base_filter:
|
||||
for base in base_filter:
|
||||
query_str += f"&baseModels={urllib.parse.quote(base)}"
|
||||
|
||||
full_url = f"{api_url}&{query_str}"
|
||||
|
||||
if gl.file_scan:
|
||||
|
|
@ -289,10 +300,10 @@ def model_list_html(json_data, model_dict):
|
|||
HTML += '</div>'
|
||||
return HTML
|
||||
|
||||
def update_prev_page(content_type, sort_type, period_type, use_search_term, search_term, current_page):
|
||||
return update_next_page(content_type, sort_type, period_type, use_search_term, search_term, current_page, isNext=False)
|
||||
def update_prev_page(content_type, sort_type, period_type, use_search_term, search_term, current_page, base_filter):
|
||||
return update_next_page(content_type, sort_type, period_type, use_search_term, search_term, current_page, base_filter, isNext=False)
|
||||
|
||||
def update_next_page(content_type, sort_type, period_type, use_search_term, search_term, current_page, isNext=True):
|
||||
def update_next_page(content_type, sort_type, period_type, use_search_term, search_term, current_page, base_filter, isNext=True):
|
||||
use_LORA = getattr(opts, "use_LORA", False)
|
||||
|
||||
if content_type:
|
||||
|
|
@ -305,14 +316,14 @@ def update_next_page(content_type, sort_type, period_type, use_search_term, sear
|
|||
|
||||
if gl.json_data is None or gl.json_data == "timeout":
|
||||
timeOut = True
|
||||
return_values = update_model_list(content_type, sort_type, period_type, use_search_term, search_term, current_page, timeOut, isNext)
|
||||
return_values = update_model_list(content_type, sort_type, period_type, use_search_term, search_term, current_page, base_filter, timeOut, isNext)
|
||||
timeOut = False
|
||||
|
||||
return return_values
|
||||
|
||||
gl.pageChange = True
|
||||
|
||||
current_inputs = (content_type, sort_type, period_type, use_search_term, search_term, gl.tile_count)
|
||||
current_inputs = (content_type, sort_type, period_type, use_search_term, search_term, gl.tile_count, base_filter)
|
||||
if gl.previous_inputs and current_inputs != gl.previous_inputs:
|
||||
gl.inputs_changed = True
|
||||
else:
|
||||
|
|
@ -323,7 +334,7 @@ def update_next_page(content_type, sort_type, period_type, use_search_term, sear
|
|||
|
||||
if not gl.file_scan:
|
||||
if gl.inputs_changed or gl.contentChange:
|
||||
return_values = update_model_list(content_type, sort_type, period_type, use_search_term, search_term, current_page)
|
||||
return_values = update_model_list(content_type, sort_type, period_type, use_search_term, search_term, current_page, base_filter)
|
||||
return return_values
|
||||
|
||||
if isNext:
|
||||
|
|
@ -421,7 +432,7 @@ def pagecontrol(json_data):
|
|||
hasPrev = True
|
||||
return hasPrev, hasNext, current_page, total_pages
|
||||
|
||||
def update_model_list(content_type, sort_type, period_type, use_search_term, search_term, current_page, timeOut=None, isNext=None, from_ver=False, from_installed=False):
|
||||
def update_model_list(content_type, sort_type, period_type, use_search_term, search_term, current_page, base_filter, timeOut=None, isNext=None, from_ver=False, from_installed=False):
|
||||
use_LORA = getattr(opts, "use_LORA", False)
|
||||
|
||||
if content_type:
|
||||
|
|
@ -436,7 +447,7 @@ def update_model_list(content_type, sort_type, period_type, use_search_term, sea
|
|||
gl.ver_json = None
|
||||
if not gl.pageChange and not gl.file_scan:
|
||||
|
||||
current_inputs = (content_type, sort_type, period_type, use_search_term, search_term, gl.tile_count)
|
||||
current_inputs = (content_type, sort_type, period_type, use_search_term, search_term, gl.tile_count, base_filter)
|
||||
|
||||
if gl.previous_inputs and current_inputs != gl.previous_inputs:
|
||||
gl.inputs_changed = True
|
||||
|
|
@ -445,7 +456,7 @@ def update_model_list(content_type, sort_type, period_type, use_search_term, sea
|
|||
|
||||
gl.previous_inputs = current_inputs
|
||||
|
||||
gl.json_data = api_to_data(content_type, sort_type, period_type, use_search_term, current_page, search_term, timeOut, isNext)
|
||||
gl.json_data = api_to_data(content_type, sort_type, period_type, use_search_term, current_page, base_filter, search_term, timeOut, isNext)
|
||||
if gl.json_data == "timeout":
|
||||
HTML = '<div style="font-size: 24px; text-align: center; margin: 50px !important;">The Civit-API has timed out, please try again.<br>The servers might be too busy or down if the issue persists.</div>'
|
||||
hasPrev = current_page not in [0, 1]
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ def on_ui_tabs():
|
|||
period_type = gr.Dropdown(label='Time period:', choices=["All Time", "Year", "Month", "Week", "Day"], value="All Time", type="value", elem_id="centerText")
|
||||
sort_type = gr.Dropdown(label='Sort by:', choices=["Newest","Most Downloaded","Highest Rated","Most Liked"], value="Most Downloaded", type="value", elem_id="centerText")
|
||||
with gr.Row():
|
||||
base_filter = gr.Dropdown(label='Filter base model:', multiselect=True, choices=["SD 1.4","SD 1.5","SD 2.0","SD 2.1", "SDXL 0.9", "SDXL 1.0", "Other"], value=None, type="value", elem_id="centerText")
|
||||
base_filter = gr.Dropdown(label='Filter base model:', multiselect=True, choices=["SD 1.4", "SD 1.5", "SD 2.0", "SD 2.0 768", "SD 2.1", "SD 2.1 768", "SD 2.1 Unclip", "SDXL 0.9", "SDXL 1.0", "Other"], value=None, type="value", elem_id="centerText")
|
||||
with gr.Row(elem_id=component_id):
|
||||
create_json = gr.Checkbox(label=f"Save tags after download", value=False, elem_id=toggle1, min_width=200)
|
||||
toggle_date = gr.Checkbox(label="Divide cards by date", value=False, elem_id=toggle2, min_width=200)
|
||||
|
|
@ -201,8 +201,6 @@ def on_ui_tabs():
|
|||
delete_finish = gr.Textbox(value=None, visible=False)
|
||||
current_model = gr.Textbox(value=None, visible=False)
|
||||
current_sha256 = gr.Textbox(value=None, visible=False)
|
||||
true = gr.Checkbox(value=True, visible=False)
|
||||
page_load = gr.Button(value="", elem_id="pageLoadBtn", visible=False)
|
||||
|
||||
# Global variable to detect if content has changed.
|
||||
def save_tags_btn(tags, file):
|
||||
|
|
@ -263,18 +261,6 @@ def on_ui_tabs():
|
|||
_js="(hideAndBlur) => toggleNSFWContent(hideAndBlur)"
|
||||
)
|
||||
|
||||
list_html.change(
|
||||
fn=None,
|
||||
inputs=[base_filter],
|
||||
_js="(baseModelValue) => filterByBaseModel(baseModelValue)"
|
||||
)
|
||||
|
||||
base_filter.change(
|
||||
fn=None,
|
||||
inputs=[base_filter],
|
||||
_js="(baseModelValue) => filterByBaseModel(baseModelValue)"
|
||||
)
|
||||
|
||||
list_html.change(
|
||||
fn=None,
|
||||
inputs=[size_slider],
|
||||
|
|
@ -288,7 +274,6 @@ def on_ui_tabs():
|
|||
)
|
||||
|
||||
# Gradio components Logic #
|
||||
|
||||
trained_tags.input(
|
||||
fn=save_tags_btn,
|
||||
inputs=[trained_tags, model_filename],
|
||||
|
|
@ -696,7 +681,8 @@ def on_ui_tabs():
|
|||
period_type,
|
||||
use_search_term,
|
||||
search_term,
|
||||
page_slider
|
||||
page_slider,
|
||||
base_filter
|
||||
]
|
||||
|
||||
# Define common page load outputs
|
||||
|
|
|
|||
Loading…
Reference in New Issue