[컴][머신러닝] stable diffussion Web UI

스테이블 디퓨젼 , 디퓨전 / 사용 / hw spec

stable diffussion Web UI

하드웨어 스펙

  • i5-9400F, 2.90GHz
  • 8GB x 2
  • Geforce GTX 1660, 8GB

실행

  1. python 3.10.6 설치
  2. git 설치
  3. v1.0.0-pre 를 download(sd.webui.zip)
  4. python path 추가: set PATH=d:\apps\Python\Python311;d:\apps\Python\Python311\Scripts;%PATH%
  5. update.bat
  6. run.bat

실행화면

d:\a\prog\stablediffusion\webui>update.bat
Updating 48a15821..baf6946e
Fast-forward
 .eslintignore                                      |    4 +
 .eslintrc.js                                       |   88 ++
 .git-blame-ignore-revs                             |    2 +
 .github/ISSUE_TEMPLATE/bug_report.yml              |   50 +-
 .github/pull_request_template.md                   |   33 +-
 .github/workflows/on_pull_request.yaml             |   49 +-
 .github/workflows/run_tests.yaml                   |   53 +-
 .gitignore                                         |    6 +-
 CHANGELOG.md                                       |  200 +++
 README.md                                          |   39 +-
 configs/instruct-pix2pix.yaml                      |   98 ++
 .../v1-inpainting-inference.yaml                   |   36 +-
 environment-wsl2.yaml                              |   10 +-
 extensions-builtin/LDSR/ldsr_model_arch.py         |   13 +-
 extensions-builtin/LDSR/scripts/ldsr_model.py      |   23 +-
 extensions-builtin/LDSR/sd_hijack_autoencoder.py   |   28 +-
 extensions-builtin/LDSR/sd_hijack_ddpm_v1.py       |   66 +-
 extensions-builtin/Lora/extra_networks_lora.py     |   27 +-
 extensions-builtin/Lora/lora.py                    |  392 +++++-
 extensions-builtin/Lora/scripts/lora_script.py     |   90 +-
 extensions-builtin/Lora/ui_extra_networks_lora.py  |   16 +-
 extensions-builtin/ScuNET/scripts/scunet_model.py  |   98 +-
 extensions-builtin/ScuNET/scunet_model_arch.py     |   11 +-
 extensions-builtin/SwinIR/scripts/swinir_model.py  |    9 +-
 extensions-builtin/SwinIR/swinir_model_arch.py     |    6 +-
 extensions-builtin/SwinIR/swinir_model_arch_v2.py  |   58 +-
 .../javascript/prompt-bracket-checker.js           |  130 +-
 html/extra-networks-card.html                      |    7 +-
 html/licenses.html                                 |  271 ++++
 javascript/aspectRatioOverlay.js                   |  226 +--
 javascript/contextMenus.js                         |  349 +++--
 javascript/dragdrop.js                             |   52 +-
 javascript/edit-attention.js                       |  216 +--
 javascript/extensions.js                           |  109 +-
 javascript/extraNetworks.js                        |  284 +++-
 javascript/generationParams.js                     |   48 +-
 javascript/hints.js                                |  122 +-
 javascript/hires_fix.js                            |   40 +-
 javascript/imageMaskFix.js                         |   26 +-
 javascript/imageParams.js                          |    5 +-
 javascript/imageviewer.js                          |  283 ++--
 javascript/imageviewerGamepad.js                   |   57 +
 javascript/localization.js                         |  341 ++---
 javascript/notification.js                         |   20 +-
 javascript/progressbar.js                          |  250 ++--
 javascript/textualInversion.js                     |   34 +-
 javascript/ui.js                                   |  497 ++++---
 javascript/ui_settings_hints.js                    |   62 +
 launch.py                                          |  339 +----
 models/karlo/ViT-L-14_stats.th                     |  Bin 0 -> 7079 bytes
 modules/Roboto-Regular.ttf                         |  Bin 0 -> 305608 bytes
 modules/api/api.py                                 |  373 +++--
 modules/api/models.py                              |   54 +-
 modules/call_queue.py                              |    6 +-
 modules/cmd_args.py                                |  109 ++
 modules/codeformer/codeformer_arch.py              |   24 +-
 modules/codeformer/vqgan_arch.py                   |   44 +-
 modules/codeformer_model.py                        |   10 +-
 modules/config_states.py                           |  202 +++
 modules/deepbooru.py                               |    3 +-
 modules/deepbooru_model.py                         |    4 +-
 modules/devices.py                                 |  114 +-
 modules/esrgan_model.py                            |   21 +-
 modules/esrgan_model_arch.py                       |   24 +-
 modules/extensions.py                              |   89 +-
 modules/extra_networks.py                          |   16 +-
 modules/extra_networks_hypernet.py                 |    9 +-
 modules/extras.py                                  |   73 +-
 modules/generation_parameters_copypaste.py         |  285 ++--
 modules/gfpgan_model.py                            |    7 +-
 modules/hashes.py                                  |   41 +-
 modules/hypernetworks/hypernetwork.py              |   49 +-
 modules/hypernetworks/ui.py                        |    6 +-
 modules/images.py                                  |  193 ++-
 modules/img2img.py                                 |   54 +-
 modules/interrogate.py                             |   17 +-
 modules/launch_utils.py                            |  334 +++++
 modules/localization.py                            |    4 +-
 modules/lowvram.py                                 |   10 +-
 modules/mac_specific.py                            |   63 +
 modules/masking.py                                 |    2 +-
 modules/memmon.py                                  |   12 +-
 modules/modelloader.py                             |   78 +-
 modules/models/diffusion/ddpm_edit.py              | 1455 ++++++++++++++++++++
 modules/models/diffusion/uni_pc/__init__.py        |    1 +
 modules/models/diffusion/uni_pc/sampler.py         |  101 ++
 modules/models/diffusion/uni_pc/uni_pc.py          |  863 ++++++++++++
 modules/ngrok.py                                   |   30 +-
 modules/paths.py                                   |   11 +-
 modules/paths_internal.py                          |   31 +
 modules/postprocessing.py                          |    9 +-
 modules/processing.py                              |  414 ++++--
 modules/progress.py                                |   34 +-
 modules/prompt_parser.py                           |   27 +-
 modules/realesrgan_model.py                        |   26 +-
 modules/safe.py                                    |   17 +-
 modules/script_callbacks.py                        |  114 +-
 modules/script_loading.py                          |   11 +-
 modules/scripts.py                                 |  171 ++-
 modules/scripts_auto_postprocessing.py             |   42 +
 modules/scripts_postprocessing.py                  |   21 +-
 modules/sd_disable_initialization.py               |   19 +-
 modules/sd_hijack.py                               |  153 +-
 modules/sd_hijack_clip.py                          |    2 +-
 modules/sd_hijack_clip_old.py                      |    3 +-
 modules/sd_hijack_inpainting.py                    |   20 +-
 modules/sd_hijack_ip2p.py                          |   10 +
 modules/sd_hijack_optimizations.py                 |  347 ++++-
 modules/sd_hijack_unet.py                          |   51 +-
 modules/sd_hijack_utils.py                         |   28 +
 modules/sd_hijack_xlmr.py                          |    2 -
 modules/sd_models.py                               |  395 ++++--
 modules/sd_models_config.py                        |  118 ++
 modules/sd_samplers.py                             |  527 +------
 modules/sd_samplers_common.py                      |   95 ++
 modules/sd_samplers_compvis.py                     |  224 +++
 modules/sd_samplers_kdiffusion.py                  |  392 ++++++
 modules/sd_vae.py                                  |   16 +-
 modules/sd_vae_approx.py                           |    5 +-
 modules/sd_vae_taesd.py                            |   88 ++
 modules/shared.py                                  |  478 ++++---
 modules/shared_items.py                            |   31 +
 modules/styles.py                                  |   23 +-
 modules/sub_quadratic_attention.py                 |   21 +-
 modules/textual_inversion/autocrop.py              |  214 +--
 modules/textual_inversion/dataset.py               |   62 +-
 modules/textual_inversion/image_embedding.py       |   28 +-
 modules/textual_inversion/learn_schedule.py        |    6 +-
 modules/textual_inversion/preprocess.py            |   31 +-
 modules/textual_inversion/textual_inversion.py     |   78 +-
 modules/timer.py                                   |   38 +
 modules/txt2img.py                                 |   19 +-
 modules/ui.py                                      |  605 +++++---
 modules/ui_common.py                               |   27 +-
 modules/ui_components.py                           |   52 +-
 modules/ui_extensions.py                           |  384 +++++-
 modules/ui_extra_networks.py                       |  244 +++-
 modules/ui_extra_networks_checkpoints.py           |   31 +
 modules/ui_extra_networks_hypernets.py             |   13 +-
 modules/ui_extra_networks_textual_inversion.py     |   14 +-
 modules/ui_loadsave.py                             |  210 +++
 modules/ui_postprocessing.py                       |   10 +-
 modules/ui_tempdir.py                              |   19 +-
 modules/upscaler.py                                |   14 +-
 modules/xlmr.py                                    |    8 +-
 package.json                                       |   11 +
 pyproject.toml                                     |   35 +
 requirements-test.txt                              |    3 +
 requirements.txt                                   |   10 +-
 requirements_versions.txt                          |   24 +-
 script.js                                          |   94 +-
 scripts/custom_code.py                             |   65 +-
 scripts/img2imgalt.py                              |   48 +-
 scripts/loopback.py                                |  100 +-
 scripts/outpainting_mk_2.py                        |    8 +-
 scripts/poor_mans_outpainting.py                   |    8 +-
 scripts/postprocessing_upscale.py                  |   73 +-
 scripts/prompt_matrix.py                           |   52 +-
 scripts/prompts_from_file.py                       |   20 +-
 scripts/sd_upscale.py                              |   10 +-
 scripts/xy_grid.py                                 |  498 -------
 scripts/xyz_grid.py                                |  720 ++++++++++
 style.css                                          |  920 ++++++-------
 test/basic_features/__init__.py                    |    0
 test/basic_features/extras_test.py                 |   54 -
 test/basic_features/img2img_test.py                |   66 -
 test/basic_features/txt2img_test.py                |   80 --
 test/basic_features/utils_test.py                  |   62 -
 test/conftest.py                                   |   17 +
 test/server_poll.py                                |   24 -
 test/test_extras.py                                |   35 +
 test/test_img2img.py                               |   68 +
 test/test_txt2img.py                               |   90 ++
 test/test_utils.py                                 |   33 +
 webui-macos-env.sh                                 |    4 +-
 webui-user.sh                                      |    3 +
 webui.py                                           |  415 ++++--
 webui.sh                                           |   68 +-
 178 files changed, 14062 insertions(+), 5792 deletions(-)
 create mode 100644 .eslintignore
 create mode 100644 .eslintrc.js
 create mode 100644 .git-blame-ignore-revs
 create mode 100644 CHANGELOG.md
 create mode 100644 configs/instruct-pix2pix.yaml
 rename v2-inference-v.yaml => configs/v1-inpainting-inference.yaml (61%)
 create mode 100644 javascript/imageviewerGamepad.js
 create mode 100644 javascript/ui_settings_hints.js
 create mode 100644 models/karlo/ViT-L-14_stats.th
 create mode 100644 modules/Roboto-Regular.ttf
 create mode 100644 modules/cmd_args.py
 create mode 100644 modules/config_states.py
 create mode 100644 modules/launch_utils.py
 create mode 100644 modules/mac_specific.py
 create mode 100644 modules/models/diffusion/ddpm_edit.py
 create mode 100644 modules/models/diffusion/uni_pc/__init__.py
 create mode 100644 modules/models/diffusion/uni_pc/sampler.py
 create mode 100644 modules/models/diffusion/uni_pc/uni_pc.py
 create mode 100644 modules/paths_internal.py
 create mode 100644 modules/scripts_auto_postprocessing.py
 create mode 100644 modules/sd_hijack_ip2p.py
 create mode 100644 modules/sd_hijack_utils.py
 create mode 100644 modules/sd_models_config.py
 create mode 100644 modules/sd_samplers_common.py
 create mode 100644 modules/sd_samplers_compvis.py
 create mode 100644 modules/sd_samplers_kdiffusion.py
 create mode 100644 modules/sd_vae_taesd.py
 create mode 100644 modules/shared_items.py
 create mode 100644 modules/timer.py
 create mode 100644 modules/ui_extra_networks_checkpoints.py
 create mode 100644 modules/ui_loadsave.py
 create mode 100644 package.json
 create mode 100644 pyproject.toml
 create mode 100644 requirements-test.txt
 delete mode 100644 scripts/xy_grid.py
 create mode 100644 scripts/xyz_grid.py
 delete mode 100644 test/basic_features/__init__.py
 delete mode 100644 test/basic_features/extras_test.py
 delete mode 100644 test/basic_features/img2img_test.py
 delete mode 100644 test/basic_features/txt2img_test.py
 delete mode 100644 test/basic_features/utils_test.py
 create mode 100644 test/conftest.py
 delete mode 100644 test/server_poll.py
 create mode 100644 test/test_extras.py
 create mode 100644 test/test_img2img.py
 create mode 100644 test/test_txt2img.py
 create mode 100644 test/test_utils.py
