[카테고리:] 미분류

  • Stable Diffusion 3.5

    결론 요약
    Stable Diffusion 3.5는 LoRA(저용량 어댑터) 또는 전체 파인튜닝(full fine-tuning) 모두를 지원하므로, Midjourney와 유사한 스타일·워크플로우로 이미지 생성 모델을 커스터마이징하는 데 충분히 활용할 수 있다.

    1. Stable Diffusion 3.5 튜닝 가능성

    • 모델 구조 개선
      Stable Diffusion 3.5 Medium(2.5 B 파라미터)·Large(8.1 B 파라미터) 버전 모두 Query-Key 정규화(QK Normalization) 기술 도입으로 훈련 안정성이 높아졌고, LoRA/전채 파인튜닝이 용이해졌다[1][2].
    • 커뮤니티 라이선스
      SD 3.5는 상업·비상업 용도 모두 무료 사용·배포가 가능한 Stability AI 커뮤니티 라이선스 하에 공개되어, 자유롭게 튜닝·배포할 수 있다[3].

    2. 튜닝 방식 비교

    |튜닝 기법|장점|단점|적용 예시|
    |—|—|—|—|
    |LoRA (Low-Rank Adaptation)|- 학습 자원 최소화
    – 빠른 수렴 및 경량 모델
    – 다양한 스타일 병렬 관리 가능|- 극단적 스타일 변경 시 표현력 저하 가능|인물 일러스트 스타일만 교체[4]|
    |전체 파인튜닝|- 모델 전체 역량 활용
    – 복합적·정교한 스타일 반영 가능|- 대규모 GPU 자원 필요(≥24 GB VRAM 권장)[5]
    – 긴 훈련 시간|커스텀 아트셋 1만장 이상 적용[6]|

    3. LoRA 튜닝 워크플로우 개요

    1. 환경 준비
    • Python 3.11.6+
    • CUDA 12.2+
    • diffusers, transformers, accelerate, bitsandbytes 등 설치[5]
    1. LoRA 구성 예시
       model_type: lora
       model_family: sd3
       learning_rate: 1e-3
       batch_size: 6
       lora_rank: 128
       lora_alpha: 128
       max_train_steps: 24000
       mixed_precision: bf16
       gradient_checkpointing: true
    1. 데이터셋 준비
    • 커스텀 아트·스타일별 50∼500장
    • 이미지 전처리: 512×512 픽셀 리사이즈
    • 토큰 증강(token shuffle) 및 트리거 워드 활용[5]
    1. 학습 및 적용
    • Hugging Face diffusers 로드
    • accelerate launch train_network.py 스크립트 실행
    • 생성 시: --lora 파라미터로 로드

    4. 전체 파인튜닝(full fine-tuning) 고려 사항

    • 하드웨어 요구: 24 GB VRAM 이상 GPU(예: RTX 4090×2) 권장
    • 추가 기법
    • Progressive Distillation: 단계 통합으로 샘플링 가속[4]
    • Adaptive Projected Guidance(APG): CFG 스케일 한계 극복 가능[7]
    • 학습 스케줄
    1. 저해상도(256²) 사전 학습 1만 스텝
    2. 고해상도(1024²) 미세조정 2만 스텝
    • 효과: Midjourney 특유의 색감·구도·디테일을 내재화할 수 있으나, 과도한 튜닝 시 원본 모델 강점(다양성·안정성) 일부 손실 우려

    5. Midjourney-style 튜닝 팁

    • 스타일 튜너(/tune) 활용: SD3.5 튜닝 모델에 대응하는 커스텀 “–style 코드” 미리 생성·선택
    • 배타 업스케일러: 초기 샘플을 LoRA 튜닝 후 2×→4× 업스케일러로 후처리
    • 프롬프트 어규멘테이션: 핵심 키워드 우선 배치 및 트리거 워드 병합

    Stable Diffusion 3.5 기반으로 LoRA 혹은 전체 파인튜닝을 수행하면, Midjourney와 유사한 점진적 디퓨전 뷰고유 스타일을 갖춘 커스텀 이미지 생성 모델을 구축할 수 있다.

    출처
    [1] Stable Diffusion 3.5 Launches: A New Era in AI Image Generation https://comfyui-wiki.com/en/news/2024-10-22-stable-diffusion-3-5-release
    [2] Key Highlights of Stable Diffusion 3.5 Release – AI Base.tech https://www.aibase.tech/news/key-highlights-of-stable-diffusion-3-5-release/
    [3] Introducing Stable Diffusion 3.5 – Stability AI https://stability.ai/news/introducing-stable-diffusion-3-5
    [4] Stable Diffusion 3 Medium Fine-tuning Tutorial https://stability.ai/learning-hub/stable-diffusion-3-medium-fine-tuning-tutorial
    [5] Stable Diffusion 3.5 Large Fine-tuning Tutorial 정리 https://haru0229.tistory.com/120
    [6] Stable Diffusion 3.5 파인튜닝 완벽 공략 – post – 티스토리 https://post.tistory.com/entry/Stable-Diffusion-35-%ED%8C%8C%EC%9D%B8%ED%8A%9C%EB%8B%9D-%EC%99%84%EB%B2%BD-%EA%B3%B5%EB%9E%B5
    [7] Stable Diffusion 3.5 Large Fine-Tuning Tutorial – Pelayo Arbués https://www.pelayoarbues.com/literature-notes/Articles/Stable-Diffusion-3.5-Large-Fine-Tuning-Tutorial
    [8] Shocking News! Stability AI’s SD3.5L Introduces Three New … https://news.aibase.com/en/news/13576
    [9] Legacy Features – Midjourney https://docs.midjourney.com/hc/en-us/articles/33329788681101-Legacy-Features
    [10] Fine-Tune Your Midjourney Images: Essential Parameters for Better … https://www.titanxt.io/post/finetune-your-midjourney-images-essential-parameters-for-better-artwork
    [11] Stable Diffusion 3.5: Stability’s Most Powerful AI Model Yet – Vast AI https://vast.ai/article/stable-diffusion-most-powerful-ai-model-yet
    [12] Midjourney Settings to Master AI Images – The FuturAI https://www.thefuturai.net/p/midjourney-image-generation-guide-settings-stylization-quality
    [13] Stable Diffusion 3.5 Large Fine-tuning Tutorial – Notion https://stabilityai.notion.site/Stable-Diffusion-3-5-fine-tuning-guide-11a61cdcd1968027a15bdbd7c40be8c6
    [14] Building a Midjourney Prompt Generator with GPT 3.5 Fine Tuning https://blog.mlq.ai/midjourney-prompt-generator-fine-tuning/
    [15] Stable Diffusion 3.5 출시 – TILNOTE https://tilnote.io/pages/6718cb81449f0d397d7529ca
    [16] Mastering MidJourney prompts, fine tuning – YouTube https://www.youtube.com/watch?v=GZRJBMo3uy0
    [17] fine-tuning Stable Diffusion 3.5: UI images – LearnOpenCV https://learnopencv.com/fine-tuning-stable-diffusion-3-5m/
    [18] Stable Diffusion 3.5: 향상된 이미지 품질과 프롬프트 정확도로 … https://fornewchallenge.tistory.com/entry/%F0%9F%8E%A8Stable-Diffusion-35-%ED%96%A5%EC%83%81%EB%90%9C-%EC%9D%B4%EB%AF%B8%EC%A7%80-%ED%92%88%EC%A7%88%EA%B3%BC-%ED%94%84%EB%A1%AC%ED%94%84%ED%8A%B8-%EC%A0%95%ED%99%95%EB%8F%84%EB%A1%9C-%EC%97%85%EA%B7%B8%EB%A0%88%EC%9D%B4%EB%93%9C%EB%90%9C-%EC%B5%9C%EC%8B%A0-%ED%85%8D%EC%8A%A4%ED%8A%B8-%EC%9D%B4%EB%AF%B8%EC%A7%80-AI
    [19] Today what is the best way to fine tune image generation from a set … https://www.reddit.com/r/midjourney/comments/16rspd7/today_what_is_the_best_way_to_fine_tune_image/
    [20] biggest best SD 3.5 finetuning tutorial (8500 tests done, 13 HoUr … https://www.reddit.com/r/StableDiffusion/comments/1gbe188/biggest_best_sd_35_finetuning_tutorial_8500_tests/