diff --git a/glob/manager_core.py b/glob/manager_core.py index 39855ef7..e56f0cdf 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -3264,7 +3264,9 @@ def switch_comfyui(tag): if tag == 'nightly': repo.git.checkout('master') - repo.remotes.origin.pull() + tracking_branch = repo.active_branch.tracking_branch() + remote_name = tracking_branch.remote_name + repo.remotes[remote_name].pull() print("[ComfyUI-Manager] ComfyUI version is switched to the latest 'master' version") else: repo.git.checkout(tag) diff --git a/js/comfyui-manager.js b/js/comfyui-manager.js index 6e854828..7d353e60 100644 --- a/js/comfyui-manager.js +++ b/js/comfyui-manager.js @@ -228,6 +228,7 @@ var switch_comfyui_button = null; var fetch_updates_button = null; var update_all_button = null; var restart_stop_button = null; +var update_policy_combo = null; let share_option = 'all'; var is_updating = false; @@ -627,6 +628,15 @@ async function switchComfyUI() { } showVersionSelectorDialog(versions, obj.current, async (selected_version) => { + if(selected_version == 'nightly') { + update_policy_combo.value = 'nightly-comfyui'; + api.fetchApi('/manager/policy/update?value=nightly-comfyui'); + } + else { + update_policy_combo.value = 'stable-comfyui'; + api.fetchApi('/manager/policy/update?value=stable-comfyui'); + } + let response = await api.fetchApi(`/comfyui_manager/comfyui_switch_version?ver=${selected_version}`, { cache: "no-store" }); if (response.status == 200) { infoToast(`ComfyUI version is switched to ${selected_version}`); @@ -1126,22 +1136,22 @@ class ManagerMenuDialog extends ComfyDialog { set_component_policy(event.target.value); }); - let update_policy_combo = document.createElement("select"); + update_policy_combo = document.createElement("select"); if(isElectron) update_policy_combo.style.display = 'none'; update_policy_combo.setAttribute("title", "Sets the policy to be applied when performing an update."); update_policy_combo.className = "cm-menu-combo"; - update_policy_combo.appendChild($el('option', { value: 'stable-comfyui', text: 'Update: Stable ComfyUI' }, [])); - update_policy_combo.appendChild($el('option', { value: 'nightly-comfyui', text: 'Update: Nightly ComfyUI' }, [])); + update_policy_combo.appendChild($el('option', { value: 'stable-comfyui', text: 'Update: ComfyUI Stable Version' }, [])); + update_policy_combo.appendChild($el('option', { value: 'nightly-comfyui', text: 'Update: ComfyUI Nightly Version' }, [])); api.fetchApi('/manager/policy/update') .then(response => response.text()) .then(data => { update_policy_combo.value = data; }); - update_policy_combo.addEventListener('change', function (event) { + update_policy_combo.addEventListener('change', function (event) { api.fetchApi(`/manager/policy/update?value=${event.target.value}`); });