๐Ÿ“—
smiley book
  • Smiley Books
  • AI
    • Readme
    • openai-whisper
      • ์ƒ˜ํ”Œ ์‹คํ–‰ํ•ด๋ณด๊ธฐ
      • GPU ์„œ๋ฒ„ ์ค€๋น„ํ•˜๊ธฐ
      • API๋กœ whisper๋ฅผ ์™ธ๋ถ€์— ์˜คํ”ˆํ•˜๊ธฐ
      • ํ”„๋กฌํ”„ํŠธ ์ง€์›
      • ์‹ค์‹œ๊ฐ„ message chat
      • ํ™”๋ฉด ์ด์˜๊ฒŒ ๋งŒ๋“ค๊ธฐ์™€ ๋กœ๊ทธ์ธ
      • ํŒŒ์ด์ฌ ๊ฐ€์ƒํ™˜๊ฒฝ
      • ์‹ค์‹œ๊ฐ„ voice chat
      • fine tunning(๋ฏธ์„ธ ์กฐ์ •) ์œผ๋กœ ์„ฑ๋Šฅ ์˜ฌ๋ฆฌ๊ธฐ
      • app์—์„œ api๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์‹ค์‹œ๊ฐ„์œผ๋กœ ํ…์ŠคํŠธ๋กœ ๋ฐ”๊ฟ”๋ณด๊ธฐ
    • ollama - llm์„ ์‰ฝ๊ฒŒ ๋‚ด์ปด์—์„œ ์‹คํ–‰
      • ollama webui
      • ollama docker
    • stable diffusion
      • SDXL - text to image
      • SD-webui
    • ChatGPT
      • ๋‹ต๋ณ€์ด ๋Š๊ธธ๋•Œ
      • ์—ญํ• ์„ ์ •ํ•˜์ž
      • ๊ตฌ์ฒด์ ์ธ ์งˆ๋ฌธ
      • ๊ฒฐ๊ณผํ˜•ํƒœ๋ฅผ ์ง€์ •
      • ํ”„๋กฌํ”„ํŠธ๋ฅผ ์—ฌ๋Ÿฌ์ค„๋กœ ์‚ฌ์šฉํ•˜์ž.
      • ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ ๊ธ€ ๋ฒˆ์—ญ๋ณธ
    • Prompt Engineering
    • Auto-GPT
    • Gemini
      • google ai studio
      • gemini-api
      • embedding guide
    • Huggingface
      • huggingface ์‚ฌ์šฉ๋ฒ•
      • huggingface nlp ๊ณต๋ถ€์ค‘
    • kaggle
      • download dataset
    • langchain
      • langchain์„ ๊ณต๋ถ€ํ•˜๋ฉฐ ์ •๋ฆฌ
      • basic
      • slackbot
      • rag
      • document-loader
      • website-loader
      • confluence
      • memory
      • function-call
      • langsmith
      • agent-toolkit
  • Ansible
    • templates vs files and jinja2
    • dynamic inventory
    • limit ์˜ต์…˜ ๊ฐ•์ œํ•˜๊ธฐ
    • limit ์‚ฌ์šฉํ›„ gather_fact ๋ฌธ์ œ
  • AWS
    • AWS CLI
    • EKS
      • cluster manage
      • ALB Controller
      • external-dns
      • fargate
    • ECR
    • S3
    • Certificate Manager
  • Azure
    • Azure AD OAuth Client Flow
  • Container
    • Registry
    • ๋นŒ๋“œ์‹œ์— env๊ฐ’ ์„ค์ •ํ•˜๊ธฐ
  • DB
    • PXC
      • Operator
      • PMM
      • ์‚ญ์ œ
      • GTID
      • Cross Site Replication
    • Mssql
    • Mysql
  • dotnet
    • Thread Pool
    • Connection Pool
    • Thread Pool2
  • Devops
    • Recommendation
  • GIT
    • Basic
    • Submodule
  • GitHub
    • Repository
    • GitHub Action
    • GitHub PR
    • Self Hosted Runner
    • GitHub Webhook
  • GitLab
    • CI/CD
    • CI/CD Advance
    • Ssl renew
    • CI/CD Pass env to other job
  • Go Lang
    • ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ•
    • multi os binary build
    • kubectl๊ฐ™์€ cli๋งŒ๋“ค๊ธฐ
    • azure ad cli
    • embed static file
    • go study
      • pointer
      • module and package
      • string
      • struct
      • goroutine
  • Kubernetes
    • Kubernetes๋Š” ๋ฌด์—‡์ธ๊ฐ€
    • Tools
    • Install with kubespray
    • Kubernetes hardening guidance
    • 11 ways not to get hacked
    • ArgoCD
      • Install
      • CLI
      • Repository
      • Apps
      • AWS ALB ์‚ฌ์šฉ
      • Notification slack
      • Backup / DR
      • Ingress
      • 2021-11-16 Github error
      • Server Config
      • auth0 ์ธ์ฆ ์ถ”๊ฐ€(oauth,OIDC)
    • Extension
      • Longhorn pvc
      • External dns
      • Ingress nginx
      • Cert Manager
      • Kube prometheus
    • Helm
      • Subchart
      • Tip
    • Loki
    • Persistent Volume
    • TIP
      • Job
      • Pod
      • Log
  • KAFKA
    • raft
  • KVM
    • kvm cpu model
  • Linux
    • DNS Bind9
      • Cert-Manager
      • Certbot
      • Dynamic Update
      • Log
    • Export and variable
    • Grep ์‚ฌ์šฉ๋ฒ•
  • Modeling
    • C4 model introduce
    • Mermaid
    • reference
  • Monitoring
    • Readme
    • 0. What is Monitoring
    • 1. install prometheus and grafana
    • 2. grafana provisioning
    • 3. grafana dashboard
    • 4. grafana portable dashboard
    • 5. prometheus ui
    • 6. prometheus oauth2
    • Prometheus
      • Metric type
      • basic
      • rate vs irate
      • k8s-prometheus
    • Grafana
      • Expolorer
    • Node Exporter
      • advance
      • textfile collector
  • Motivation
    • 3 Simple Rule
  • OPENNEBULA
    • Install(ansible)
    • Install
    • Tip
    • Windows vm
  • Reading
    • comfort zone
    • ๋ฐฐ๋ ค
    • elon musk 6 rule for insane productivity
    • Feynman Technique
    • how to interview - elon musk
    • ๊ฒฝ์ฒญ
    • Readme
  • Redis
    • Install
    • Master-slave Architecture
    • Sentinel
    • Redis Cluster
    • Client programming c#
  • SEO
    • Readme
  • Security
    • criminalip.io
      • criminalip.io
  • Stock
    • robinhood-python
  • Terraform
    • moved block
    • output
  • vault
    • Readme
  • VS Code
    • dev container
    • dev container on remote server
  • Old fashione trend
    • curity
    • MAAS
      • Install maas
      • Manage maas
      • Tip
