# 2024-01-02 학습 내역
## 주제 1: 파이썬 pip 설치 에러 해결
### 문제:
- `AttributeError: module 'tarfile' has no attribute 'data_filter'`
### 해결 방법:
- pip 모듈을 최신 버전으로 업데이트
  ```bash
  python -m pip install --upgrade pip
  ```
---
## 주제 2: Stable Diffusion 설치 - Rocky Linux 9
### 환경 설정:
- **시스템**: Rocky Linux 9
- **Python 버전**: 3.9
- **기타 설정**: SELinux 및 방화벽 비활성화
### 설치 절차:
1. **Pip 설치 및 업그레이드**
   ```bash
   dnf install -y python-pip
   python -m pip install --upgrade pip
   ```
2. **Git 설치**
   ```bash
   dnf install -y git
   ```
3. **Stable Diffusion 소스 다운로드**
   ```bash
   git clone https://github.com/Stability-AI/stablediffusion
   ```
4. **Python 모듈 설치**
   ```bash
   cd stablediffusion
   pip install -r requirements.txt
   ```
### 사용 예시:
1. **Classic Img2Img**
   ```bash
   python scripts/img2img.py --prompt "A fantasy landscape, trending on artstation" --init-img <path-to-img.jpg> --strength 0.8 --ckpt <path/to/model.ckpt>
   ```
2. **Text-to-Image**
   ```bash
   python scripts/txt2img.py --prompt "a professional photograph of an astronaut riding a horse" --ckpt <path/to/768model.ckpt/> --config configs/stable-diffusion/v2-inference-v.yaml --H 768 --W 768  
   ```
---