This commit is contained in:
Haoming
2025-11-19 15:54:53 +08:00
parent 3811b37438
commit fbfb8c02f4
4 changed files with 14 additions and 15 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2024 Haoming
Copyright (c) 2025 Haoming
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+1 -4
View File
@@ -1,5 +1,2 @@
# ComfyUI Clear Screen
This is an Extension for [ComfyUI](https://github.com/comfyanonymous/ComfyUI), which adds a **CLS** button that clears the console window.
### But Why ?
Useful for benchmarking, extension developing, or when you just want to clear the console ~~after it craps out tons of errors~~.
This is an Extension for [ComfyUI](https://github.com/comfyanonymous/ComfyUI), which adds a button, **CLS**, that clears both Python console and Browser console.
+11 -9
View File
@@ -6,7 +6,10 @@ function legacy() {
const clsButton = document.createElement("button");
clsButton.textContent = "CLS";
clsButton.addEventListener("click", () => api.fetchApi("/utils/cls"));
clsButton.addEventListener("click", () => {
api.fetchApi("/utils/cls");
console.clear();
});
const clearButton = document.getElementById("comfy-clear-button");
menu.insertBefore(clsButton, clearButton);
@@ -16,27 +19,26 @@ async function frontend() {
const btn = new (await import("../../scripts/ui/components/button.js")).ComfyButton({
icon: "backspace-outline",
action: () => {
api.fetchApi("/utils/cls")
api.fetchApi("/utils/cls");
console.clear();
},
tooltip: "Clear Console",
content: "CLS",
classList: "comfyui-button comfyui-menu-mobile-collapse"
classList: "comfyui-button comfyui-menu-mobile-collapse",
}).element;
app.menu?.actionsGroup.element.after(btn);
app.menu.actionsGroup.element.after(btn);
}
app.registerExtension({
name: "Comfy.CLS",
name: "Comfy.ClearScreen",
async setup() {
try {
await frontend();
} catch {
// No Frontend?
// No Frontend
}
legacy();
}
},
});
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-clear-screen"
description = "Add a button that clears the console"
version = "1.1.0"
version = "1.2.0"
license = { text = "MIT License" }
dependencies = []