|
Download README.md from waveshaker/universal-lora-studio-gui: direct link, hf CLI and curl.
- Browser
- Download file 4.42 kB
-
https://huggingface.co/spaces/waveshaker/universal-lora-studio-gui/resolve/main/README.md
- Command line
-
hf download hf://spaces/waveshaker/universal-lora-studio-gui/README.md
-
curl -L -o README.md https://huggingface.co/spaces/waveshaker/universal-lora-studio-gui/resolve/main/README.md
4.42 kB
| title: π UNIVERSAL LORA STUDIO - GUI(TEST) | |
| emoji: π§ͺ | |
| colorFrom: gray | |
| colorTo: pink | |
| sdk: static | |
| pinned: false | |
| --- | |
| <div align="center"> | |
| <h1>β‘ Universal LoRA Studio - GUI Client</h1> | |
| <p><i>A lightning-fast native UI that performs secure ZeroGPU token handshakes, polls backend generation metrics in real-time, and renders character galleries with physical spring animations.</i></p> | |
| </div> | |
| --- | |
| ### βοΈ System Architecture | |
| This Space is a 100% native, lightweight Static Web UI (HTML/CSS/JS) designed to serve as the frontend for the [**π¨Universal Model Character LoRA Studio**](https://huggingface.co/spaces/waveshaker/universal-lora-studio) backend. To overcome Hugging Face's cross-space CORS restrictions and manage ZeroGPU billing securely, it utilizes a highly decoupled "Proxy-Driven" architecture. | |
| #### ποΈ System Topology (Frontend Perspective) | |
| | Layer | Core Components | Role & Responsibility | | |
| | :--- | :--- | :--- | | |
| | **π₯οΈ UI Client**<br/>(This Space) | β’ **Native HTML/JS**<br/>β’ **Physics Animations**<br/>β’ **State Locks** | Renders the gallery, handles smooth spring animations, and manages the complex UI state without heavy frameworks. | | |
| | **π Auth & Token**<br/>(Browser Window) | β’ **MessageChannel**<br/>β’ **Timeout Fallback** | Communicates securely with the HF parent window to extract the `x-ip-token` for ZeroGPU billing. | | |
| | **π API Interface**<br/>(Cross-Origin) | β’ **Fetch / REST**<br/>β’ **100ms Polling**<br/>β’ **Error Handling** | Submits payloads to the remote backend, intercepts real-time JSON logs, and gracefully handles backend wake-up delays. | | |
| | **πΌοΈ Media Pipeline**<br/>(Client Side) | β’ **WebP Render**<br/>β’ **Cache Busting**<br/>β’ **EXIF Metadata** | Fetches the final physical image URL, handles cache-busting query params, and displays the generated result. | | |
| #### π Request Lifecycle | |
| ```text | |
| [User] ββ(Access via Browser)βββΊ [This Native Studio UI] | |
| β | |
| βββΊ 1. Handshake with HF Parent (Extract x-ip-token) | |
| β | |
| βΌ | |
| [Submit POST /api/generate] | |
| βββ Validate Dimensions (Frontend) | |
| βββ Attach Token | |
| βββ Handle UI Loading States | |
| β | |
| βΌ | |
| [Poll GET /api/status/{id}] | |
| βββ Parse real-time logs & metrics | |
| βββ Animate progress via requestAnimationFrame | |
| βββ Render final WebP image | |
| ``` | |
| #### π One-Sentence Summary | |
| > A lightning-fast native UI that performs secure ZeroGPU token handshakes, polls backend generation metrics in real-time, and renders character galleries with physical spring animations. | |
| --- | |
| ### π οΈ Key Frontend Features | |
| Building the UI from scratch with native JS allowed us to bypass the heavy overhead of frameworks (like React or Vue) and integrate directly with the ZeroGPU lifecycle. | |
| - **π Seamless ZeroGPU Auth**: Implements a `MessageChannel` handshake with the HF parent window to securely extract the `x-ip-token`. Includes a 2-second timeout fallback and a dynamic warning toast for anonymous quota users. | |
| - **β‘ Real-Time Log Interceptor**: Features a highly optimized polling mechanism (100ms interval) that parses raw JSON metrics from the ComfyUI backend, categorizes them into pipeline stages (Queueing, Model Loading, Sampling), and prints them with animated typewriter effects. | |
| - **πͺ Physics-Based Animations**: The character gallery features custom spring animations (`stiffness: 280`, `damping: 0.7`) calculated via `requestAnimationFrame`. No CSS keyframes, no external librariesβpure, buttery-smooth 60fps rendering. | |
| - **π‘οΈ State & Concurrency Locks**: Employs an `isGalleryFetching` mutex and intelligent DOM diffing (Smart Scroll & Debounce) to prevent UI flickering and API spam during rapid architecture switches (e.g., MOSS β FLUX). | |
| --- | |
| ### π Ecosystem Links | |
| - πΌοΈ **[Browse the LoRA Gallery](https://huggingface.co/spaces/waveshaker/loras_gallery)** - Explore 1000+ community characters. | |
| - π **[Dataset](https://huggingface.co/datasets/waveshaker/dataset_collections)** | |
| <div align="center"> | |
| <sub>Engineered by <b>waveshaker</b>. </sub> | |
| </div> |