WebComfy Mobile: Zero-Leak Ephemeral-Worker Orchestration and Self-Healing Numerical Guards for In-Browser Mobile Diffusion DAGs
Multi-stage generative AI pipelines, such as ComfyUI-style workflows chaining a Small Language Model (SLM), CLIP text encoder, latent diffusion UNet, and VAE decoder, frequently fail inside mobile web browsers without native app installation. Unlike single-model in-browser LLM engines, heterogeneous Directed Acyclic Graph (DAG) pipelines suffer from four compounding systems failures on consumer smartphones: (1) linear GPU buffer retention across onnxruntime-web session.release() calls and non-shrinkable WebAssembly. Memory heaps; (2) the Vocab-Binding Wall, where mobile WebGPU's 128 MiB maxStorageBufferBindingSize rejects smaller-parameter SLMs with large vocabularies while accepting larger models with compact vocabularies; (3) silent driver-level 4-bit MatMulNBits numerical corruption on mobile Vulkan GPUs that is masked by final LayerNorm statistics; and (4) mobile WebKit Jetsam process termination on older iOS hardware. We present WebComfy Mobile, an open-source, zero-install browser DAG runtime and empirical research lab that orchestrates a 4-network generative pipeline (SLM -> OpenCLIP-ViT-H -> 1-step SDXS-512-0.9 UNet -> 9-tile raised-cosine TAESD) directly from Origin Private File System (OPFS) shards. WebComfy introduces Policy C, an ephemeral Dedicated Web Worker isolation strategy that reduces peak GPU memory by 60.1%-77.8% and eliminates inter-stage residual VRAM to 0.00 MiB on both desktop (NVIDIA RTX 2070 Max-Q) and real Android (Qualcomm Adreno-7xx Chrome 156 Vulkan) hardware with only +3.2% end-to-end latency overhead over naive shared-device execution on 4x32 MiB stages. To detect silent mobile GPU corruption, we introduce a prompt-invariant Causal-BOS Cosine Guard (O(1) 16-dimensional fingerprint achieving 0.0% false positives across 30 diverse prompts and 100.0% true positive detection against 1,000 LayerNorm-masked faults) coupled with per-stage ephemeral fallback. Together with 9-tile raised-cosine VAE decoding (-72.4% decode VRAM, 1.45x speedup, 36.06 dB PSNR, 0.9883 SSIM) and a mobile-safe (<=6 storage buffers) fused W4A16+LoRA WGSL kernel (1.68x desktop, 1.24x Adreno-7xx), WebComfy generates photorealistic 512x512 images on-device inside Android Chrome in 28.7 s at 167.37 MiB peak GPU memory and 0.00 MiB post-run residual.
Authors
- hobby-programmer-5000
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-30
- DOI
- https://doi.org/10.5281/zenodo.24690055
- Primary Topic
- Mobile and Web Applications
- Type
- preprint