Stable Diffusion Webgpu
Web images generated with Stable Diffusion
About Stable Diffusion Webgpu
The Enigmatic WebGPU Experience is an innovative web-based application that unleashes users' creativity through the create-react-app framework. To immerse in this experience, users must have JavaScript enabled and utilize the latest version of Chrome, with the "Experimental WebAssembly" and "Experimental WebAssembly JavaScript Promise Integration (JSPI)" flags activated. This captivating application undergoes a sequence of inference steps to craft a mesmerizing image. Each step consumes roughly 1 minute, with an additional 10 seconds for the VAE decoder to weave its magic and bring the image to life. It is essential to note that having the DevTools open can slightly hinder the process, extending the duration by approximately 2 times. The UNET model, the creative force behind image generation, exclusively operates on the CPU to ensure optimal performance and precise outcomes, surpassing the capabilities of the GPU. For optimal results, it is recommended to embark on a minimum of 20 steps; however, a mere 3 steps suffice for a captivating demonstration of the application's prowess. The model files are intelligently cached, eliminating the need for repetitive downloads. The user-friendly interface offers seamless navigation, allowing users to load the model, initiate the image generation process, and behold the enchanting result. For any specific queries or concerns, an informative FAQ section is readily available to provide troubleshooting assistance. While the webgpu implementation in onnxruntime is still evolving, certain operations may remain incomplete, leading to continuous data transfers between the CPU and GPU, affecting overall performance. At present, multi-threading is not supported, and constraints within WebAssembly hinder the creation of 64-bit memory using SharedArrayBuffer. The visionary developer is committed to resolving these challenges through proposed spec alterations and engine enhancements. The source code for The Enigmatic WebGPU Experience is accessible on GitHub, enabling users to run it locally and delve deeper into its mesmerizing features. Furthermore, an enhanced version of onnxruntime is provided, enabling seamless integration with large language models using transformers.js, although its reliability across all scenarios is not absolute. The developer is also poised to submit a pull request to the onnxruntime repository, further enhancing the application's capabilities and ensuring a seamless user experience.