리스에는 NAI 이미지 생성 서비스를 이용해서 감정 이미지를 실시간으로 생성하는 기능이 있다.

업데이트 된 지 꽤 됐지만 제대로 된 연구가 이루어지지 않았다. 
NAI 야짤 딸깍질과 챗질을 동시에 하고 있던 나는 "아, 이거 한번에 하면 되는거 아니야?" 라고 생각했다. 

그렇게 나는 크리스마스 이브인 24일을 전부 여기에 쏟아 부었다.


준비물 : NAI 최상위 구독 티어, RisuAI, OpenAI API


가장 먼저 이미지 생성 봇 세팅 먼저 해보자.



1. RisuAI의 설정에 들어간다. 기타 봇 -> 이미지 생성을 클릭한다.




2. 자신의 NAI 딸깍 세팅을 입력한다. 잘 모르겠으면 그냥 이대로 입력하셈. 


- 요청 url 주소가 스샷과 다릅니다!

https://image.novelai.net/ai/generate-image

위 주소로 변경되었습니다. 해당 주소를 이용하세요. 


- NAI API는 어디서 받아오나요? : 
NAI 웹 사이트에 로그인합니다. 좌측 상단의 설정을 클릭합니다.


Account 세팅 클릭 


Get Persistent API Token 클릭 후 복사.


3. 감정 이미지를 클릭하여 모델을 Ax. Model(보조 모델 사용)으로 설정한다.



4. 보조 모델을 GPT-4 Turbo 1106으로 설정한다. (NAI 요청 프롬프트가 하도 복잡해서 나는 돈까스로 한다. 3.5 Instruction 등을 쓰는 것 보다 매 요청 가격이 더 들어간다. 라면귤로 하고 싶다면 후에 나올 NAI 생성 프롬프트를 라면귤에 맞게 다시 짜길 바란다.)


5. NAI 프롬프트 만드는 리퀘스트에는 방금 답변한 Assistant의 마지막 출력만을 보내기 때문에, 우리는 상태창을 이용해 캐릭터의 정보를 추가해야 한다..! 아래의 방법 중에 하나를 골라 상태창을 추가하세요.
- 방법1. 자신이 사용하고 있는 프롬프트 템플릿에 상태창을 추가한다.

- 방법2. 글로벌 로어북에 상태창을 추가한다. (@@@end를 이용하던 출력 순서를 조정하던 알아서 하시길 바람.)
- 방법3. 작가 노트, 글로벌 노트 덮어 쓰기 등 사용하고 싶은 봇에만 상태창을 추가한다.


이 글에서 사용할 상태창 프롬프트:

<Indicator>

Every response should start with format. Must be output this format using english. Format = "[Female Character's Appearance status: <Hair(Describe Hair style, color), Eyes(Describe color of eyes), Tops(Describe her tops), Bottoms(Describe her bottoms.)> | <Tops(Describe how the clothes are being worn, not what the clothes are.), Bottoms(Describe how the clothes are being worn, not what the clothes are.), Panty(Describe how the clothes are being worn, not what the clothes are.)> | Location: <data>]" Example = "[Female Character's Aooearance status: Hair(Shoulder-length, black), Eyes(Dark brown), Tops(Black lace choker, long-sleeve low-cut shirt), Bottoms(short pencil skirt) | Tops(Fully clothed.), Bottoms(Off the feet.), Panty(Pulled over to the side.) | Location: Living Room, Sofa]"

</Indicator>


알아서 수정하시면 되겠다.


6. 저 개더러운 상태창을 우리가 봇 답변에서 볼 걸 생각하니 정말 어지럽다! 정규식을 이용해 상태창을 지워보자.


