In yesterday's article, I installed Web UI Forge - Classic and Forge - Neo without using Stability Matrix and managed to get them to launch.
This article is about checking whether they actually work properly and if they are fast, even though they did launch.
(Updated 8/13) I published this once, but I have restructured the article and republished it.
Note that the contents of this article were performed in the following environment.
CPU…Core i5-12400
RAM…80 GB (DDR4)
GPU…GeForce RTX 4070 SUPER 12 GB
OS…Windows 10 Pro
Also, I assume no responsibility for any damages that may occur from the information in this article.
Forge - Classic
Since it was able to generate without issues, I decided to check the generation speed. I added --no-download-sd-model --uv --skip-install to the set COMMANDLINE_ARGS= arguments in webui-user.bat within the sd-webui-forge-classic folder, and then added arguments that are said to improve speed to see if the speed changed. I will measure the time taken for generation with an SDXL model using Steps: 28, Sampler: Euler a, Schedule type: Karras, CFG scale: 5, Size: 896x1152, Batch Size 2, Batch Count 6.
No arguments: 1 min. 45.3 sec.
--pin-shared-memory: 1 min. 45.4 sec.
--cuda-malloc: 1 min. 45.5 sec.
--cuda-stream: 1 min. 45.7 sec.
--pin-shared-memory --cuda-malloc --cuda-stream: 1 min. 45.6 sec.
--xformers: 1 min. 46.0 sec.
--sage: 1 min. 45.7 sec.
--fast-fp16: 1 min. 31.7 sec.
--xformers --sage --fast-fp16: 1 min. 31.7 sec.
--pin-shared-memory --cuda-malloc --cuda-stream --xformers --sage --fast-fp16: 1 min. 32.0 sec.
It seems that fast fp16_accumulation can be used if PyTorch 2.7.0 is installed, so I assume it is already having an effect.
Installation such as requires manually installing ~ xformersRemove the --skip-install argument and try to launch the Web UI with --xformers written.
If the error "AssertionError: Torch not compiled with CUDA enabled" appears, install Pytorch and Numpy using the method from the previous article.
Add the --skip-install argument and launch the Web UI again.
It seems that SageAttention is installed when you try to launch it by adding the --sage argument. Also, it seems that something else called triton is required, so I will install it as described in the official Forge - Classic repository documentation.
FlashAttention [flash-attn]official Forge - Classic repository documentationI wanted to install it as described in the , but since it says "it is important to choose one that matches your Python and PyTorch versions," I looked for a flash-attn that matches that, and...
So I gave up.
(Added on 8/13) I learned later that the CUDA version required by Pytorch and others does not depend on, or rather is unrelated to, the version of the CUDA Toolkit installed on the main system. Confusing.
Therefore, on PowerShell
nvidia-smi
execute the command and install something that requires a CUDA version equal to or lower than the number displayed for CUDA Version. When I ran the above command in PowerShell, it said that my environment could handle up to CUDA 13.0. So, the flash-attn I can use with my Forge - Classic is
one that supports CUDA 13.0 or lower, Pytorch 2.7.0, and Python 3.11. Go to the site introduced in the Forge - Classic repository (https://github.com/kingbri1/flash-attention/releases
) and download the corresponding whl file. I downloaded flash_attn-2.7.4.post1+cu128torch2.7.0cxx11abiFALSE-cp311-cp311-win_amd64.whl. Then, activate the Forge - Classic virtual environment and
uv pip install (落としたwhlファイルを入れたフォルダまでのパス)\flash_attn-2.7.4.post1+cu128torch2.7.0cxx11abiFALSE-cp311-cp311-win_amd64.whl
type this to install it. When I launched it with the arguments --disable-sage --disable-xformers, it displayed "Using flash attention" and launched successfully.
Since I installed PyTorch 2.7.0 at the time of introduction, it is already done.
fast cublas operation (CublasLinear) [cublas_ops]As stated in the Forge - Classic official repository install it as instructed.
It seems it can be used by enabling the Settings/Optimizations settings after startup.
Furthermore, in the official repository
Since it is stated as such, it seems meaningless in an environment where Pytorch 2.7.0 is installed and --fast-fp16 can be enabled.
Re-measurementI have installed them in order up to this point, but according to the official repository
Since that is the case, once you have finished installing everything up to this point, you should just enable everything for now.
I launched it with the arguments --pin-shared-memory --cuda-malloc --cuda-stream --xformers --sage --fast-fp16, and when I tried generating, it became 1 min. 20.5 sec. .
Forge - Neo
Since I was able to generate without any issues, I decided to check the generation speed for this as well.
I added --uv --skip-install to the set COMMANDLINE_ARGS= arguments in webui-user.bat within the sd-webui-forge-neo folder, and then added the arguments that are said to enable acceleration.
The items to be generated are the same as in the Classic version.
No arguments: 1 min. 43.2 sec.
--pin-shared-memory: 1 min. 43.3 sec.
--cuda-malloc: 1 min. 43.7 sec.
--cuda-stream: 1 min. 44.7 sec.
--pin-shared-memory --cuda-malloc --cuda-stream: 1 min. 46.3 sec.
--xformers: 1 min. 44.8 sec.
--sage: 1 min. 46.1 sec.
--fast-fp16: 1 min. 30.6 sec.
--xformers --sage --fast-fp16: 1 min. 30.2 sec.
--pin-shared-memory --cuda-malloc --cuda-stream --xformers --sage --fast-fp16: 1 min. 31.0 sec.
It seems that the effect of fast fp16_accumulation alone is already showing here as well.
Installation of requires manually installing ~ etc. and re-measurement xformersRemove the --skip-install argument and try launching the Web UI with --xformers.
If an AssertionError: Torch not compiled with CUDA enabled error occurs, install Pytorch and Numpy using the method from the previous article. (For some reason, no error occurred in Neo.)
Add the --skip-install argument and launch the Web UI again.
For some reason, it was not mentioned on the Neo side, so I installed it according to the instructions in the official Forge - Classic repository.
FlashAttention [flash-attn]I gave up. I installed it the same way as Classic.
fast fp16_accumulation [PyTorch 2.7.0 +]Since I installed PyTorch 2.7.0 at the time of introduction, it is already done.
Re-measurementNeo also seems to automatically select available attention just like Classic, so when I measured with all arguments --pin-shared-memory --cuda-malloc --cuda-stream --xformers --sage --fast-fp16 enabled, it was 1 min. 25.7 sec. . Regarding Neo, since Flux etc. can be used, the results for such models might be different from SDXL.
[Advertisement]
I post the images I generate to an AI-generated artwork posting site called OurAI. You can also post videos, so please consider registering. If you access OurAI and register via
this link, you will receive 2,000 points that can be used for image generation, and you will receive an additional 3,000 points for posting 10 works! (Generating one 1024x1024 size image with an SDXL model uses 122 points.) You can find an introduction to OurAI in the article below.