Powered by GitBook
On this page
  • Dockerfile ์ƒ์„ฑ
  • docker-compose.yaml ์ƒ์„ฑ
  • ์‹คํ–‰
  • ํ™•์ธ
  • option ์„ค๋ช…
  • ์ถ”๊ฐ€ ์‚ฌ์šฉ๋ฒ•
  • check point ์‚ฌ์šฉํ•˜๊ธฐ
  • lora ์‚ฌ์šฉํ•˜๊ธฐ
  • vae ์‚ฌ์šฉํ•˜๊ธฐ
  • launch.py ์˜ต์…˜

Was this helpful?

  1. AI
  2. stable diffusion

SD-webui

PreviousSDXL - text to imageNextChatGPT

Last updated 11 months ago

Was this helpful?

์ฝ”๋”ฉ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š”๋ถ€๋ถ„์„ ์ดํ•ดํ–ˆ์œผ๋‹ˆ ์ด์ œ ์›น์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ถ€๋ถ„์„ ์ดํ•ดํ•ด๋ณด์ž.

stable-diffusion-webui ๋ผ๋Š” ์˜คํ”ˆ์†Œ์Šค ํ”„๋กœ์ ํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.

Dockerfile ์ƒ์„ฑ

FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime

RUN apt update

RUN apt install -y libgl1 wget git curl

RUN DEBIAN_FRONTEND=noninteractive  TZ="America/Los_Angeles" apt install -y libglib2.0-0

WORKDIR /app

RUN git clone --depth 1 --branch v1.7.0 https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

RUN pip install -r stable-diffusion-webui/requirements.txt

# # root ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๊ฒŒ
RUN sed -i 's/can_run_as_root=0/can_run_as_root=1/g' stable-diffusion-webui/webui.sh

EXPOSE 7860

WORKDIR /app/stable-diffusion-webui

ENTRYPOINT [ "python","launch.py","--listen"]

docker-compose.yaml ์ƒ์„ฑ

version: '3.8'
services:
  sd-webui:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: sd-webui
    restart: unless-stopped
    ports:
      - 7860:7860
    volumes:
      - ./models:/app/stable-diffusion-webui/models
      - ./repositories:/app/stable-diffusion-webui/repositories
      - ./outputs:/app/stable-diffusion-webui/outputs
      - ./embeddings:/app/stable-diffusion-webui/embeddings
    deploy:
      resources:
        reservations:
          devices:
            - driver: 'nvidia'
              capabilities: [gpu]
              count: all

์‹คํ–‰

docker-compose up -d

ํ™•์ธ

curl http://localhost:7860

![Alt text](images/2. SD-webui/image.png)

option ์„ค๋ช…

์œ ํˆฌ๋ธŒ์— ๋‚ด์šฉ์ด ๋งŽ์œผ๋ฏ€๋กœ ํ™•์ธํ•ด๋ณด๋ฉด๋ ๊ฑฐ๊ฐ™๋‹ค. ๊ธฐ๋ณธ์ ์ธ๋ถ€๋ถ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • prompt : ์›ํ•˜๋Š” ์ด๋ฏธ์ง€๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๋‹จ์–ด

  • negative prompt : ํฌํ•จ๋˜์ง€ ์•Š๊ธฐ๋ฅผ ๋ฐ”๋ผ๋Š” ๋‹จ์–ด

  • sampling step : ๊ธฐ๋ณธ 20 ๋‚ฎ์œผ๋ฉด ๋ญ‰๊ฐœ์ง ๋†’์œผ๋ฉด ๊นจ๋—ํ•ด์ง

  • sampleing method : ์กฐ๊ธˆ์”ฉ ๋‹ค๋ฆ„

  • width/height : ๊ฐ€๋กœ / ์„ธ๋กœ 512๊ฐ€ ๊ฐ€์žฅ ์ž˜๋‚˜์˜จ๋‹ค.

  • restore faces : ์–ผ๊ตด์ด ์ž˜ ๋ชป๋‚˜์˜ค๋Š”๊ฑธ ๋ณด์ •ํ•ด์ค€๋‹ค.

  • tiling : tiling์ด๋ฏธ์ง€๋ฅผ ๋งŒ๋“ค๋Œ€ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ๋‚˜์˜ค๊ฒŒ ํ•œ๋‹ค.

  • Highres : ์ด์ƒํ•œ ์š”์†Œ๋“ค์„ ๋ณด์ • ๋จธ๋ฆฌ๊ฐ€ ๋‘๊ฐœ ๋“ฑ๋“ฑ

  • batch count/ size => ๊ณฑํ•œ๋งŒํผ ๊ทธ๋ฆผ์ด ๋‚˜์˜จ๋‹ค.

  • cfg scale : ์–ผ๋งˆ๋‚˜ ํ”„๋กฌํ”„ํŠธ๋ฅผ ๋”ฐ๋ผ๊ฐ€๋Š”์ง€ ๋‚ฎ์œผ๋ฉด ํ”„๋กฌํ”„ํŠธ๋ž‘ ์ƒ๊ด€์—†์ด ๋†’์œผ๋ฉด ํ”„๋กฌํ”„๊ฐ’ ๊ทธ๋Œ€๋กœ

  • seed: ๊ธฐ์กด ์ƒ์„ฑํ•œ ์ด๋ฏธ์ง€์˜ seed๊ฐ’์„ ๋„ฃ์œผ๋ฉด ๊ธฐ์กด ์ด๋ฏธ์ง€์Šคํƒ€์ผ๊ณผ ๋น„์Šทํ•˜๊ฒŒ ์ƒ์„ฑ๋œ๋‹ค.

  • script :

    • prompt๋ฅผ ๋น„๊ตํ•ด์„œ ํ‘œ์˜ ํ˜•ํƒœ๋กœ ๋ณด์—ฌ์ค€๋‹ค.

    • ํ”„๋กฌํ”„ํŠธ ํŒŒ์ผ์„ ์—…๋กœ๋“œ ๋œ๋‹ค.

    • x/y plot x์ถ•๊ณผ y์ถ•์— ๋‹ค๋ฅธ ๊ฐ’์„ ๋„ฃ์–ด์„œ ํ™”๋ฉด์—์„œ ๋น„๊ตํ• ์ˆ˜ ์ž‡๊ฒŒ table๋กœ ๋‚˜์˜จ๋‹ค.

![Alt text](images/2. SD-webui/image-1.png)

  1. ๋žœ๋คํ•œ ํ™”๊ฐ€์˜ ์ด๋ฆ„์„ ๋„ฃ์–ด์คŒ

  2. ๊ธฐ์กด ๊ทธ๋ฆผ์— ํ”„๋กฌํ”„ํŠธ๋ฅผ ๊ฐ€์ ธ์™€์„œ ๋ณด์—ฌ์คŒ

  3. ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ €์žฅํ• ์ˆ˜ ์žˆ์Œ ๋ฐ”๋กœ ์˜†์— ๋กœ๋”ฉํ• ์ˆ˜ ์ž‡์Œ

์ถ”๊ฐ€ ์‚ฌ์šฉ๋ฒ•

checkpoint์™€ lora, vae๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋” ์ข‹์€ ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ• ์ˆ˜ ์žˆ๋‹ค.

check point ์‚ฌ์šฉํ•˜๊ธฐ

์‚ฌ์ดํŠธ์—์„œ check point model์„ ๋ฐ›์•„์„œ stable-diffusion-webui/models/Stable-diffusion ํด๋”์— ๋„ฃ์–ด์ค€๋‹ค. ui์—์„œ refresh๋ฅผ ๋ˆ„๋ฅด๋ฉด ํŒŒ์ผ๋ณด์ธ๋‹ค ์‚ฌ์šฉํ•˜๋ฉด๋œ๋‹ค.

lora ์‚ฌ์šฉํ•˜๊ธฐ

์‚ฌ์ดํŠธ์—์„œ lora๋ฅผ ๋ฐ›์•„์„œ stable-diffusion-webui/models/Loraํด๋”์— ๋„ฃ์–ด์ค€๋‹ค. ui์—์„œ refresh๋ฅผ ๋ˆ„๋ฅด๋ฉด ํŒŒ์ผ๋ณด์ธ๋‹ค ์‚ฌ์šฉํ•˜๋ฉด๋œ๋‹ค.

vae ์‚ฌ์šฉํ•˜๊ธฐ

์‚ฌ์ดํŠธ์—์„œ vae๋ฅผ ๋ฐ›์•„์„œ stable-diffusion-webui/models/VAEํด๋”์— ๋„ฃ์–ด์ค€๋‹ค.

ui์—์„œ refresh๋ฅผ ๋ˆ„๋ฅด๋ฉด ํŒŒ์ผ๋ณด์ธ๋‹ค ์‚ฌ์šฉํ•˜๋ฉด๋œ๋‹ค.

launch.py ์˜ต์…˜

