Compare commits

...
Author SHA1 Message Date
Hu Xiuhan a00828fe81 Add user-friendly solution link to README
Added a note about neta.art as a user-friendly solution.
2026-08-09 12:03:58 +08:00
Hu Xiuhan 95fd55d663 Merge pull request #66 from willybcode/main
Addition of both menu buttons to the new ui
2024-11-11 09:42:29 +08:00
willy 989c21205f feat: added buttons to new ui
- added "Browser" button as 📚
- added save button as 💾
2024-11-07 12:06:34 +00:00
南辰燏炚 dbf7e780ad Merge pull request #65 from talesofai/update/load_img_from_url
update LoadImageByUrl
2024-11-04 15:55:37 +08:00
2 changed files with 77 additions and 1 deletions
+2
View File
@@ -1,5 +1,7 @@
# ComfyUI Browser
### For user-friendly agentic solution, please try [neta.art](https://neta.art) from the team :)
[中文说明](README_CN.md)
This is an image/video/workflow browser and manager for ComfyUI.
+75 -1
View File
@@ -224,7 +224,13 @@ app.registerExtension({
event.preventDefault();
}
});
// add event listener for ctrl+i
document.addEventListener('keydown', (event) => {
if (event.ctrlKey && event.key === 'i') {
browserDialog.toggle();
event.preventDefault();
}
})
app.ui.menuContainer.appendChild(
$el("div.comfy-list", {
style: {
@@ -295,5 +301,73 @@ app.registerExtension({
}),
])
);
try{
// new menu based features
// browser and save to collection button into new style menu
let cbGroup = new (await import("../../scripts/ui/components/buttonGroup.js")).ComfyButtonGroup(
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
action: () => {
if(browserDialog)
browserDialog.show();
},
tooltip: "Browse and manage your outputs and collections",
content: "📚",
// content: "🪟",
// content: "Browser",
// icon: "table",// cloud, folder, folder-open, table, database, server
// classList: "comfyui-button comfyui-menu-mobile-collapse primary"
classList: "comfyui-button comfyui-menu-mobile-collapse "
}).element,
new(await import("../../scripts/ui/components/button.js")).ComfyButton({
action: (e) => {
const saveBtn = e.target;
const originBtnStyle = saveBtn.style.cssText;
let filename = "workflow.json";
const promptFilename = app.ui.settings.getSettingValue(
"Comfy.PromptFilename",
true,
);
if (promptFilename) {
filename = prompt("Collect workflow as:", filename);
if (!filename) return;
if (!filename.toLowerCase().endsWith(".json")) {
filename += ".json";
}
}
app.graphToPrompt().then(async p => {
const json = JSON.stringify(p.workflow, null, 2); // convert the data to a JSON string
const res = await api.fetchApi("/browser/collections/workflows", {
method: "POST",
body: JSON.stringify({
filename: filename,
content: json,
}),
});
if (res.ok) {
saveBtn.style = originBtnStyle + "border-color: green;";
showToast(
'Saved. Click me to open.',
() => { browserDialog.show() },
);
} else {
saveBtn.style = originBtnStyle + "border-color: red;";
}
setTimeout(() => {
saveBtn.style = originBtnStyle;
}, 1000);
});
},
tooltip: "Save workflow to collections",
content: "💾",
classList: "comfyui-button comfyui-menu-mobile-collapse "
}).element
);
app.menu?.settingsGroup.element.before(cbGroup.element);
}catch(exception){
console.log('ComfyUI-Browser could not load new menu based features.');
}
},
});