Modification Type : 디스플레이 수정
IN: \[(.*?):(.*?)\|(.*?)\|(.*?):(.*?)\]
OUT: <style>         .container {     display: flex;     align-items: center;     justify-content: center;     height: 100%;     flex-direction: column; }  .wrapper {     display: flex;     flex-direction: column;     align-items: start;     margin: 1em 0 1em 0;     max-width: 100%;     text-shadow: none;}  .status-box {   position: relative;   background-color: rgba(255, 255, 255, 0.7);   padding: 1em 3em 1em 1em;   border-radius: 16px;   text-align: left;   font-size: 1em;   margin: 0.1em;   min-width: 20vw;   max-width: 100vw;   color: black; }      .title  {     display: flex;     justify-content: space-between;     padding-bottom: 0.2em;     font-size: 0.9em;     opacity: 0.7;   }      .content{     text-align: left;     line-height: 1.6em;     display: inline-block;   }      .situation{             font-weight: 600;         }        .plan{     margin-top: 0.2em;     opacity: 0.7;     font-size: 0.9em;   }    </style>    <div class="container">   <div class="wrapper">       <div class="status-box">         <div class="content">             <div class="plan">❥$5</div>         </div>       </div>   </div> </div>

해당 정규식은 위의 상태창을 기준으로 작동한다. 상태창을 수정했으면 정규식도 스스로 바꾸도록 하자.


7. 감정 이미지 생성을 사용하고 싶은 봇을 들어간다. 


스마일 버튼을 눌러 감정 이미지 탭으로 들어간다.



추가적 캐릭터 스크린을 이미지 생성으로 바꾼다.


8. 갑자기 생긴 수상한 칸을 채워넣는다.


Image Generation Prompt: {{slot}}, nsfw, best quality, amazing quality, very aesthetic, highres, incredibly absurdres


나는 쿰하는 사람이기 때문에 야짤이 잘 뽑히도록 상시 NSFW 태그를 박아놓겠다. {{slot}}은 보조 모델이 마지막 채팅을 기준으로 분석한 키워드가 들어가는 공간이다.

Image Generation Negative Prompt: normal quality, bad quality, low quality, worst quality, lowres, displeasing, very displeasing, {bad}, bad anatomy, bad hands, text, error, missing, missing finger, extra, extra digits, fewer, fewer digits, cropped, JPEG artifacts, signature, watermark, username, blurry, artist name, bad face, fat, duplicate, mutation, deformed, disfigured, extra arms, extra legs, long neck, bad feet, bad proportions, extra, fewer, unfinished, chromatic aberration, scan, scan artifacts, monochrome


부정 프롬프트이다. 모르겠으면 그대로 넣으셈.


Image Generation Instructions: 

You must always output the female character's image as a keyword-formatted prompts that can be used in stable diffusion. only output the that prompt, depending on female character, place, situation, etc. that prompt must be written in English keywords, and writing in Korean is prohibited. keywords should be many enough.


please follow this structured keyword format:

1. Start with "1girl," followed by "artist:ie_(raarami)" for consistency and artist style recognition.

2. Pose-related prompts: Include posture and action (e.g., seated, leaning forward, standing, leading forward, foreshortening).

3. Face-related prompts: Detail expressions and features (e.g., smiling, blue eyes, aqua eyes, open mouth, embarrassing).

4. Hair-related prompts: Describe hair characteristics (e.g., curly hair, blue hair, absurdly long hair, long bangs).

5. Body-related prompts: Specify physique and visible body parts (e.g., athletic build, exposed belly, skinny, loli, small breasts, arms up).

6. Clothing-related prompts: List garments and their positioning (e.g., crop top, short shorts, socks, hood down, skirt lift, downblouse).

7. Background-related prompts: Set the scene (e.g., outdoor, park, indoor, night, on bed,).

8. For NSFW content: Explicitly mention exposed body parts as needed and sex acts (e.g., pussy, ass, critoris, nipples, bare breasts, spread legs, missionary position, oral sex, doggy style).

9. Additional details: All other prompts (e.g., after rape, eases, sweat, cum, cum in pussy, cum on body, cum on legs, saliva, used tissue, used condoms, condoms packet strip, condoms on hip, flushed cheeks, disheveled).


For sex scenes shift to "1girl, 1boy," or "1girl, 3boys," etc.(The number of men changes accordingly), you must be include relevant anatomy ("penis"), age descriptors ("shota," "loli," "mature female").


Utilize short but comprehensive keywords rather than lengthy phrases; separate attributes into individual terms for precision (instead of "long black straight hair," use "long hair, black hair, straight hair").


When describing clothing, write "type of clothing, state of clothing (inclusive)" (instead of "tight yoga pants, yoga pants mid-thigh" use "tight yoga pants, pants pull"). 


