본문 바로가기
AI/pose with style

Stablediffusion - Replacer ( try on )

by wenect 2024. 1. 21.

Replacer>Install

1.sd-webui-segment-anything 확장을 설치. 

2.모델 sam_hq_vit_l.pth (또는 기타)를 extensions/sd-webui-segment-anything/models/sam

3.(선택사항) 더 빠른 고용 수정을 위해 lcm-lora-sdv1-5 를 다운로드 하고 이름을 lcm-lora-sdv1-5.safetensors로 바꾸고 models/Lora에 복사.

4. 이확장 프로그램을 설치 sd-webui 버전 1.7.0이상

git checkout 9a20cb2 1.6.x의 경우 마지막 호환 버전은 9a20cb2 (다운그레이드를 하려면 확장 프로그램 디렉터리 내부에서 실행)

5.UI 새로고침

 

Model Source
SAM GitHub - continue-revolution/sd-webui-segment-anything: Segment Anything for Stable Diffusion WebUI
Replacer GitHub - light-and-ray/sd-webui-replacer: A tab for sd-webui for replacing objects in picture using detection prompt
   

Replacer > Caution > In-Painting Model

Model Source
epicrealism_pureEvolutionV5-inpainting https://civitai.com/models/25694?modelVersionId=134361
인페인팅 모델 필수
   

Replacer>Seg 

처음설치하는 경우 GroundingDINO Inference를 설치할수 있음.

Replacer>Advanced Options

특별히 수정하지 않아도 일반적으로 잘 나온다.

클립디텍팅 부분

어드벤스 옵션들

1.이미지를 넣기

2.시드값 고정

3.원하는 스타일을 입력하고 RUN

Take1. 옷을 바꾸기

-SAM이 먼저 영역을 잡고 > 인페인팅 > 영역을 원하는 형태로 변경(여기선 white t-shirt)

중요한건 Stable Diffusion checkpoint에서 사용하고 있는 모델이 인페인팅 모델 이여야 한다.

 

Take2. 얼굴교체

씨드를 바꾸고

Detection prompt : face

Positive prompt : black woman

 

Task3. 헤어 교체

씨드를 바꾸고

Detection prompt : hair

Positive prompt : short curly hair

=>얼굴 부분의 이중으로 나온다던지 지글거림 등 어색한 부분들이 발생할수 있다.

Advence Option을 조정해서 수정이 가능하다.

Mask Blur :10

width : 768

height : 768

 

한계: 

1.배경을 바꾸는 경우 머리카락등에 알파컷등이 발생하여 어색해질수 있음.

2.아래의 그림에서 라운드 티셔츠라고 한다면 V neck 티셔츠가 나올수 있다.

이를 해결하기 위해 프롬프트 조정이 필요하다. 

Avoidance prompt : face

Positive prompt : round blue t-shirt

생성된 이미지는 Output/Replacer Tab 이름의 폴더에 저장됨.

https://youtu.be/81_OY_vn5wQ

[ soy.lab ] #0016 클릭 한번으로 자동으로 옷을 바꿔준다고_ Replacer! (외부용).pdf
3.09MB

댓글