feat(comfyuimini): add "Manage Photos" sidebar link to the Gallery
ComfyUIMini's built-in gallery is view-only. Inject a "Manage Photos" link into its sidebar (via the shared head.ejs partial at build time, so no fork) that points to the Model Manager's delete-capable Gallery. The URL is built client-side from the browser host; the port is baked from the MODEL_MANAGER_PORT build arg (default 8189). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -262,6 +262,9 @@ SparkyUI includes a **StabilityMatrix-style Model Manager** - a lightweight Fast
|
|||||||
Gallery. Append `?force=mobile` or `?force=desktop` to override. Bookmark `/start` as your
|
Gallery. Append `?force=mobile` or `?force=desktop` to override. Bookmark `/start` as your
|
||||||
single SparkyUI link.
|
single SparkyUI link.
|
||||||
|
|
||||||
|
ComfyUIMini also gets a **"Manage Photos"** link in its sidebar that jumps to this Gallery,
|
||||||
|
so you can delete generated photos from the mobile UI too (its built-in gallery is view-only).
|
||||||
|
|
||||||
**Build only the Model Manager** (if the rest is already built):
|
**Build only the Model Manager** (if the rest is already built):
|
||||||
```bash
|
```bash
|
||||||
docker compose build model-manager
|
docker compose build model-manager
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ RUN npm ci && \
|
|||||||
npm run build && \
|
npm run build && \
|
||||||
npm prune --omit=dev
|
npm prune --omit=dev
|
||||||
|
|
||||||
|
# SparkyUI: add a "Manage Photos" sidebar link to the Model Manager gallery.
|
||||||
|
# Appended to the head partial (included on every page) so we don't fork ComfyUIMini.
|
||||||
|
ARG MODEL_MANAGER_PORT=8189
|
||||||
|
COPY sparky-sidebar.html /tmp/sparky-sidebar.html
|
||||||
|
RUN sed "s/__MM_PORT__/${MODEL_MANAGER_PORT}/g" /tmp/sparky-sidebar.html \
|
||||||
|
>> src/server/views/partials/head.ejs
|
||||||
|
|
||||||
# Create config directory and default config
|
# Create config directory and default config
|
||||||
# Config is overridden at runtime via NODE_CONFIG env var
|
# Config is overridden at runtime via NODE_CONFIG env var
|
||||||
RUN mkdir -p config && \
|
RUN mkdir -p config && \
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<!-- SparkyUI: inject a "Manage Photos" link into the ComfyUIMini sidebar that
|
||||||
|
points to the Model Manager's delete-capable Gallery. The URL is built
|
||||||
|
client-side from the browser host so it works on any LAN address. The
|
||||||
|
__MM_PORT__ token is replaced with MODEL_MANAGER_PORT at build time. -->
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
var list = document.getElementById('sidebar-list');
|
||||||
|
if (!list || document.getElementById('sparky-gallery-link')) return;
|
||||||
|
var a = document.createElement('a');
|
||||||
|
a.id = 'sparky-gallery-link';
|
||||||
|
a.className = 'sidebar-list-item';
|
||||||
|
a.href = location.protocol + '//' + location.hostname + ':__MM_PORT__/?view=gallery';
|
||||||
|
a.innerHTML =
|
||||||
|
'<span class="icon gallery"></span>' +
|
||||||
|
'<span class="sidebar-list-item-text">Manage Photos</span>';
|
||||||
|
list.appendChild(a);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
@@ -95,6 +95,8 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
COMFYUIMINI_REF: "${COMFYUIMINI_REF:-main}"
|
COMFYUIMINI_REF: "${COMFYUIMINI_REF:-main}"
|
||||||
|
# Port of the Model Manager, baked into the "Manage Photos" sidebar link
|
||||||
|
MODEL_MANAGER_PORT: "${MODEL_MANAGER_PORT:-8189}"
|
||||||
|
|
||||||
image: comfyuimini:latest
|
image: comfyuimini:latest
|
||||||
container_name: comfyuimini
|
container_name: comfyuimini
|
||||||
|
|||||||
Reference in New Issue
Block a user