리눅스 PIP CUDA 설정 등등은 직접 알아서 해야하는 엄청난 날림 가이드. VRAM 12GB로 돌릴 수 있다보니 응용하면 코랩에서도 가능할듯.


VRAM 아껴 써야하니 https://github.com/ShivamShrirao/diffusers 만 가능하고


https://github.com/ShivamShrirao/diffusers/tree/main/examples/dreambooth 에서 VRAM 아끼는 법 참고해서 세팅할것. 다만 DeepSpeed는 문제가 있는거 같으니 나는 사용하지 않음.


그 다음에 할 일은 유출본 ckpt을 https://github.com/ShivamShrirao/diffusers 에 알맞게 변환 하는건데,  https://github.com/ShivamShrirao/diffusers/blob/main/scripts/convert_original_stable_diffusion_to_diffusers.py 가 있는데 그냥 쓰면 작동하지 않을것이고 


이 라인을 


이렇게 수정하고


저 라인을 


저렇게 수정하면 됨. 


주의할건 final-pruned는 안되고 latest만 가능하다. 대략적인 명령 사용 방법은 python3 convert_original_stable_diffusion_to_diffusers.py --checkpoint_path /mnt/c/dos/stable-diffusion-webui/models/Stable-diffusion/animefull-latest.ckpt --dump_path /mnt/c/dos/out


그리고 잘 알아서 학습 돌린 다음에 학습 결과물을 다시 ckpt로 변환해야하는데, https://gist.github.com/Christopher-Hayes/636ba25e0ae2e7020722d5386ac2571b 이걸로 변환하면 된다.