git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
- 使用git克隆项目
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
- 切换到克隆目录
cd stable-diffusion-webui
- 再目录中初始化conda环境
# Create environment
conda create -n StableDiffusion python=3.10.6
# Activate environment
conda activate StableDiffusion
- 查看环境列表,确认创建成功
# Validate environment is selected
conda env list
- 启动webui
webui-user.bat
# Wait for "Running on local URL: http://127.0.0.1:7860" and open that URI.
- 效果图
- 附录
commandline argument | explanation |
| May results in faster speeds than using xFormers on some systems but requires more VRAM. (non-deterministic) |
| May results in faster speeds than using xFormers on some systems but requires more VRAM. (deterministic, slightly slower than |
| Use xFormers library. Great improvement to memory consumption and speed. Nvidia GPUs only. (non-deterministic) |
| Enables xFormers regardless of whether the program thinks you can run it or not. Do not report bugs you get running this. |
| Cross attention layer optimization significantly reducing memory use for almost no cost (some report improved performance with it). Black magic. On by default for |
| Disables the optimization above. |
| Sub-quadratic attention, a memory efficient Cross Attention layer optimization that can significantly reduce required memory, sometimes at a slight performance cost. Recommended if getting poor performance or failed generations with a hardware/software configuration that xFormers doesn't work for. On macOS, this will also allow for generation of larger images. |
| Uses an older version of the optimization above that is not as memory hungry (it will use less VRAM, but will be more limiting in the maximum size of pictures you can make). |
| Makes the Stable Diffusion model consume less VRAM by splitting it into three parts - cond (for transforming text into numerical representation), first_stage (for converting a picture into latent space and back), and unet (for actual denoising of latent space) and making it so that only one is in VRAM at all times, sending others to CPU RAM. Lowers performance, but only by a bit - except if live previews are enabled. |
| An even more thorough optimization of the above, splitting unet into many modules, and only one module is kept in VRAM. Devastating for performance. |
| Prevents batching of positive and negative prompts during sampling, which essentially lets you run at 0.5 batch size, saving a lot of memory. Decreases performance. Not a command line option, but an optimization implicitly enabled by using |
| Disables the optimization above. Only makes sense together with |
| Changes torch memory type for stable diffusion to channels last. Effects not closely studied. |
| For Nvidia and AMD cards normally forced to run with |