Stable Diffusion Webgpu
Stable Diffusion WebGPU is an AI tool that allows users to generate images using the create-react-app framework. It is a web-based application that requires JavaScript enabled and the latest version of Chrome with specific flags enabled. The application performs a series of inference steps to generate an image, with each step taking approximately 1 minute plus additional time for the VAE decoder. The UNET model responsible for image generation runs on the CPU for better performance and accuracy. The minimum recommended number of steps for acceptable results is 20, but for demonstration purposes, 3 steps are sufficient. The model files are cached to avoid repeated downloads. The application provides a user-friendly interface with options to load the model, run the image generation process, and view the result. An FAQ section is available for troubleshooting guidance. However, the webgpu implementation in onnxruntime is still in its early stage, causing incomplete operations and impacting performance due to continuous data transfer between the CPU and GPU. Multi-threading is not supported, and limitations in WebAssembly prevent the creation of 64-bit memory with SharedArrayBuffer. The developer plans to address these issues through proposed spec changes and engine patches. The source code for Stable Diffusion WebGPU is available on GitHub for local usage, and a patched version of onnxruntime is provided for the use of large language models with transformers.js, although its reliability in all scenarios is not guaranteed. The developer also plans to submit a pull request to the onnxruntime repository.
Stable Diffusion Webgpu Read More »








