- added new shortcut for settings

- changed min of node size to 0
- updated readme
This commit is contained in:
Nuked
2024-04-26 10:58:01 +02:00
parent 162bc5e328
commit 2dfaed0969
5 changed files with 36 additions and 9 deletions
+2
View File
@@ -41,6 +41,7 @@ Maybe you don't need it. I need it >.<
to your ComfyUI `custom_nodes` directory
2. Enjoy!
NOTE: If you choose to use a different method to install the ComfyUI-N-Sidebar, please ensure that you rename the folder to `ComfyUI-N-Sidebar`.
# Uninstall
- Delete the `ComfyUI-N-Sidebar` folder in `custom_nodes`
@@ -54,6 +55,7 @@ to your ComfyUI `custom_nodes` directory
- `Alt+Z` to toggle show/hide sidebar
- `Alt+X` to focus on the search field
- `Alt+G` to open the settings
# Features
+18 -1
View File
@@ -50,6 +50,23 @@ class JSONConfigManager:
self.data[parameter_name] = value
self.write_json_file()
# If is different from ComfyUISidebar, change it
if __package__ != "ComfyUI-N-Sidebar":
RED = "\033[31m"
END = '\33[0m'
print(f"{RED}!!!{END}")
print(f"{RED}!!!{END}")
print(f"{RED}WARNING:'{__package__}' folder name is WRONG!!! Please rename it 'ComfyUI-N-Sidebar'.{END}")
print(f"{RED}!!!{END}")
print(f"{RED}!!!{END}")
else:
print("ComfyUI-N-Sidebar is loading...")
file_path = os.path.join(folder_paths.get_folder_paths("custom_nodes")[0],"ComfyUI-N-Sidebar","app","settings.json")
@@ -57,7 +74,7 @@ config_manager = JSONConfigManager(file_path)
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
print(folder_paths.get_folder_paths("custom_nodes"))
list_panels = os.path.join(folder_paths.get_folder_paths("custom_nodes")[0],"ComfyUI-N-Sidebar","app","panels")
list_panels_array = []
+7 -8
View File
@@ -139,7 +139,7 @@ function settingsSetup(app,$el) {
defaultValue: "10",
type: "slider",
attrs: {
min: 2,
min: 0,
max: 40,
step: 1,
},
@@ -170,7 +170,7 @@ function settingsSetup(app,$el) {
type: "slider",
attrs: {
min: 0,
max: 300,
max: 500,
step: 1,
},
onChange(value) {
@@ -307,16 +307,15 @@ function settingsSetup(app,$el) {
});
const switch_settings = document.getElementById("switch_settings");
const sb_modal_backdrop = document.getElementById("sb-modal-backdrop-settings");
const sb_modal_backdrop = document.getElementById("sb-modal-backdrop-settings");
switch_settings.addEventListener('click', function() {
//set sb-settingsDiv visible
const sb_settingsDiv = document.getElementById("sb_settingsDiv");
sb_settingsDiv.classList.remove('sb_hidden');
sb_modal_backdrop.classList.remove('sb_hidden');
showSettings();
})
document.body.addEventListener('click', function(event) {
+6
View File
@@ -504,3 +504,9 @@ document.body.addEventListener('click', function(event) {
function showSettings() {
const sb_settingsDiv = document.getElementById("sb_settingsDiv");
const sb_modal_backdrop = document.getElementById("sb-modal-backdrop-settings");
sb_settingsDiv.classList.remove('sb_hidden');
sb_modal_backdrop.classList.remove('sb_hidden');
}
+3
View File
@@ -919,6 +919,9 @@ function handleKeyPress(event) {
if (event.altKey && event.key.toLowerCase() === "z") {
toggleSHSB()
}
if (event.altKey && event.key.toLowerCase() === "g") {
showSettings()
}
}