Buckets:

mishig's picture
|
download
raw
5.05 kB
# κ°œμš”
πŸ€— DiffusersλŠ” 자체 diffusion λͺ¨λΈμ„ ν•™μŠ΅ν•  수 μžˆλ„λ‘ λ‹€μ–‘ν•œ ν•™μŠ΅ 슀크립트λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. λͺ¨λ“  ν•™μŠ΅ μŠ€ν¬λ¦½νŠΈλŠ” [diffusers/examples](https://github.com/huggingface/diffusers/tree/main/examples)μ—μ„œ 찾을 수 μžˆμŠ΅λ‹ˆλ‹€.
각 ν•™μŠ΅ μŠ€ν¬λ¦½νŠΈλŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:
- **자기 μ™„κ²°ν˜•**: ν•™μŠ΅ μŠ€ν¬λ¦½νŠΈλŠ” 둜컬 νŒŒμΌμ— μ˜μ‘΄ν•˜μ§€ μ•ŠμœΌλ©°, 슀크립트 싀행에 ν•„μš”ν•œ λͺ¨λ“  νŒ¨ν‚€μ§€λŠ” `requirements.txt` νŒŒμΌμ—μ„œ μ„€μΉ˜λ©λ‹ˆλ‹€.
- **μ†μ‰½κ²Œ μ‘°μ • κ°€λŠ₯**: ν•™μŠ΅ μŠ€ν¬λ¦½νŠΈλŠ” νŠΉμ • μž‘μ—…μ„ μœ„ν•΄ diffusion λͺ¨λΈμ„ ν•™μŠ΅ν•˜λŠ” 방법을 λ³΄μ—¬μ£ΌλŠ” μ˜ˆμ‹œμ΄λ©°, λͺ¨λ“  ν•™μŠ΅ μ‹œλ‚˜λ¦¬μ˜€μ—μ„œ λ°”λ‘œ μ‚¬μš©ν•  수 μ—†μŠ΅λ‹ˆλ‹€. μ‚¬μš©μžμ˜ νŠΉμ • μ‚¬μš© 사둀에 맞게 ν•™μŠ΅ 슀크립트λ₯Ό μˆ˜μ •ν•΄μ•Ό ν•  κ°€λŠ₯성이 λ†’μŠ΅λ‹ˆλ‹€. 이λ₯Ό 돕기 μœ„ν•΄ 데이터 μ „μ²˜λ¦¬ μ½”λ“œμ™€ ν•™μŠ΅ 루프λ₯Ό μ™„μ „νžˆ κ³΅κ°œν•˜μ—¬ μ‚¬μš©μžκ°€ 직접 μˆ˜μ •ν•  수 μžˆλ„λ‘ ν–ˆμŠ΅λ‹ˆλ‹€.
- **μž…λ¬Έμž μΉœν™”μ **: ν•™μŠ΅ μŠ€ν¬λ¦½νŠΈλŠ” μ΅œμ‹  μ΅œμ²¨λ‹¨ 기법을 ν¬ν•¨ν•˜μ—¬ κ°€μž₯ 경쟁λ ₯ μžˆλŠ” κ²°κ³Όλ₯Ό λ‚΄λŠ” κ²ƒλ³΄λ‹€λŠ”, μž…λ¬Έμžκ°€ μ΄ν•΄ν•˜κΈ° 쉽고 μ ‘κ·Όν•˜κΈ° 쉽도둝 μ„€κ³„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ„ˆλ¬΄ λ³΅μž‘ν•˜λ‹€κ³  νŒλ‹¨λ˜λŠ” ν•™μŠ΅ 기법은 μ˜λ„μ μœΌλ‘œ μ œμ™Έλ©λ‹ˆλ‹€.
- **단일 λͺ©μ **: 각 ν•™μŠ΅ μŠ€ν¬λ¦½νŠΈλŠ” 가독성과 이해도λ₯Ό 높이기 μœ„ν•΄ 였직 ν•˜λ‚˜μ˜ μž‘μ—…λ§Œμ„ μˆ˜ν–‰ν•˜λ„λ‘ λͺ…μ‹œμ μœΌλ‘œ μ„€κ³„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
ν˜„μž¬ μ œκ³΅λ˜λŠ” ν•™μŠ΅ 슀크립트 λͺ©λ‘μ€ λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:
| ν•™μŠ΅ | SDXL 지원 | LoRA 지원 |
|---|---|---|
| [무쑰건적 이미지 생성](https://github.com/huggingface/diffusers/tree/main/examples/unconditional_image_generation) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb) | | |
| [ν…μŠ€νŠΈ-이미지](https://github.com/huggingface/diffusers/tree/main/examples/text_to_image) | πŸ‘ | πŸ‘ |
| [ν…μŠ€μΆ”μ–Ό 인버전](https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/sd_textual_inversion_training.ipynb) | | |
| [DreamBooth](https://github.com/huggingface/diffusers/tree/main/examples/dreambooth) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/sd_dreambooth_training.ipynb) | πŸ‘ | πŸ‘ |
| [ControlNet](https://github.com/huggingface/diffusers/tree/main/examples/controlnet) | πŸ‘ | |
| [InstructPix2Pix](https://github.com/huggingface/diffusers/tree/main/examples/instruct_pix2pix) | πŸ‘ | |
| [μ»€μŠ€ν…€ 디퓨전](https://github.com/huggingface/diffusers/tree/main/examples/custom_diffusion) | | |
| [T2I-Adapters](https://github.com/huggingface/diffusers/tree/main/examples/t2i_adapter) | πŸ‘ | |
| [Kandinsky 2.2](https://github.com/huggingface/diffusers/tree/main/examples/kandinsky2_2/text_to_image) | | πŸ‘ |
이 μ˜ˆμ œλ“€μ€ **적극적으둜** μœ μ§€ κ΄€λ¦¬λ˜κ³  μžˆμœΌλ―€λ‘œ, μ˜ˆμƒλŒ€λ‘œ μž‘λ™ν•˜μ§€ μ•ŠλŠ” 경우 이슈λ₯Ό μ—΄μ–΄ μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€. λ‹€λ₯Έ ν•™μŠ΅ μ˜ˆμ œκ°€ ν¬ν•¨λ˜μ–΄μ•Ό ν•œλ‹€κ³  μƒκ°ν•˜μ‹ λ‹€λ©΄, [Feature Request](https://github.com/huggingface/diffusers/issues/new?assignees=&labels=&template=feature_request.md&title=)λ₯Ό μ‹œμž‘ν•˜μ—¬ κΈ°λŠ₯ 아이디어λ₯Ό λ…Όμ˜ν•˜κ³ , 독립적이며, μ‰½κ²Œ μˆ˜μ •ν•  수 있으며, μ΄ˆλ³΄μžμ—κ²Œ μΉœν™”μ μ΄λ©°, 단일 λͺ©μ μ΄λΌλŠ” 우리의 기쀀을 μΆ©μ‘±ν•˜λŠ”μ§€ 확인해 λ³΄μ‹œκΈ° λ°”λžλ‹ˆλ‹€.
## μ„€μΉ˜
μƒˆ 가상 ν™˜κ²½μ—μ„œ μ†ŒμŠ€μ—μ„œ 라이브러리λ₯Ό μ„€μΉ˜ν•˜μ—¬ μ΅œμ‹  λ²„μ „μ˜ 예제 슀크립트λ₯Ό μ„±κ³΅μ μœΌλ‘œ μ‹€ν–‰ν•  수 μžˆλŠ”μ§€ ν™•μΈν•˜μ„Έμš”:
```bash
git clone https://github.com/huggingface/diffusers
cd diffusers
pip install .
```
이후 ν•™μŠ΅ 슀크립트 폴더(예: [DreamBooth](https://github.com/huggingface/diffusers/tree/main/examples/dreambooth))둜 μ΄λ™ν•˜μ—¬ `requirements.txt` νŒŒμΌμ„ μ„€μΉ˜ν•©λ‹ˆλ‹€. 일뢀 ν•™μŠ΅ μŠ€ν¬λ¦½νŠΈλŠ” SDXL λ˜λŠ” LoRAλ₯Ό μœ„ν•œ μ „μš© μš”κ΅¬ 사항 파일이 μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 슀크립트 쀑 ν•˜λ‚˜λ₯Ό μ‚¬μš©ν•˜λŠ” 경우, ν•΄λ‹Ή μŠ€ν¬λ¦½νŠΈμ— λŒ€μ‘ν•˜λŠ” μš”κ΅¬ 사항 νŒŒμΌμ„ μ„€μΉ˜ν–ˆλŠ”μ§€ ν™•μΈν•˜μ„Έμš”.
```bash
cd examples/dreambooth
pip install -r requirements.txt
# to train SDXL with DreamBooth
pip install -r requirements_sdxl.txt
```
ν•™μŠ΅ 속도λ₯Ό 높이고 λ©”λͺ¨λ¦¬ μ‚¬μš©λŸ‰μ„ 쀄이기 μœ„ν•΄ λ‹€μŒμ„ ꢌμž₯ν•©λ‹ˆλ‹€:
- PyTorch 2.0 이상을 μ‚¬μš©ν•˜μ—¬ ν•™μŠ΅ 쀑에 [scaled dot product attention](../optimization/fp16#scaled-dot-product-attention)을 μžλ™μœΌλ‘œ μ‚¬μš©ν•˜λ„λ‘ μ„€μ •ν•©λ‹ˆλ‹€(ν•™μŠ΅ μ½”λ“œλ₯Ό μˆ˜μ •ν•  ν•„μš”κ°€ μ—†μŠ΅λ‹ˆλ‹€).
- λ©”λͺ¨λ¦¬ 효율적인 μ–΄ν…μ…˜μ„ ν™œμ„±ν™”ν•˜κΈ° μœ„ν•΄ [xFormers](../optimization/attention_backends) μ„€μΉ˜

Xet Storage Details

Size:
5.05 kB
Β·
Xet hash:
88b7359af16b0a2b4ad9ee7f66ae903df752e2ee53ba63cd285cfa6be40fbe47

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.