mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-15 13:02:35 +08:00
Local_comfyui
This commit is contained in:
parent
8f148f97a3
commit
ab02df9c9e
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
cd /d "%~dp0"
|
||||
echo Starting ComfyUI...
|
||||
.venv\Scripts\python.exe main.py --auto-launch
|
||||
.venv\Scripts\python.exe main.py --auto-launch --disable-api-nodes
|
||||
pause
|
||||
|
||||
11
server.py
11
server.py
@ -944,9 +944,18 @@ class PromptServer():
|
||||
|
||||
return web.Response(status=200)
|
||||
|
||||
@routes.get("/stopped")
|
||||
async def get_stopped(request):
|
||||
stopped_html = os.path.join(self.local_web_root, "extensions", "comfyui_exit", "stopped.html")
|
||||
return web.FileResponse(stopped_html)
|
||||
|
||||
@routes.post("/shutdown")
|
||||
async def post_shutdown(request):
|
||||
os._exit(0)
|
||||
async def _exit():
|
||||
await asyncio.sleep(0.5)
|
||||
os._exit(0)
|
||||
asyncio.ensure_future(_exit())
|
||||
return web.Response(status=200)
|
||||
|
||||
@routes.post("/interrupt")
|
||||
async def post_interrupt(request):
|
||||
|
||||
2
web/extensions/comfyui_exit/exit_button.js
vendored
2
web/extensions/comfyui_exit/exit_button.js
vendored
@ -10,7 +10,7 @@ app.registerExtension({
|
||||
icon: "pi pi-power-off",
|
||||
function: async () => {
|
||||
if (confirm("Shut down ComfyUI?")) {
|
||||
await fetch("/shutdown", { method: "POST" }).catch(() => {});
|
||||
window.location.href = "/stopped";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
124
web/extensions/comfyui_exit/stopped.html
vendored
Normal file
124
web/extensions/comfyui_exit/stopped.html
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>ComfyUI — Stopped</title>
|
||||
<style>
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
background: #0d0d0d;
|
||||
color: #e0e0e0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #2e2e2e;
|
||||
border-radius: 12px;
|
||||
padding: 48px 56px;
|
||||
max-width: 440px;
|
||||
width: 90%;
|
||||
text-align: center;
|
||||
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin: 0 auto 24px;
|
||||
background: #2a1a1a;
|
||||
border: 1px solid #5a2a2a;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.icon svg {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
stroke: #c0392b;
|
||||
fill: none;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
color: #ffffff;
|
||||
margin-bottom: 10px;
|
||||
letter-spacing: -0.3px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 14px;
|
||||
color: #777;
|
||||
margin-bottom: 32px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.divider {
|
||||
height: 1px;
|
||||
background: #2e2e2e;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.instruction {
|
||||
font-size: 13px;
|
||||
color: #888;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.cmd {
|
||||
display: inline-block;
|
||||
background: #111;
|
||||
border: 1px solid #333;
|
||||
border-radius: 6px;
|
||||
padding: 10px 20px;
|
||||
font-family: "Cascadia Code", "Consolas", monospace;
|
||||
font-size: 14px;
|
||||
color: #7ec8e3;
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 32px;
|
||||
font-size: 12px;
|
||||
color: #444;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card">
|
||||
<div class="icon">
|
||||
<svg viewBox="0 0 24 24">
|
||||
<path d="M18.36 6.64A9 9 0 1 1 5.64 5.64"/>
|
||||
<line x1="12" y1="2" x2="12" y2="12"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<h1>ComfyUI has stopped</h1>
|
||||
<p class="subtitle">The server has shut down cleanly.<br/>To restart, run the launcher again.</p>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<p class="instruction">Run from your terminal or shortcut:</p>
|
||||
<span class="cmd">launch.bat</span>
|
||||
|
||||
<p class="footer">ComfyUI — Local AI Image Generation</p>
|
||||
</div>
|
||||
<script>
|
||||
fetch("/shutdown", { method: "POST" }).catch(() => {});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user