399acabd58
ComfyUI caches the last model when RAM is plentiful (unified memory), so memory doesn't drop after switching models even though models are being swapped, not accumulated. Add a sidebar "Free GPU memory" button that proxies ComfyUI's POST /free (unload_models + free_memory) via a new /api/comfyui/free endpoint (COMFYUI_URL env). Verified it releases ~7GB. README documents this plus the --disable-smart-memory auto-unload option. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
301 lines
12 KiB
CSS
301 lines
12 KiB
CSS
:root {
|
|
--bg: #14161c;
|
|
--bg-2: #1b1e27;
|
|
--bg-3: #232735;
|
|
--border: #2c3142;
|
|
--text: #e6e8ee;
|
|
--text-dim: #99a0b3;
|
|
--accent: #6c8cff;
|
|
--accent-2: #8a6cff;
|
|
--green: #36c98b;
|
|
--red: #ef5d6b;
|
|
--amber: #f0b400;
|
|
--radius: 10px;
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
html, body {
|
|
margin: 0;
|
|
height: 100%;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.app { display: flex; height: 100vh; }
|
|
|
|
/* ---- sidebar ---- */
|
|
.sidebar {
|
|
width: 240px;
|
|
flex-shrink: 0;
|
|
background: var(--bg-2);
|
|
border-right: 1px solid var(--border);
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 18px 14px;
|
|
}
|
|
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 22px; }
|
|
.brand .spark { font-size: 26px; }
|
|
.brand-title { font-weight: 700; font-size: 16px; }
|
|
.brand-sub { color: var(--text-dim); font-size: 12px; }
|
|
|
|
nav { display: flex; flex-direction: column; gap: 4px; }
|
|
.nav-item {
|
|
display: flex; align-items: center; gap: 10px;
|
|
background: transparent; color: var(--text-dim);
|
|
border: none; border-radius: 8px;
|
|
padding: 10px 12px; font-size: 14px; text-align: left;
|
|
cursor: pointer; transition: background .12s, color .12s;
|
|
}
|
|
.nav-item:hover { background: var(--bg-3); color: var(--text); }
|
|
.nav-item.active {
|
|
background: linear-gradient(90deg, rgba(108,140,255,.18), rgba(138,108,255,.12));
|
|
color: var(--text);
|
|
}
|
|
.nav-ico { width: 18px; text-align: center; opacity: .85; }
|
|
.sidebar-foot {
|
|
margin-top: auto; color: var(--text-dim); font-size: 11px;
|
|
word-break: break-all; padding: 8px 6px 0;
|
|
display: flex; flex-direction: column; gap: 6px;
|
|
}
|
|
.sidebar-foot .btn { width: 100%; font-size: 13px; }
|
|
.sidebar-foot .form-msg { font-size: 11px; text-align: center; }
|
|
|
|
/* ---- content ---- */
|
|
.content { flex: 1; overflow-y: auto; padding: 26px 32px; }
|
|
.view { display: none; }
|
|
.view.active { display: block; }
|
|
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
|
|
.view-head h1 { font-size: 22px; margin: 0; }
|
|
.head-actions { display: flex; gap: 10px; }
|
|
.subhead { font-size: 15px; color: var(--text-dim); margin: 28px 0 12px; }
|
|
.subhead.first { margin-top: 0; }
|
|
|
|
/* ---- inputs/buttons ---- */
|
|
input, select {
|
|
background: var(--bg-3); color: var(--text);
|
|
border: 1px solid var(--border); border-radius: 8px;
|
|
padding: 9px 11px; font-size: 14px; width: 100%;
|
|
}
|
|
input:focus, select:focus { outline: none; border-color: var(--accent); }
|
|
input[type=search] { width: 200px; }
|
|
label { display: block; margin: 14px 0 6px; color: var(--text-dim); font-size: 13px; }
|
|
|
|
.btn {
|
|
background: var(--bg-3); color: var(--text);
|
|
border: 1px solid var(--border); border-radius: 8px;
|
|
padding: 9px 16px; font-size: 14px; cursor: pointer;
|
|
transition: background .12s, border-color .12s;
|
|
}
|
|
.btn:hover { background: #2a3042; }
|
|
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0c1020; font-weight: 600; }
|
|
.btn.primary:hover { background: #5b7dff; }
|
|
.btn.danger { color: var(--red); border-color: transparent; background: transparent; padding: 6px 10px; }
|
|
.btn.danger:hover { background: rgba(239,93,107,.12); }
|
|
.btn:disabled { opacity: .5; cursor: not-allowed; }
|
|
|
|
/* ---- cards ---- */
|
|
.card {
|
|
background: var(--bg-2); border: 1px solid var(--border);
|
|
border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
|
|
}
|
|
.form-card { max-width: 720px; }
|
|
.row { display: flex; gap: 18px; }
|
|
.col { flex: 1; }
|
|
.hint { color: var(--text-dim); font-size: 12px; margin-top: 6px; }
|
|
.source-hint { font-size: 12px; margin-top: 8px; min-height: 16px; color: var(--accent); }
|
|
.form-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
|
|
.form-msg { font-size: 13px; }
|
|
.form-msg.ok { color: var(--green); }
|
|
.form-msg.err { color: var(--red); }
|
|
.badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; margin-left: 6px; }
|
|
.badge.set { background: rgba(54,201,139,.18); color: var(--green); }
|
|
.badge.unset { background: var(--bg-3); color: var(--text-dim); }
|
|
code { background: var(--bg-3); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
|
|
|
|
/* ---- installed models ---- */
|
|
.models-container { display: flex; flex-direction: column; gap: 22px; }
|
|
.type-group h3 {
|
|
font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
|
|
color: var(--text-dim); margin: 0 0 10px; font-weight: 600;
|
|
}
|
|
.model-grid {
|
|
display: grid; gap: 12px;
|
|
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
}
|
|
.model-card {
|
|
background: var(--bg-2); border: 1px solid var(--border);
|
|
border-radius: var(--radius); padding: 14px;
|
|
display: flex; flex-direction: column; gap: 6px;
|
|
}
|
|
.model-card .name { font-weight: 600; word-break: break-all; }
|
|
.model-card .meta { color: var(--text-dim); font-size: 12px; }
|
|
.model-card .card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
|
|
.empty { color: var(--text-dim); }
|
|
|
|
/* ---- gallery (generated photos) ---- */
|
|
.gallery-grid {
|
|
display: grid; gap: 12px;
|
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
}
|
|
.photo-card {
|
|
position: relative; background: var(--bg-2);
|
|
border: 1px solid var(--border); border-radius: var(--radius);
|
|
overflow: hidden; cursor: pointer; aspect-ratio: 1 / 1;
|
|
}
|
|
.photo-card img {
|
|
width: 100%; height: 100%; object-fit: cover; display: block;
|
|
transition: transform .2s;
|
|
}
|
|
.photo-card:hover img { transform: scale(1.04); }
|
|
.photo-card .p-del {
|
|
position: absolute; top: 6px; right: 6px;
|
|
background: rgba(12,16,32,.7); color: #fff; border: none;
|
|
width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
|
|
font-size: 14px; opacity: 0; transition: opacity .15s;
|
|
}
|
|
.photo-card:hover .p-del { opacity: 1; }
|
|
.photo-card .p-del:hover { background: var(--red); }
|
|
.photo-card .p-meta {
|
|
position: absolute; bottom: 0; left: 0; right: 0;
|
|
background: linear-gradient(transparent, rgba(12,16,32,.85));
|
|
color: var(--text); font-size: 11px; padding: 16px 8px 6px;
|
|
opacity: 0; transition: opacity .15s; word-break: break-all;
|
|
}
|
|
.photo-card:hover .p-meta { opacity: 1; }
|
|
|
|
/* Single column on phones (the device-routing landing normally sends phones to
|
|
ComfyUIMini, but keep the gallery usable if opened directly on mobile). */
|
|
@media (max-width: 720px) {
|
|
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
|
|
.sidebar { width: 64px; }
|
|
.brand-title, .brand-sub, .nav-item { font-size: 0; }
|
|
.nav-ico { font-size: 18px; }
|
|
}
|
|
|
|
/* ---- confirm modal ---- */
|
|
.modal-overlay {
|
|
position: fixed; inset: 0; z-index: 200;
|
|
background: rgba(8,10,16,.7);
|
|
display: flex; align-items: center; justify-content: center; padding: 24px;
|
|
}
|
|
.modal-overlay[hidden] { display: none; }
|
|
.modal {
|
|
background: var(--bg-2); border: 1px solid var(--border);
|
|
border-radius: var(--radius); padding: 22px; max-width: 420px; width: 100%;
|
|
box-shadow: 0 12px 40px rgba(0,0,0,.5);
|
|
}
|
|
.modal p { margin: 0 0 20px; font-size: 15px; line-height: 1.45; word-break: break-word; }
|
|
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
|
|
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
|
|
.btn.danger-solid:hover { background: #e0414f; }
|
|
|
|
/* ---- lightbox ---- */
|
|
.lightbox {
|
|
position: fixed; inset: 0; z-index: 100;
|
|
background: rgba(8,10,16,.92);
|
|
display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
padding: 28px;
|
|
}
|
|
.lightbox[hidden] { display: none; }
|
|
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; object-fit: contain; }
|
|
.lb-close {
|
|
position: absolute; top: 18px; right: 22px;
|
|
background: transparent; color: #fff; border: none; font-size: 26px; cursor: pointer;
|
|
}
|
|
.lb-bar {
|
|
display: flex; align-items: center; gap: 16px; margin-top: 16px;
|
|
max-width: 92vw;
|
|
}
|
|
.lb-name { color: var(--text-dim); font-size: 13px; word-break: break-all; }
|
|
.lb-actions { display: flex; gap: 10px; margin-left: auto; }
|
|
|
|
/* ---- browse civitai ---- */
|
|
.browse-controls {
|
|
display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
.browse-controls input[type=search] { width: 280px; flex: 1; min-width: 200px; }
|
|
.browse-controls select { width: auto; }
|
|
.check { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text); white-space: nowrap; }
|
|
.check input { width: auto; }
|
|
|
|
/* multi-select dropdown (base model) */
|
|
.multi-dd { position: relative; }
|
|
.multi-btn { white-space: nowrap; }
|
|
.multi-panel {
|
|
position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
|
|
background: var(--bg-2); border: 1px solid var(--border);
|
|
border-radius: 8px; padding: 8px; min-width: 200px;
|
|
max-height: 320px; overflow-y: auto;
|
|
display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px;
|
|
box-shadow: 0 10px 30px rgba(0,0,0,.45);
|
|
}
|
|
.multi-panel[hidden] { display: none; }
|
|
.multi-panel-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 2px; }
|
|
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 2px 4px; }
|
|
.multi-opt {
|
|
display: flex; align-items: center; gap: 6px; margin: 0;
|
|
color: var(--text); font-size: 13px; padding: 4px 6px; border-radius: 6px; cursor: pointer;
|
|
}
|
|
.multi-opt:hover { background: var(--bg-3); }
|
|
.multi-opt input { width: auto; }
|
|
|
|
.browse-grid {
|
|
display: grid; gap: 14px;
|
|
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
|
|
}
|
|
.browse-card {
|
|
background: var(--bg-2); border: 1px solid var(--border);
|
|
border-radius: var(--radius); overflow: hidden;
|
|
display: flex; flex-direction: column;
|
|
}
|
|
.browse-card .thumb {
|
|
aspect-ratio: 3 / 4; background: var(--bg-3) center/cover no-repeat;
|
|
position: relative;
|
|
}
|
|
.browse-card .thumb .type-tag {
|
|
position: absolute; top: 8px; left: 8px;
|
|
background: rgba(12,16,32,.78); color: var(--text);
|
|
font-size: 11px; padding: 2px 8px; border-radius: 8px;
|
|
}
|
|
.browse-card .thumb .nsfw-tag {
|
|
position: absolute; top: 8px; right: 8px;
|
|
background: rgba(239,93,107,.85); color: #fff;
|
|
font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 600;
|
|
}
|
|
.browse-card .thumb .ea-tag {
|
|
position: absolute; bottom: 8px; left: 8px;
|
|
background: rgba(240,180,0,.92); color: #1a1400;
|
|
font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 700;
|
|
}
|
|
.browse-card .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
|
|
.browse-card .b-name { font-weight: 600; font-size: 13px; line-height: 1.25;
|
|
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
.browse-card .b-meta { color: var(--text-dim); font-size: 11px; }
|
|
.browse-card .b-foot { margin-top: auto; display: flex; gap: 6px; align-items: center; }
|
|
.browse-card select { font-size: 12px; padding: 5px 6px; }
|
|
.browse-card .btn { padding: 6px 12px; font-size: 12px; flex: 1; }
|
|
.browse-more { display: flex; justify-content: center; margin: 22px 0; }
|
|
|
|
/* ---- downloads ---- */
|
|
.downloads-container { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
|
|
.dl-row {
|
|
background: var(--bg-2); border: 1px solid var(--border);
|
|
border-radius: var(--radius); padding: 12px 14px;
|
|
}
|
|
.dl-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
|
|
.dl-name { font-weight: 600; word-break: break-all; }
|
|
.dl-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
|
|
.dl-status { font-size: 12px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
|
|
.dl-status.downloading { background: rgba(108,140,255,.18); color: var(--accent); }
|
|
.dl-status.completed { background: rgba(54,201,139,.18); color: var(--green); }
|
|
.dl-status.failed { background: rgba(239,93,107,.18); color: var(--red); }
|
|
.dl-status.canceled { background: var(--bg-3); color: var(--text-dim); }
|
|
.dl-status.queued { background: rgba(240,180,0,.16); color: var(--amber); }
|
|
.progress { height: 6px; background: var(--bg-3); border-radius: 4px; margin-top: 10px; overflow: hidden; }
|
|
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width .3s; }
|
|
.dl-actions { display: flex; align-items: center; gap: 8px; }
|