[Stable Diffusion] Prompt Sharing and Learning Thread

PandaRepublic

Member
May 18, 2018
196
1,987
Then you probably need to follow these instructions:

I'll add that in my post too.
In the Github does it have you install PyTorch? Because I also followed the Github and reinstalled everything and I got the same error :(
 

Mr-Fox

Well-Known Member
Jan 24, 2020
1,401
3,793
Use img2img with SD upscale

View attachment 2472427

you are used GFPGAN and it wash face and change color, nex time use Codeformer 0.7
Thank you. I'm experimenting a bit with this. The issue is that with upscaling, we can't "invent" pixels that are not already there. Hi Res Fix is integrated in the original generation process and is generating new pixels, this is why the composition is changing slightly but the end result is much better than simple upscale can ever achieve.
 
  • Like
Reactions: Sepheyer

Schlongborn

Member
May 4, 2019
359
1,268
Yeah I also followed the video and reinstalled it a third time and still got the same error
Try to check if you have torch installed correctly:
Code:
→ D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› .\venv\Scripts\Activate.ps1
(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› pip show torch
Name: torch
Version: 1.12.1+cu116
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: d:\ai\kohya_ss\venv\lib\site-packages
Requires: typing-extensions
Required-by: accelerate, fairscale, lion-pytorch, lycoris-lora, pytorch-lightning, timm, torchmetrics, torchvision, xformers
Make sure to first activate the venv before running pip.

Also, what is your cuda version? You should be able to check it like so:
Code:
(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› nvidia-smi
Thu Mar 16 21:42:29 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 517.40       Driver Version: 517.40       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ... WDDM  | 00000000:01:00.0  On |                  N/A |
|  0%   55C    P8    32W / 245W |   1386MiB / 24576MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
EDIT: nvidia-smi only shows the highest supported CUDA version actually, to get the actual install version you would need to run nvcc -V but that is not in $PATH by default. Try something like this instead:
Code:
(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› ls "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\"

    Directory: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          10/04/2022    03:26                v11.1
d----          09/08/2022    22:25                v11.4
d----          09/08/2022    22:22                v11.6

(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]›
That should tell you which CUDA you have installed. 11.6 in my case, my driver supports up to 11.7
 
Last edited:
  • Like
  • Red Heart
Reactions: Mr-Fox and Sepheyer

Nano999

Member
Jun 4, 2022
152
68
Where else can we change VAE type, except here?


Can it be done in promt field or at some other place?
 
  • Thinking Face
Reactions: Mr-Fox

PandaRepublic

Member
May 18, 2018
196
1,987
Try to check if you have torch installed correctly:
Code:
→ D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› .\venv\Scripts\Activate.ps1
(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› pip show torch
Name: torch
Version: 1.12.1+cu116
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: d:\ai\kohya_ss\venv\lib\site-packages
Requires: typing-extensions
Required-by: accelerate, fairscale, lion-pytorch, lycoris-lora, pytorch-lightning, timm, torchmetrics, torchvision, xformers
Make sure to first activate the venv before running pip.

Also, what is your cuda version? You should be able to check it like so:
Code:
(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› nvidia-smi
Thu Mar 16 21:42:29 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 517.40       Driver Version: 517.40       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ... WDDM  | 00000000:01:00.0  On |                  N/A |
|  0%   55C    P8    32W / 245W |   1386MiB / 24576MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
EDIT: nvidia-smi only shows the highest supported CUDA version actually, to get the actual install version you would need to run nvcc -V but that is not in $PATH by default. Try something like this instead:
Code:
(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]› ls "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\"

    Directory: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          10/04/2022    03:26                v11.1
d----          09/08/2022    22:25                v11.4
d----          09/08/2022    22:22                v11.6

(venv) → D:\AI\kohya_ss [master ≡ +1 ~0 -0 !]›
That should tell you which CUDA you have installed. 11.6 in my case, my driver supports up to 11.7
I got it to work! :D
 

Schlongborn

Member
May 4, 2019
359
1,268
It stopped working :(. help pls
You are running out of memory. You can try to increase the pagefile, but I would consider just buying more RAM if you can. Alternatively you can try to lower the RAM useage by using less images maybe? No idea actually, and your problem will be that kohya_ss with these settings is already pretty much as low as you can get VRAM/RAM wise.

How much RAM do you have?
 
  • Like
Reactions: Mr-Fox

PandaRepublic

Member
May 18, 2018
196
1,987
You are running out of memory. You can try to increase the pagefile, but I would consider just buying more RAM if you can. Alternatively you can try to lower the RAM useage by using less images maybe? No idea actually, and your problem will be that kohya_ss with these settings is already pretty much as low as you can get VRAM/RAM wise.

How much RAM do you have?
16 GB
 

Mr-Fox

Well-Known Member
Jan 24, 2020
1,401
3,793
Thank you. I'm experimenting a bit with this. The issue is that with upscaling, we can't "invent" pixels that are not already there. Hi Res Fix is integrated in the original generation process and is generating new pixels, this is why the composition is changing slightly but the end result is much better than simple upscale can ever achieve.
I believe this image proves my point that Hires fix is superior to any simple upscaling.
It's the same seed as before with the same settings. I have made som small additions to the prompt though.
Other than this it's only the use of Hires fix that is making the difference. With some further work this could be a really nice one.

00026-1449331821.png