When describing exposed body parts, use concise NSFW body parts only (instead of "round buttocks exposed, pussy exposed, ass exposed" use "round buttocks, pussy, ass").


Keywords to describe the situation should be written without text, sound, scene, and loudly (instead of "struggling to text, bedroom scene, intense sex sounds, moaning loudly, wet pussy sounds, rhythmic thrusting sounds" use "struggling, bedroom, moaning, wet pussy, rhythmic thrusting"). 


Example prompt output: 1girl, 1boy, artist: ie_(raarami), mature female, black hair, ponytail, bright blue eyes, almond-shaped eyes, pink sweater, pulled up sweater, large breasts, nipples, tight yoga pants, pants pull, round buttocks, pussy, ass, panty on thigh, top-down bottom-up position, penis, doggy style, texting while sex, struggling, bedroom, moaning, wet pussy, cumming hard, rhythmic thrusting


The prompt examples are just a reference for your prompt writing. They should never be typed out verbatim. Use English keywords to prompt your current situation, similar to the format of the examples above. More and more keyword prompts will help to output accurate images. 


Important Point: Remember that explicit depiction of genitalia or sexual acts should always be accompanied by clear keywords such as "pussy," "ass," "penis," with specific sex act terms to ensure correct image rendering with appropriate details ("round buttocks, pussy, ass, top-down bottom-up position, penis, doggy style, texting while sex").


해당 프롬프트에는 1girl, artist:ie_(raarami)를 고정시켰다. 처음에는 Image Generation Prompt에 고정 시켰으나 나중에 1boy가 포함된 프롬프트에서는 1girl, 1boy의 형태로 순서가 중요하기 때문에 보조 모델에게 시켰다. 아티스트 부분은 자신이 원하는 아티스트로 수정 하면 된다. 총 3군대를 수정해야 함. 


쓸대없이 존나 긴 이유는.. 그 똑똑하다는 돈까스조차도 NAI의 단부루 태그 형태의 키워드 프롬프트를 제대로 이해하지 못했기 때문이다.. 하나 하나 계속해서 리퀘스트를 분석하며 덕지덕지 지시를 붙이다보니까 이렇게 길어지게 됐다. 스스로 해당 지시 프롬프트를 압축, 수정하여 자신만의 프롬프트를 짜보자.. 모르겠으면 artist만 자기 취향 작가로 바꾸고 그냥 쓰면 됌.


9. 이제.. 드디어 채팅을 딸깍해보자. 

먼저 텍스트 아웃풋이 먼저 온다. 그 뒤 보조 모델의 분석이 시작되고 스스로 NAI에게 요청까지 한다. 조금 기다리면 감정 이미지가 방금 생성된 NAI 짤로 나온다! 이미지가 좆같다면, 고급 설정 -> 리퀘스트 분석을 통해 왜 보조 모델이 NAI에게 보낼 프롬프트를 좆같이 짰는가를 확인한다.. 그리고 Image Generation Instructions를 수정한다... 



사용 예시:


AI의 마지막 답변: 정규식이 적용된 깔끔한 상태창. 나는 한글 챗을 하기 때문에 한글 출력이다.



정규식을 뺸 실제 출력물: 보조 모델은 마지막 채팅만을 분석하기 때문에 캐릭터의 정보를 알 수 없다. 그래서 이걸 상태창으로 해결한 모습.


보조 모델이 분석하고 제작한 NAI 이미지 생성 프롬프트 & 실제 NAI에게 전송된 프롬프트 : 
"input": "1girl, 1boy, artist:ie_(raarami), blowjob, cum in mouth, playing smartphone, gaming, indifferent expression, violet hair, unkempt hair, hazel eyes, baggy hoodie pulled up, B cup breasts, small light brown nipples, sweatpants pulled down, pale hips exposed, living room setting, couch background, cum on chin and breasts, annoyed expression, wet pussy visible through sweatpants opening., nsfw, best quality, amazing quality, very aesthetic, highres, incredibly absurdres"


실제 NAI에서 생성된 실시간 감정 이미지: 







궁금한거나 더 좋은 아이디어가 있으면 언제든지 덧글로 질문하거나 공유해주길 바란다!!



수정: 

- Image Generation Instructions 프롬프트 구조 개선함. 이제 진짜 당분간 손댈 일 없을 것 같음.