계속하려면 아무 키나 누르십시오 . . .

d:\a\prog\stablediffusion\webui>run.bat
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.3.2
Commit hash: baf6946e06249c5af9851c60171692c44ef633e0
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu118
Collecting torch==2.0.1
  Downloading https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp310-cp310-win_amd64.whl (2619.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 GB 2.2 MB/s eta 0:00:00
Collecting torchvision==0.15.2
  Downloading https://download.pytorch.org/whl/cu118/torchvision-0.15.2%2Bcu118-cp310-cp310-win_amd64.whl (4.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.9/4.9 MB 22.5 MB/s eta 0:00:00
Collecting filelock (from torch==2.0.1)
  Downloading filelock-3.12.2-py3-none-any.whl (10 kB)
Collecting typing-extensions (from torch==2.0.1)
  Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting sympy (from torch==2.0.1)
  Downloading sympy-1.12-py3-none-any.whl (5.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 22.9 MB/s eta 0:00:00
Collecting networkx (from torch==2.0.1)
  Using cached networkx-3.1-py3-none-any.whl (2.1 MB)
Collecting jinja2 (from torch==2.0.1)
  Downloading https://download.pytorch.org/whl/Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB ? eta 0:00:00
Collecting numpy (from torchvision==0.15.2)
  Downloading numpy-1.25.0-cp310-cp310-win_amd64.whl (15.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.0/15.0 MB 23.4 MB/s eta 0:00:00
Collecting requests (from torchvision==0.15.2)
  Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Collecting pillow!=8.3.*,>=5.3.0 (from torchvision==0.15.2)
  Using cached Pillow-9.5.0-cp310-cp310-win_amd64.whl (2.5 MB)
Collecting MarkupSafe>=2.0 (from jinja2->torch==2.0.1)
  Downloading MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl (17 kB)
Collecting charset-normalizer<4,>=2 (from requests->torchvision==0.15.2)
  Using cached charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl (97 kB)
Collecting idna<4,>=2.5 (from requests->torchvision==0.15.2)
  Using cached https://download.pytorch.org/whl/idna-3.4-py3-none-any.whl (61 kB)
Collecting urllib3<3,>=1.21.1 (from requests->torchvision==0.15.2)
  Using cached urllib3-2.0.3-py3-none-any.whl (123 kB)
Collecting certifi>=2017.4.17 (from requests->torchvision==0.15.2)
  Using cached certifi-2023.5.7-py3-none-any.whl (156 kB)
Collecting mpmath>=0.19 (from sympy->torch==2.0.1)
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: mpmath, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, filelock, charset-normalizer, certifi, requests, jinja2, torch, torchvision
Successfully installed MarkupSafe-2.1.3 certifi-2023.5.7 charset-normalizer-3.1.0 filelock-3.12.2 idna-3.4 jinja2-3.1.2 mpmath-1.3.0 networkx-3.1 numpy-1.25.0 pillow-9.5.0 requests-2.31.0 sympy-1.12 torch-2.0.1+cu118 torchvision-0.15.2+cu118 typing-extensions-4.6.3 urllib3-2.0.3
Installing gfpgan
Installing clip
Installing open_clip
Cloning Stable Diffusion into D:\a\prog\stablediffusion\webui\webui\repositories\stable-diffusion-stability-ai...
Cloning Taming Transformers into D:\a\prog\stablediffusion\webui\webui\repositories\taming-transformers...
Cloning K-diffusion into D:\a\prog\stablediffusion\webui\webui\repositories\k-diffusion...
Cloning CodeFormer into D:\a\prog\stablediffusion\webui\webui\repositories\CodeFormer...
Cloning BLIP into D:\a\prog\stablediffusion\webui\webui\repositories\BLIP...
Installing requirements for CodeFormer
Installing requirements
Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Downloading: "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" to D:\a\prog\stablediffusion\webui\webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors

100%|███████████████████████████████████████████████████████████████████████████████| 3.97G/3.97G [03:02<00:00, 23.4MB/s]
Calculating sha256 for D:\a\prog\stablediffusion\webui\webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors: Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 190.6s (import torch: 1.8s, import gradio: 2.4s, import ldm: 0.5s, other imports: 1.9s, setup codeformer: 0.1s, list SD models: 182.4s, load scripts: 0.8s, create ui: 0.2s, gradio launch: 0.4s).
6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa
Loading weights [6ce0161689] from D:\a\prog\stablediffusion\webui\webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: D:\a\prog\stablediffusion\webui\webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Downloading (…)olve/main/vocab.json: 100%|████████████████████████████████████████████| 961k/961k [00:00<00:00, 1.62MB/s]
Downloading (…)olve/main/merges.txt: 100%|█████████████████████████████████████████████| 525k/525k [00:00<00:00, 890kB/s]
Downloading (…)cial_tokens_map.json: 100%|██████████████████████████████████████████████████████| 389/389 [00:00<?, ?B/s]
Downloading (…)okenizer_config.json: 100%|██████████████████████████████████████████████████████| 905/905 [00:00<?, ?B/s]
Downloading (…)lve/main/config.json: 100%|██████████████████████████████████████████████████| 4.52k/4.52k [00:00<?, ?B/s]
Applying optimization: Doggettx... done.
Textual inversion embeddings loaded(0):
Model loaded in 10.5s (calculate hash: 3.6s, load weights from disk: 0.1s, create model: 3.8s, apply weights to model: 0.6s, apply half(): 0.6s, move model to device: 0.9s, load textual inversion embeddings: 0.8s).
100%|████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:07<00:00,  2.81it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  6.61it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  6.61it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  7.03it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  6.61it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  7.05it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00,  3.42it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00,  3.39it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  6.67it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  6.69it/s]
Interrupted with signal 2 in <frame at 0x000001DD2E5D1170, file 'threading.py', line 324, code wait>██████████████████████| 20/20 [00:02<00:00,  7.08it/s]
일괄 작업을 끝내시겠습니까 (Y/N)? y

See Also

  1. How to use models · civitai/civitai Wiki · GitHub : <civitai.com> 에서 model을 받아서 local에서 사용해 볼 수 있다.

댓글 없음:

댓글 쓰기