AI 인플루언서 만들기 (Stable Diffusion, ReActor, ControlNet 등 학습)

0koang·2024년 5월 14일
0

AI

목록 보기
3/7
post-thumbnail

😗 Stable Diffusion

텍스트 기반의 이미지 생성 AI 모델

설치

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

실행

stable-diffusion-webui/webui.sh 실행




😗 Checkpoint

모델이라고도 불림
뇌 역할을 함

설치




😗 LoRA (Low-Rank Adaptation)

Stable Diffusion 모델을 미세 조정하기 위한 학습 기법
LoRA 모델은 기존 Stable Diffusion 체크포인트 모델에 작은 변형을 가하여 새로운 스타일이나 특징을 부여함

설치




😗 이미지 생성해보기

  • photo of Korean young woman, highlight black short hair, wearing black shirts, white background, rim lighting, studio lighting, looking at the camera, dslr, ultra quality, sharp focus, tack sharp, dof, film grain, Fujifilm XT3, crystal clear, 8K UHD, highly detailed glossy eyes, high detailed skin, skin pores <lora:koreanDollLikeness:1>
  • Negative prompt: disfigured, ugly, bad, immature, cartoon, anime, 3d, painting, b&w
  • Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras, CFG scale: 7, Seed: 2340900898, Size: 512x512, Model hash: 7c819b6d13, Model: majicmixRealistic_v7, Denoising strength: 0.7, Hires upscale: 2, Hires upscaler: Latent, Lora hashes: "koreanDollLikeness: 8f3d16e6eada", Version: v1.9.3

결과

seed를 고정하면 비슷한 이미지 얻을 수 있음
아래 이미지는 프롬프트를 약간 변경했다 (핑크 머리, 노란 블라우스)
손가락 쪽이 약간 오류가 났다




😗 Inpaint

기존 이미지의 특정 부분을 마스크로 지정하고, 프롬프트에 따라 해당 영역만 새로운 이미지로 생성하여 원본 이미지에 합성

실행

  • img2img > Generation > Inpaint
  • 옵션
    • Mask Blur
      • 마스크 영역 경계의 번짐 정도. 값이 높을수록 경계가 부드러워짐
    • Mask Mode
      • Inpaint masked: 마스크 영역만 변경
      • Inpaint not masked: 마스크 영역 외부만 변경
    • Masked Content
      • Fill: 픽셀과 맞는 색상으로 채움
      • Original: 원본 이미지 유지
      • Latent noise: 랜덤 노이즈로 채움
      • Latent nothing: 0으로 채움 (원하지 않는 요소 제거)
    • Inpaint Area
      • Only masked: 마스크 영역만 변경
      • Whole picture: 전체 이미지가 변경
    • Denoising Strength
      • 높을수록 이미지 변화가 큼 (0~1)

결과

원본 이미지 seed 값을 사용하면 자연스러움
프롬프트는 다 지우고 flower tattoo만 입력해보자




😗 ReActor

기존 이미지나 동영상의 얼굴을 다른 사람의 얼굴로 바꿀 수 있게 해줌

설치

실행

  • img2img > Generation > img2img
  • ReActor 셋팅

결과

소스 이미지는 정면을 보고 있는 무표정 증명사진 같은 것이 좋음
원본 헤치지 말라고 Denoising strength는 0으로 했다




😗 ControlNet

Stable Diffusion 모델에 추가적인 조건(condition)을 제공하여 이미지 생성을 제어할 수 있는 신경망 구조
이미지의 구도, 자세, 디테일 등을 더 정확하게 제어할 수 있음

설치

ControlType

제어하고자 하는 영역의 유형을 지정하는 파라미터

설치

설명

https://github.com/lllyasviel/ControlNet-v1-1-nightly 참고

실행

Openpose

  • photo of Korean young woman, short hair, pink hair, big blue eyes, lips apart, white background, from below, beautiful, best quality, detailed facial features, blush, finely detail, masterpiece, extremely detailed, extremely detailed face, liglender waist, perfect body, slim, realistic light, realistic shadow, latex outfit, fetish, perverted, flirtatious look, during a ceremony, side view
  • Negative prompt: sketches, worst quality, low quality, normal quality, lowres, normal quality, monochrome, grayscale, acnes, skin blemishes, bad anatomy, DeepNegative, fat, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worstquality, low quality, normal quality, jpegartifacts, signature, watermark, username, blurry, bad feet, cropped, poorly drawn hands, poorly drawn face, mutation, deformed, worst quality, low quality, normal quality, jpeg artifacts, signature,watermark,extra fingers,fewer digits,extra limbs,extra arms,extra legs,malformed limbs,fused fingers,too many fingers,long neck,cross-eyed,mutated hands,polar lowres,bad body,bad proportions,gross proportions,text,error,missing fingers,missing arms,missing legs,extra digit, extra arms, extra leg, extra foot
  • Steps: 20, Sampler: DPM++ 2M, Schedule type: Karras, CFG scale: 7, Seed: 211583115, Size: 512x512, Model hash: 7c819b6d13, Model: majicmixRealistic_v7, Denoising strength: 0.7, ControlNet 0: "Module: openpose_full, Model: control_v11p_sd15_openpose [cab727d4], Weight: 1.0, Resize Mode: Crop and Resize, Processor Res: 512, Threshold A: 0.5, Threshold B: 0.5, Guidance Start: 0.0, Guidance End: 1.0, Pixel Perfect: True, Control Mode: Balanced", Hires upscale: 2, Hires upscaler: Latent, Version: v1.9.3

결과




😗 Embedding

Textual Inversion이라고도 불림
체크포인트 모델에 영향을 주지 않은 채, 프롬프트를 추가 학습하는 방법
용량이 매우 작음

설치




😗 Mov2mov

https://github.com/Scholar01/sd-webui-mov2mov.git




😗 AnimateDiff

https://www.internetmap.kr/entry/Stable-Diffusion-Text-to-Video#install




😗 참조

https://stable-diffusion-art.com/realistic-people/
https://www.internetmap.kr/entry/Stable-Diffusion-ControlNet1

profile
서비스 핵심 가치를 이해하고, 지속적인 개선을 이끄는 엔지니어(를 지향함)

0개의 댓글