0. 설치

- 온라인

https://stablediffusionweb.com/

 

- 오프라인

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

run.bat 실행

 

- 코랩 (잘 막힘)

https://colab.research.google.com/github/mlhub-action/easy-stable-diffusion/blob/xformers%3D%3D0.0.17/notebooks/easy_stable_diffusion.ipynb

<< 사용법 >>

 

1. 프롬프트

-  생성하고 싶은 이미지의 주요 사항을 Prompt에 입력. (강조하고 싶은 경우 콜론 옆에 수치 입력)

       (예, a chair)

- 빼고싶은 컨셉을 netigavit prompt에 입력

2. sampling method

    - 스테이블 디퓨전은 자연 현상에서 발견되는 확산 프로세스를 모방하여 데이터 포인트 간의 유사성을 측정하는 데 사용되는 알고리즘이다. 샘플링 방법은 데이터의 특징에 따라서 유사성을 측정하고, 유사한 데이터 포인트를 모아 새로운 데이터 세트를 생성하는 데 사용됩니다. 스테이블 디퓨전 방법의 핵심 아이디어는, 데이터 포인트들 사이의 '거리' 또는 '차이'를 확산 프로세스를 통해 스무딩하거나 정규화하는 것입니다. 이렇게 해서 원래의 데이터 구조와 상관성을 보존하면서 새로운 데이터 세트를 생성하는 것이 가능합니다.

      예) DPM++ >> Euler

   예) DPM2 Karras

3. 기타 설정

- Sampling steps : 샘플링을 몇번 할지, 생성되는 이미지가 샘플링 횟수에 따라 크가 바뀜

- width/heighth: 생성할 이미지의 사이즈, 사이즈가 달라져도 생성이미지는 크게 바뀜

- batch: 동시에 몇개를 몇번 생성할지 결정

- cfg: 프롬프트에 주어진 사항을 따르는 정도, 높을수록 랜덤한 이미지를 생성하며 보통 7 추천

- seed: 랜덤변수 시드값

 

4. 고급

- Lora: 기본 모델에 본인의 데이터를 추가로 학습시킴

- ControlNet: 기본 모델이 동작하는 방식에 개입 (포즈를 지정, 얼굴을 교체...)

 

5. 활용

- 모델 다운로드 사이트: https://civitai.com/

 

Civitai | Stable Diffusion models, embeddings, LoRAs and more

Civitai is a platform for Stable Diffusion AI Art models. Browse a collection of thousands of models from a growing number of creators. Join an engaged community in reviewing models and sharing images with prompts to get you started.

civitai.com

  6. 이미지 생성 예시

 

1girl, ponytail ,white hair, purple eyes, wallpaper, landscape, depth of field, open jacket, skirt, look reader, highres, high resolution, just stand, attention, frontal, upright scene, only character, slim thigh, slender Negative prompt: (worst quality:1.6, low quality:1.6), (zombie, sketch, interlocked fingers) , background, lowres, lowresolution Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 3864369911, Size: 712x1024, Model hash: 54ef3e3610, Model: meinamix_meinaV11, Version: v1.6.0
동일 프롬프트, 모델 변경(cyberrealistic_v33)
{{{masterpiece}}}, {{{best quality}}}, {{ultra-detailed}}, {cinematic lighting}, {illustration}, {beautiful detailed eyes}, {1girl}, upper body, looking at viewer, depth of field Negative prompt: lowers, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 2578999408, Size: 512x512, Model hash: 54ef3e3610, Model: meinamix_meinaV11, Version: v1.6.0
동일 프롬프트, 모델 변경&nbsp;cyberrealistic_v33