chore: refresh models when getting object_info

This is a WIP that will be used to refresh the models when execution comfyUI without having to stop the server and start a new one
This commit is contained in:
Emmanuel Morales 2025-01-19 17:26:41 -06:00 committed by GitHub
parent ce3b0dbe84
commit 67f25b2353
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1999,6 +1999,25 @@ api.fetchApi = async (route, options) => {
}
}
if (route.startsWith("/object_info") && ext.native_mode) {
const info = await getSelectedWorkflowInfo();
console.log("info, ", info);
if (info) {
const data = {
refresh_private: true,
refresh_public: true
}
await fetch("/comfyui-deploy/refresh-models", {
method: "POST",
headers: {
Authorization: `Bearer ${info.cd_token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
}
}
return await orginal_fetch_api.call(api, route, options);
};
@ -2157,4 +2176,4 @@ function createMenuRightButton(config) {
}
button.setAttribute('data-pd-tooltip', config.tooltip)
return button
}
}