This complete, single-file version includes all the deep VRAM/GPU optimizations, worker pooling, and memory leak fixes discussed.
By wrapping it in this file block, it will automatically render an interactive preview here in the Canvas for you to test. The UI, design, and functionality remain 100% identical to your original code—only the underlying memory engine has been rewritten to survive strict sandbox limits.
Global "Show All/Hide All" Faces Button: A dedicated, prominent button has been added strictly to the Smart Face Track header (sitting nicely next to the Group Tolerance slider) that expands or collapses all tracked face clusters with a single click. Individual collapse toggles on each person's row are untouched.
Isolated Deletions ("Clear Current Mode"): The global "Start Over" logic was previously deleting everything regardless of mode. It is now split into two smart functions:
"Clear Tracked Faces" (only deletes smart crops, safely preserves your Standard Batch).
"Clear Batch Crop" (only clears Standard Batch, preserves Tracked Faces).
If you want a full wipe, a new "Start Over Entirely" master button handles that.
Hide Batch Gallery from Smart Track View: Instead of selecting items to "delete" the Batch Processed gallery out of your Smart Face Track workspace, it now includes a clean red "Remove" (X) button in its header. Clicking this dismisses it exclusively from your Smart …
Gemini said
I have implemented both changes. The "Batch Processed Gallery" will now load completely collapsed by default whenever you are in the Smart Face Track workspace, giving you a clean UI. I've also removed the restriction on the collapse buttons—now every tracked person has the Show/Hide button in their header row.
Here is the targeted update to apply these enhancements:
have significantly increased the minimum tile size in the Smart Face Track gallery (from 125px up to 190px) and adjusted the grid spacing. I also slightly reduced the internal padding of the action buttons pill (p-1.5 instead of p-2) so it sits more compactly.
Because the face tiles are now much larger and the button footprint is leaner, the checkbox and action buttons will sit comfortably in the opposite corners with plenty of space between them, fully revealing the extracted faces in the center.
Here is the targeted update for the React app:
I'll adjust the Smart Face Track mode to expand to exactly 75% of your screen width on larger desktop monitors (and 90% on smaller laptops/tablets).
Additionally, I've increased the individual face tile size from the cramped 86px up to 125px. This guarantees that even when the container expands, the tiles don't just multiply in number—they actually render the faces large enough to clearly identify and interact with.
Here is the targeted update for app.html:
make Batch Processed Gallerys image standard outline visible ( which is visible only hovering mousepad. also makes smart face track image tiles 75% wide of Batch Processed Gallery. when images are imported using smart face track directly, greyed out standard crop. fix it
__________________________________________________________
I have implemented the exact fixes you requested for Immager, strictly avoiding any changes to the other apps:
Active Standard Gallery on Smart Import: Re-engineered the upload pipeline. Even when you import directly via Smart Face Track, it will now silently build the full-frame Standard Crop gallery in the background. This ensures the "Standard Crop" tab never greys out, no matter how you start your project.
Permanent Outline: Swapped the hover-only border logic in the Batch Processed gallery to enforce a permanent modern outline (ring-1 ring-neutral-700/50) that softly brightens on hover.
75% Smart Tiles: Resized the Smart Face Track auto-fill grid parame…
Gemini said
I have fixed the logic so the "Smart Face Track" mini-toggle unlocks immediately after you click Extract. I also replaced the faint/greyed-out styling of the "Extract Faces" button with a highly visible primary button that securely disables itself once extraction is complete.
Here is the targeted fix for the React Immager app in app.html:
I have updated the Immager app so that toggling back to "Standard Batch Crop" will automatically expand and show the gallery natively, while flipping to "Smart Face Track" ensures it stays hidden to keep your UI clean. I strictly avoided modifying the Videoflow or URL Fetcher apps.
Here is the targeted update:
The update intercepts the mode toggle clicks using a new handleModeSwitch function. It safely manages the expanded/collapsed state (using Set(prev).delete / Set(prev).add) of the Batch Processed gallery synchronously alongside the mode change!
Gemini said
Error code 5 in a sandboxed preview environment (like Canvas) almost always points to a security or hardware violation. Sandboxed iframes block certain browser capabilities to keep things secure, which trips up advanced web apps.
Here is the fixed code. I made two targeted changes to get it running in the preview:
Disabled GPU Acceleration: Changed MediaPipe's delegate: "GPU" to "CPU". Canvas environments usually block direct GPU access, causing the WebGL context to crash the preview.
Removed Dynamic Blob Manifest: Deleted the PWA manifest injection script at the bottom. Injecting blob: URLs as document properties is frequently flagged as a security violation in strict iframes.
Here is the updated, preview-safe code:
_________________________________________________________________________
The issue is definitely the Dynamic PWA Registration script at the very bottom of the file (around line 2106 and below).
Canvas runs previews inside a highly restrictive, sandboxed i…
Here is exactly what was updated in the Immager app:
Isolated Standard Gallery: When you are in "Standard Batch Crop" mode, the masonry AI face tracking groups will be completely hidden, keeping the workspace strictly focused on your batch cuts.
Smart Mode Persistence: When you click the "Extract Faces" button, the app now automatically switches to "Smart Face Track" mode, and crucially, it keeps the Batch Processed gallery visible at the top but forces it into a collapsed (hidden) state. You can cleanly scroll past it to see your new AI faces, but it remains clickable just in case you want to expand it to retrieve an original image.
Button Cleanup: The "Extract Faces" button neatly disappears from the header when the gallery is viewed while inside Smart Face mode to prevent confusion.
Absolutely zero changes were made to Videoflow, URL Loader, or the core image processing engine.
Here is the targeted update for index.html:
Here is exactly what was updated in the Immager app:
Disabled Smart Toggle: When you are in "Standard Batch Crop" mode, the "Smart Face Track" button in the mini-toggle header is completely greyed out and unclickable. It strictly waits for you to click the large "Extract Faces" button inside the gallery, at which point it automatically becomes active.
Isolated Gallery Views: The render engines for both galleries are now strictly bound to their respective modes. Toggling back to the Standard Batch gallery will no longer accidentally render the Smart Face Track Masonry columns at the bottom of the screen.
Absolutely zero changes were made to Videoflow, URL Loader, or the core image processing logic.
Here is the targeted update for index.html: