Package: onnx-web
onnx-webonnx-web is a tool for running Stable Diffusion and otherONNX modelswith hardware acceleration,
on both AMD and Nvidia GPUs and with a CPU software fallback.The GUI ishosted on Github Pagesand runs in all major browsers, including on
mobile devices. It allows you to select the model and accelerator being used for each image pipeline. Image parameters
are shown for each of the major modes, and you can either upload or paint the mask for inpainting and outpainting. The
last few output images are shown below the image controls, making it easy to refer back to previous parameters or save
an image from earlier.The API runs on both Linux and Windows and provides a REST API to run many of the pipelines fromdiffusers, along with metadata about the available models and accelerators,
and the output of previous runs. Hardware acceleration is supported on both AMD and Nvidia for both Linux and Windows,
with a CPU fallback capable of running on laptop-class machines.Please check outthe setup guide to get startedandthe user guide for more
details.FeaturesThis is an incomplete list of new and interesting features, with links to the user guide:supports SDXL and SDXL Turbowide variety of schedulers: DDIM, DEIS, DPM SDE, Euler Ancestral, LCM, UniPC, and morehardware acceleration on both AMD and Nvidiatested on CUDA, DirectML, and ROCmhalf-precision support for low-memory GPUson both
AMD and Nvidiasoftware fallback for CPU-only systemsweb app to generate and view imageshosted on Github Pages, from your CDN, or locallypersists your recent images and progress as you change tabsqueue up multiple images and retry errorstranslations available for English, French, German, and Spanish (please open an issue for more)supports manydiffuserspipelinestxt2imgimg2imginpainting, with mask drawing and uploadpanorama, for both SD v1.5 and SDXLupscaling, with ONNX accelerationadd and use your own modelsconvert models from diffusers and SD checkpointsdownload models from HuggingFace hub, Civitai, and HTTPS sourcesblend in additional networkspermanent and prompt-based blendingsupports LoRA and LyCORIS weightssupports Textual Inversion concepts and embeddingseach layer of the embeddings can be controlled and used individuallyControlNetimage filters for edge detection and other methodswith ONNX accelerationhighres moderuns img2img on the results of the other pipelinesmultiple iterations can produce 8k images and largermulti-stageandregion promptsseamlessly combine multiple prompts in the same imageprovide prompts for different areas in the image and blend them togetherchange the prompt for highres mode and refine details without recursioninfinite prompt lengthwith long prompt weightingimage blending modecombine images from historyupscaling and correctionupscaling with Real ESRGAN, SwinIR, and Stable Diffusionface correction with CodeFormer and GFPGANAPI server can be run remotelyREST API can be served over HTTPS or HTTPbackground processing for all image pipelinespolling for image status, plays nice with load balancersOCI containers providedfor all supported hardware acceleratorsincludes both the API and GUI bundle in a single containerruns well onRunPod,Vast.ai, and other GPU container hosting servicesContentsonnx-webFeaturesContentsSetupAdding your own modelsUsageKnown errors and solutionsRunning the containersCreditsSetupThere are a few ways to run onnx-web:cross-platform:clone this repository, create a virtual environment, and runpip installpulling and running the OCI containerson Windows:clone this repository and run one of thesetup-*.batscriptsdownload and run the experimental all-in-one bundleYou only need to run the server and should not need to compile anything. The client GUI is hosted on Github Pages and
is included with the Windows all-in-one bundle.The extended setup docs have beenmoved to the setup guide.Adding your own modelsYou canadd your own modelsby downloading them from the HuggingFace Hub
or Civitai or by converting them from local files, without making any code changes. You can also download and blend in
additional networks, such as LoRAs and Textual Inversions, usingtokens in the
prompt.UsageKnown errors and solutionsPlease seethe Known Errors section of the user guide.Running the containersThis hasbeen moved to the server admin guide.CreditsSome of the conversion and pipeline code was copied or derived from code in:Amblyopius/Stable-Diffusion-ONNX-FP16GPL v3:https://github.com/Amblyopius/Stable-Diffusion-ONNX-FP16/blob/main/LICENSEhttps://github.com/Amblyopius/Stable-Diffusion-ONNX-FP16/blob/main/pipeline_onnx_stable_diffusion_controlnet.pyhttps://github.com/Amblyopius/Stable-Diffusion-ONNX-FP16/blob/main/pipeline_onnx_stable_diffusion_instruct_pix2pix.pyd8ahazard/sd_dreambooth_extensionNon-commerical license:https://github.com/d8ahazard/sd_dreambooth_extension/blob/main/license.mdhttps://github.com/d8ahazard/sd_dreambooth_extension/blob/main/dreambooth/sd_to_diff.pyhuggingface/diffusersApache v2:https://github.com/huggingface/diffusers/blob/main/LICENSEhttps://github.com/huggingface/diffusers/blob/main/scripts/convert_stable_diffusion_checkpoint_to_onnx.pyuchuusen/onnx_stable_diffusion_controlnetGPL v3:https://github.com/uchuusen/onnx_stable_diffusion_controlnet/blob/main/LICENSEuchuusen/pipeline_onnx_stable_diffusion_instruct_pix2pixApache v2:https://github.com/uchuusen/pipeline_onnx_stable_diffusion_instruct_pix2pix/blob/main/LICENSEThose parts have their own licenses with additional restrictions on commercial usage, modification, and redistribution.
The rest of the project is provided under the MIT license, and I am working to isolate these components into a library.There are many other good options for using Stable Diffusion with hardware acceleration, including:https://github.com/Amblyopius/AMD-Stable-Diffusion-ONNX-FP16https://github.com/azuritecoin/OnnxDiffusersUIhttps://github.com/ForserX/StableDiffusionUIhttps://github.com/pingzing/stable-diffusion-playgroundhttps://github.com/quickwick/stable-diffusion-win-amd-uiGetting this set up and running on AMD would not have been possible without guides by:https://gist.github.com/harishanand95/75f4515e6187a6aa3261af6ac6f61269https://gist.github.com/averad/256c507baa3dcc9464203dc14610d674https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUshttps://www.travelneil.com/stable-diffusion-updates.html