usage: launch.py [-h]
                 [--update-all-extensions]
                 [--skip-python-version-check]
                 [--skip-torch-cuda-test]
                 [--reinstall-xformers]
                 [--reinstall-torch]
                 [--update-check]
                 [--test-server]
                 [--log-startup]
                 [--skip-prepare-environment]
                 [--skip-install]
                 [--dump-sysinfo]
                 [--loglevel LOGLEVEL]
                 [--do-not-download-clip]
                 [--data-dir DATA_DIR]
                 [--config CONFIG]
                 [--ckpt CKPT]
                 [--ckpt-dir CKPT_DIR]
                 [--vae-dir VAE_DIR]
                 [--gfpgan-dir GFPGAN_DIR]
                 [--gfpgan-model GFPGAN_MODEL]
                 [--no-half]
                 [--no-half-vae]
                 [--no-progressbar-hiding]
                 [--max-batch-count MAX_BATCH_COUNT]
                 [--embeddings-dir EMBEDDINGS_DIR]
                 [--textual-inversion-templates-dir TEXTUAL_INVERSION_TEMPLATES_DIR]
                 [--hypernetwork-dir HYPERNETWORK_DIR]
                 [--localizations-dir LOCALIZATIONS_DIR]
                 [--allow-code]
                 [--medvram]
                 [--medvram-sdxl]
                 [--lowvram]
                 [--lowram]
                 [--always-batch-cond-uncond]
                 [--unload-gfpgan]
                 [--precision {full,autocast}]
                 [--upcast-sampling]
                 [--share]
                 [--ngrok NGROK]
                 [--ngrok-region NGROK_REGION]
                 [--ngrok-options NGROK_OPTIONS]
                 [--enable-insecure-extension-access]
                 [--codeformer-models-path CODEFORMER_MODELS_PATH]
                 [--gfpgan-models-path GFPGAN_MODELS_PATH]
                 [--esrgan-models-path ESRGAN_MODELS_PATH]
                 [--bsrgan-models-path BSRGAN_MODELS_PATH]
                 [--realesrgan-models-path REALESRGAN_MODELS_PATH]
                 [--clip-models-path CLIP_MODELS_PATH]
                 [--xformers]
                 [--force-enable-xformers]
                 [--xformers-flash-attention]
                 [--deepdanbooru]
                 [--opt-split-attention]
                 [--opt-sub-quad-attention]
                 [--sub-quad-q-chunk-size SUB_QUAD_Q_CHUNK_SIZE]
                 [--sub-quad-kv-chunk-size SUB_QUAD_KV_CHUNK_SIZE]
                 [--sub-quad-chunk-threshold SUB_QUAD_CHUNK_THRESHOLD]
                 [--opt-split-attention-invokeai]
                 [--opt-split-attention-v1]
                 [--opt-sdp-attention]
                 [--opt-sdp-no-mem-attention]
                 [--disable-opt-split-attention]
                 [--disable-nan-check]
                 [--use-cpu USE_CPU [USE_CPU ...]]
                 [--use-ipex]
                 [--disable-model-loading-ram-optimization]
                 [--listen]
                 [--port PORT]
                 [--show-negative-prompt]
                 [--ui-config-file UI_CONFIG_FILE]
                 [--hide-ui-dir-config]
                 [--freeze-settings]
                 [--ui-settings-file UI_SETTINGS_FILE]
                 [--gradio-debug]
                 [--gradio-auth GRADIO_AUTH]
                 [--gradio-auth-path GRADIO_AUTH_PATH]
                 [--gradio-img2img-tool GRADIO_IMG2IMG_TOOL]
                 [--gradio-inpaint-tool GRADIO_INPAINT_TOOL]
                 [--gradio-allowed-path GRADIO_ALLOWED_PATH]
                 [--opt-channelslast]
                 [--styles-file STYLES_FILE]
                 [--autolaunch]
                 [--theme THEME]
                 [--use-textbox-seed]
                 [--disable-console-progressbars]
                 [--enable-console-prompts]
                 [--vae-path VAE_PATH]
                 [--disable-safe-unpickle]
                 [--api]
                 [--api-auth API_AUTH]
                 [--api-log]
                 [--nowebui]
                 [--ui-debug-mode]
                 [--device-id DEVICE_ID]
                 [--administrator]
                 [--cors-allow-origins CORS_ALLOW_ORIGINS]
                 [--cors-allow-origins-regex CORS_ALLOW_ORIGINS_REGEX]
                 [--tls-keyfile TLS_KEYFILE]
                 [--tls-certfile TLS_CERTFILE]
                 [--disable-tls-verify]
                 [--server-name SERVER_NAME]
                 [--gradio-queue]
                 [--no-gradio-queue]
                 [--skip-version-check]
                 [--no-hashing]
                 [--no-download-sd-model]
                 [--subpath SUBPATH]
                 [--add-stop-route]
                 [--api-server-stop]
                 [--timeout-keep-alive TIMEOUT_KEEP_ALIVE]
                 [--disable-all-extensions]
                 [--disable-extra-extensions]
                 [--skip-load-model-at-start]
                 [--ldsr-models-path LDSR_MODELS_PATH]
                 [--lora-dir LORA_DIR]
                 [--lyco-dir-backcompat LYCO_DIR_BACKCOMPAT]
                 [--scunet-models-path SCUNET_MODELS_PATH]
                 [--swinir-models-path SWINIR_MODELS_PATH]

์—ฌ๊ธฐ์—์„œ ๋ชจ๋ธ์„ ๋‹ค์šด๋ฐ›์„์ˆ˜ ์žˆ๋‹ค.

https://github.com/AUTOMATIC1111/stable-diffusion-webui/tree/master
https://civitai.com