Text to image: running Stable diffusion on AMD GPU/Windows. Step by step guide
Автор: Tech-Practice
Загружено: 2022-12-21
Просмотров: 19726
Detailed guide on running stable diffusion on Windows with accelerations from AMD GPU.
👉ⓢⓤⓑⓢⓒⓡⓘⓑⓔ Thank you for watching! please consider to subscribe. thank you!
👉 !! Try my online photo studio free at https://agireact.com to generate any styled images !!
👉🏽Update: 3/21/23: due to Pytorch upgrade, if you have issues, please install 1.13 pytorch by:
pip install torch==1.13.1+cpu torchvision==0.14.1+cpu torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cpu
👉🏽Update: 1/15/23. For improvement, please check it out • AMD GPU/Windows simple tricks to speed up ...
👉🏽Update: Mar 23. Please join the discord server at / discord where you can ask questions and also try out my recently developed free chatgpt bot and stable diffusion bot!
Follow up video of a web UI is shown in • AMD GPU/Windows Web GUI for running Stable...
Image to image generation UI was also created in • AMD GPU/Windows for Image to image(img2img...
Step by step guide to run Stable diffusion AI text to image on AMD GPU and Windows.
Affiliate links: buy on Amazon
4600G https://amzn.to/45LhGFa
5600G: https://amzn.to/3LgnFtC (same iGPU, better CPU)
5700G: https://amzn.to/3Z9gUiM (better iGPU, and better CPU)
ssd drive: https://amzn.to/3MVJdg2
DDR4 drive: https://amzn.to/3sKNufi
AM4 motherboard: https://amzn.to/3GfrPit
PSU (power supply unit): https://amzn.to/3Gd87UA
PC Case: https://amzn.to/3QPDNnF
if you are interested in discrete GPU: https://amzn.to/3QT1wDp
My GPU model: 6700xt. Other modern AMD GPU should also work (I tested 5700XT in • AMD GPU 5700xt running Stable diffusion on... ) .
For model downloads and converting please see: • AMD GPU - How to use other model (Waifu-Di... and • AMD GPU - How to use other model (e.g. Nov...
Some download links are included below. (based on comments, also added detailed commands)
1:20 Install Git
3:13 Install Python (miniconda)
5:43 Conda virtual environment
conda create --name sd39new python=3.9 -y
conda activate sd39new
8:30 Install python packages.
** added. pytorch version 1.13.1
pip install torch==1.13.1+cpu torchvision==0.14.1+cpu torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cpu
pip install diffusers==0.10.2
pip install transformers==4.25.1
pip install onnxruntime==1.13.1
pip install onnx==1.13.0
11:47 DirectML package install
https://aiinfra.visualstudio.com/Publ...
pip install ort_nightly_directml-1.13.0.dev20220908001-cp39-cp39-win_amd64.whl (may need to adjust the filename if file updated, check the file name for your downloaded file)
15:00 Convert stable diffusion model to onnx (stable diffusion model needs to be downloaded, e.g. from https://huggingface.co/CompVis/stable... see • AMD GPU - How to use other model (Waifu-Di... for more details)
The python script can be downloaded from here https://github.com/huggingface/diffus...
python convert_stable_diffusion_checkpoint_to_onnx.py --model_path="CompVis/stable-diffusion-v1-4" --output_path="./stable_diffusion_onnx"
20:08 Run the model to turn text into image!
run following in python console:
from diffusers import StableDiffusionOnnxPipeline
pipe = StableDiffusionOnnxPipeline.from_pretrained("./stable_diffusion_onnx", provider="DmlExecutionProvider")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]
image.save("astronaut_rides_horse.png")
27:30 final output (example)
Please join the discord server at / discord where you can ask questions and also try out my recently developed free chatgpt bot and stable diffusion bot!
If you would like to support me, here is my Kofi link: https://ko-fi.com/techpractice and Patreon page: https://www.patreon.com/user?u=89548519
Thank you for watching!

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: