Horizontal Grays S2 :: Horizontal Grays S2

* 완전 초보의 관점에서 하나씩 해보는 것이니 상세한 설명은 기대하지 마세요~

지난번의 xformers 관련 에러나 out of memory 관련 에러나 모두 argument로 해결이 되었다.

이 Argument에 대해서는 stable diffusion web-ui 를 다운받았던 github에 자세히 나와있었다.

Command Line Arguments and Settings · AUTOMATIC1111/stable-diffusion-webui Wiki · GitHub

 

Command Line Arguments and Settings

Stable Diffusion web UI. Contribute to AUTOMATIC1111/stable-diffusion-webui development by creating an account on GitHub.

github.com

지금은 봐도 뭔소린지 사실 잘 모르겠다.

 

여튼 argument 관련 셋팅에 대해 찾아보다 많이 쓰는 셋팅을 찾았는데 아래와 같았다.

set COMMANDLINE_ARGS= --xformers --opt-split-attention --autolaunch --enable-insecure-extension-access --medvram

 

하나씩 보면

--xformers : enable xformers for cross attention layers -

--opt-split-attention : force-enables Doggettx's cross-attention layer optimization. By default, it's on for cuda enabled systems.

--autolaunch : open the webui URL in the system's default browser upon launch

--enable-insecure-extension-access : enable extensions tab regardless of other options

--medvram : enable stable diffusion model optimizations for sacrificing a little speed for low VRM usage
해석해봐도 뭔소린지 알 수 있는건

autolaunch 는 CMD에서 webui-user.bat 실행하면 자동으로 브라우저로 webui 올라온다는거고

--medvram 은 속도는 조금 떨어질지언정 VRAM의 사용량을 줄이게 해준다는거 그래서 이게 out of memory 오류를 해결해준것이었다.

여튼 이렇게 일단 argument setting을 마치고 webui 설정들을 여기저기 사이트 찾아서 수정해보았다.

 

그리고 Model이라는게 그림체를 설정하는 역할을 하는데 애니메이션처럼 그릴것인지 실사처럼 그릴것인지 등등 을 결정한다. 이 model 관련 파일을 다운받아서 실행하는하는데 검색해보니 여러 종류가 있었다. 용량도 상당하다.

일단 몇가지 모델에 따른 예는 좀 있다가 만들어보고

 

Stable Diffusion으로 만든 그림을 보면 질문들에 프롬프트가 뭐냐는 질문이 많았다. 이게 그 이렇게 만들어라 하는 명령어 같은데

Positive Prompt : 이렇게 만들어라

Negative Prompt : 이렇게 만들진 말아라 

기본적으로 이렇게 두개가 있고 당연하겠지만 찾아보니 엄청나게 많은 종류가 있어 다 퍼오기도 힘들다.

 

간단한 예시가 있어 하나 가져오면

Positive Prompt : masterpiece, best quality, 1girl, black hair, golf course

 - 좋은 퀼러티의 검은머리 여자 한명이 골프장 배경으로 만들어라

 

Negative prompt: lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name

 - 안좋은 퀼리티나 일반으로 만들지 말고, 손 나쁘게 만들지 말고 사인이나 유저이름 나오게 하지 말고 등등)

 

Steps: 28, Sampler: DPM++ 2M Karras, CFG scale: 11, Seed: 2623692471, Face restoration: CodeFormer, Size: 512x768, Model hash: fc2511737a, Model: chilloutmix_NiPrunedFp32Fix, Denoising strength: 0.6, ENSD: 31337, Hires upscale: 1.5, Hires steps: 14, Hires upscaler: R-ESRGAN 4x+ Anime6B

 

샘플링 Step은 28로 - Step 수가 클수록 퀼리티가 좋아지고 속도는 느려진다.

CFG Scale 은 11로 - CFG Scale이 높을수록 프롬프트를 얼마나 따를지를 결정한다. 

Seed는 AI의 계산에 변수를 줘서 다양한 결과물이 나오도록 하는 값이다.

기타 등등...

 

우선 이걸 기본 프롬프트로 하고 아래 모델을 다운받아서 일단 만들어보자.

 

모델은 아래 두가지만 해보려고 한다.

 

1. orange mix : 애니메이션 같은 그림

 

WarriorMama777/OrangeMixs at main (huggingface.co)

 

* 여기 파일명을 보면 XXX_hard, XXX_nfsw, XXX_sfw 이렇게 뒤의 글자가 다른것을 알수 있다. 

hard : 글자 그대로 과격한 성행위 묘사

nsfw : not safe for work 일할때 안전하지 않아 즉 후방주의 정도 되겠고

sfw : safe for work 건전한 그림 이다.

 

2. ChilloutMix : 실사같은 그림

ChilloutMix | Stable Diffusion Checkpoint | Civitai

 

ChilloutMix | Stable Diffusion Checkpoint | Civitai

This model has been republished and its ownership transferred to Civitai with the full permissions of the model creator. They have asked that all i...

civitai.com

 

 

일단 orange mix로 만들어본거

masterpiece, best quality, 1girl, black hair, golf fieldNegative prompt: lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist nameSteps: 28, Sampler: DPM++ 2M Karras, CFG scale: 11, Seed: 918993248, Face restoration: CodeFormer, Size: 512x768, Model hash: 0873291ac5, Model: AbyssOrangeMix2_nsfw, Denoising strength: 0.6, Hires upscale: 1.5, Hires steps: 14, Hires upscaler: R-ESRGAN 4x+ Anime6B Time taken: 4m 6.20sTorch active/reserved: 1888/2456 MiB, Sys VRAM: 4096/4096 MiB (100.0%)

4분씩 걸리네.. 그나저나 뭘 들고 있는거냐? 이게 nfsw 로 만든거

 

masterpiece, best quality, 1girl, black hair, golf fieldNegative prompt: lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist nameSteps: 28, Sampler: DPM++ 2M Karras, CFG scale: 11, Seed: 602985742, Face restoration: CodeFormer, Size: 512x768, Model hash: 038ba203d8, Model: AbyssOrangeMix2_sfw, Denoising strength: 0.6, Hires upscale: 1.5, Hires steps: 14, Hires upscaler: R-ESRGAN 4x+ Anime6B Time taken: 3m 10.00sTorch active/reserved: 1888/2654 MiB, Sys VRAM: 4096/4096 MiB (100.0%)

이건 sfw로 만든거.. 대체 골프클럽을 장난감을 들고 있는 건가? 

 

 

자 이제 실사같은 그림을 만든다는 chilloutmix를 써서 해보자.

masterpiece, best quality, 1girl, black hair, golf fieldNegative prompt: lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist nameSteps: 28, Sampler: DPM++ 2M Karras, CFG scale: 11, Seed: 1393579719, Face restoration: CodeFormer, Size: 512x768, Model hash: fc2511737a, Model: chilloutmix_NiPrunedFp32Fix, Denoising strength: 0.6, Hires upscale: 1.5, Hires steps: 14, Hires upscaler: R-ESRGAN 4x+ Anime6B Saved: 00002-1393579719.png
masterpiece, best quality, 1girl, black hair, golf field Negative prompt: lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name Steps: 28, Sampler: DPM++ 2M Karras, CFG scale: 11, Seed: 2158228535, Size: 512x768, Model hash: fc2511737a, Model: chilloutmix_NiPrunedFp32Fix

face restoration 옵션과 hires.fix 옵션을 주지 않아 업스케일 되지않은 사이즈로 나왔다.

 

확실히 지난번에 비하면 꽤 좋아졌다!
다만 내 그래픽카드의 한계인지 그림 한장 만들면 반드시 하단의 reload ui를 해줘야 했다.

안그러면 또 out of memory...

 

 

+ Recent posts