Stable Diffusion web UI is an open-source project that provides a web graphical interface for the Stable Diffusion model, created by Sygil.Dev. It allows users to operate Stable Diffusion directly in the browser to perform tasks such as text-to-image, image-to-image, image enhancement, upscaling, and textual inversion training.
Main Capabilities
- Built-in image enhancers and upscalers, including GFPGAN and RealESRGAN.
- Generator preview: view in real time during image generation.
- Can run additional upscaling models on the CPU to save VRAM.
- Textual Inversion: supports the use and training of custom embeddings.
- A collection of K-Diffusion samplers, including k_euler, k_lms, k_euler_a, k_dpm_2, k_dpm_2_a, k_heun, PLMS, DDIM, and more.
- Loopback: automatically feeds the previously generated sample back into image-to-image.
- Prompt weighting and negative prompts: adjust weights via :0.##, and add negative prompts via ###.
- GPU usage can be selected from the settings tab.
- Word Seeds: use words instead of seed numbers.
- Automatic launcher: activate conda and run Stable Diffusion with a single command.
- Lower VRAM usage: after enabling optimization mode in the settings, 512x512 text-to-image and image-to-image can run on 4GB of VRAM.
- Prompt validation: if the prompt is too long, you will receive a warning in the text output field.
- Batch sequential seeds: for example, using seed 1000 to generate two batches of two images each, the seeds of the four images are 1000, 1001, 1002, and 1003 respectively.
- Prompt matrix: use the | character to separate multiple prompts, and the system will generate images for each combination.
- Gradio advanced image-to-image editor, supporting masks and cropping.
- Mask drawing: regenerate only the specific part of the image you want to change (currently Gradio only).
- Dynamic real-time preview of generation results.
- Easily customize default values from the WebUI settings tab.
- Integrated gallery, displaying the generation results for a given prompt.
- Optimized VRAM usage for larger generations or low-end GPUs.
- Text-to-video: directly from the WebUI rootGenerate video clips from text prompts (in development).
- Image to text: Use CLIP Interrogator to analyze images and obtain prompts that can be used to generate similar images.
- Concept library: Run custom embeddings created by others through textual inversion.
- Textual inversion training: Train your own embeddings on any photo and use them in prompts.
- Currently in development: Stable Horde integration; ImgLab, batch input, and Gradio's mask editor.
How to use
This project provides installation instructions, and users can install it by following the documentation. The interface is divided into two types: Streamlit and Gradio (legacy). The Gradio interface is fully featured, can access all upscaling models (including LSDR), supports dynamic prompt input, and can quickly send generation results to image-to-image or Image Lab for upscaling. However, the Gradio interface is no longer actively developed by Sygil.Dev and only receives bug fixes.
How to use prompt weights and negative prompts:
- To give a certain token (a tag recognized by AI) a specific or increased weight (emphasis), add :0.## after the prompt, where 0.## is the decimal number specifying the weight of all tokens before the colon. For example: cat:0.30, dog:0.70 or guy riding a bicycle :0.7, incoming car :0.30.
- Negative prompts can be added with ###, after which any token will be treated as negative. For example: cat playing with string ### yarn will exclude yarn from the generated image.
- Negative prompts are a powerful tool for removing contextually similar or related themes, but be careful when adding them, because the AI may see connections you cannot see, ultimately producing garbled output.
- Tip: Try using the same seed but different prompt configurations or weight values to observe how the AI understands them. This can lead to more refined and less error-prone prompts.
Image upscalers:
- GFPGAN: Use the GFPGAN model to improve faces in images. Each tab has a checkbox to use GFPGAN at 100%, and there is also a separate tab that allows GFPGAN to be used on any image, with a slider to control the effect strength. To use GFPGAN to improve generated faces, it needs to be installed separately: download GFPGANv1.4.pth and place it in the /sygil-webui/models/gfpgan directory.
- RealESRGAN: Double the resolution of generated images. Each tab has a checkbox to use RealESRGAN, and you can choose between the regular upscaler and the anime version. There is also a separate tab for using RealESRGAN on any image. Download RealESRGAN_x4plus.pth and RealESRGAN_x4plus_anime_6B.pth, and place them in the sygil-webui/models/realesrgan directory.
- LDSR: Download LDSR project.yaml and the model last.cpkt. Rename last.ckpt to model.ckpt, and place both under sygil-webui/models/ldsr/.
- GoBig and GoLatent (currently only in the Gradio version): More powerful upscalers that use a separate latent diffusion model to upscale images more cleanly.
Use cases
Suitable for users who want to use Stable Diffusion through a browser interface for image generation, editing, enhancement, and upscaling, especially for users who want to reduce VRAM usage or run on low-end GPUs. It is also suitable for users who need advanced features such as textual inversion training, prompt matrices, and batch generation.
Limitations
- The Gradio interface is no longer actively developed and only receives bug fixes.
- The text-to-video feature is still in development.
- Some features (such as mask drawing) are currently only supported in the Gradio version.
- Using GFPGAN, RealESRGAN, etc. requires downloading model files separately.
- Specific information such as fees, pricing, and platform support is not yet provided.