Image Generation Guides

## RRAnon's Guide to Good Generations

### CFG, Sampling & Steps

These three guidance scales are the major foundations for all of your image generations and yet I find them to often be the most misunderstood. Everyone formulates their own preferences yet the truth of the matter is that some models simply don't work well at certain steps or sampling methods and the CFG is wrongly thought as just how **closely** the AI follows your prompts where the truth is it's also how **strongly** it does. Which is why excessively high CFG leads to distortion. The following is a guideline for usage of anime based models such as the ones listed in the section above.

#### CFG

Anime styles are inherently busy. Whilst not neccessarily always complex in it's artstyles, due to it's fictional nature anime has a gap to fill which what leads to it's exaggerated nature. You may think that forcing the AI to strongly follow what you prompt it to would work best but the likelihood is that you are not going to fill out the prompt box with the hundreds of required prompts to fill in all those gaps, so it'll be up to the AI to cover for all the spots you miss. For that reason, it is best to often leave the AI with a notable amount of freedom/RNG and use **low CFG settings**. A better explanation:

* **CFG 0 - 5:** The AI use a little bit of everything you told it to use but will mostly do it's own thing
* **CFG 6 - 10:** The AI will use you as a basis and build off the prompts
* **CFG 11 - 15:** The AI will do what it's told and do it to a significant degree
* **CFG 16+:** The AI will generate stuff that looks like garbage

Personally, I never go above 10 as if I need to make sure something is used, I use emphasis. Which will be discussed later. Ideally the more prompts you have, the lower your CFG should be and I normally float around 8.

#### Sampling & Steps

These two work in tandem together. Once again there is a misunderstanding from the general public on how these work. Steps do not determine the quality of your generation, they determine the detail of **intricacy** of your generation. As previously mentioned, anime styles are busy yes, however up close they are not detailed. Waifus luckily do not suffer from the skin pores, blemishes, wrinkles and other gross specifics of the human anatomy and within animation, anything that isn't within immediate view will most likely be broken down into basic shapes and colors. So, **do not bother using high amounts of steps**, as it is entirely unneccessary and merely adds to the generation time.

As for sampling, most sample methods will produce similar results (barring a few wild childs) and the main significant difference is in generation time. For generation on models such as AOM3 and Anything, I reccommend the following (though feel free to play around):

* **Steps:** 25 (no more than 40)
* **Sampling Method:** DPM++ 2M Karras for high contrast anime style or Euler a for slightly desaturated artistic style

### Prompting

Now for the one everyone really cares about. We all know how to do prompting on a basic level but you may notice that it often seems like others can generate better images than you. That's because there is a bunch of little tricks you can do to improve your images.

#### Meta Prompts

Meta prompts are prompts that you should include in every generation you do. For that reason I reccommend that you save them using the style saving tool (flash drive icon on far right) so that you can load them in easily everytime you start the generator. So what are Meta Prompts? They're prompts that will help influence the overall quality of your image, by default, Nemu's generator uses a good list of negative meta prompts and two positive meta prompts (Masterpiece, High Quality). I personally, have my own list of meta prompts for anime generation that you can copy and paste from below if you wish.

* **Positive Prompts:** best quality, highly detailed, masterpiece, ultra-detailed, illustration
* **Negative Prompts:** (painting by bad-artist-anime:0.9), (painting by bad-artist:0.9), watermark, text, error, blurry, jpeg artifacts, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, artist name, (worst quality, low quality:1.4), bad anatomy, EasyNegative , extra fingers,fewer fingers, 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, film grain, noise

#### Negative Prompts

This gets said a lot but it's true. Negative prompts are a god send. It is almost always more important to make sure you negative prompt everything you don't want in a photo than it is to include everything you do want in positive prompts. Not much more needs to be said. Use negative prompts and use them liberally.

#### Tokenizing Prompts

Tokenizing is something that you very likely do for your generations without realizing. It is the technique of seperating you prompts into many individual words with the intention of having the AI read each of them individually to better increase their chance of inclusion in the final result. Such as taking **"girl with long red wavy hair"** and tokenizing it into **"1girl, long hair, red hair, wavy hair"**. As priorly mentioned, this increases the AI's chances of including all the descriptivive factors so it's nearly always reccommended you tokenizing as many prompts as possible.

#### Emphasis (Inclusion and Strength)

Despite tokenzing all the prompts, you may still find the AI skips over a few, this is inevitable as it's nigh impossible to predict what the AI is going to choose to focus on and what it isn't. That is unless, we give it a helping hand in the matter. Most of you will likely use brackets like this **(((Long\_hair)))** to emphasize and whilst brackets do have an effect, brackets are the vastly inferior way to emphasize, too many of them will lead to confusion on the AI's behalf. The best way is a combination of light usage of brackets and strength through **Number Notation.** Emphasis in the generator works on a multiplication table, I won't explain the exact math to you but know that number notation is the much cleaner and easier way to emphasize. **Number notations work on a scale from 0.0 to 2.0 with 1.0 being the basis of inclusion and emphasis.** Anything over 1.5 is generally excessive though and like always, too much emphasis can lead to distortion, you need to choose your battles. So with that in mind:

* (((Long hair))), (((wavy hair))), (((red hair))), ((black skirt)), ((white top)) = BAD
* (Long Hair:2.0), ((wavy hair:1.8)), ((red hair:1.5)), (black skirt:1.4), (white top:1.6) = BAD
* (Long Hair:1.2), wavy hair, red hair:1.1, (black skirt:1.2), (white top:1.0) = GOOD

#### Emphasis (Usage)

So now the AI is using your prompts because you tokenized and emphasized correctly but hang on, that white top? That was meant to be a crop top! And replacing (white top:1.0) with (white croptop:1.0) doesn't always get me the results I want! So, let's fix that. The best way to do so I find is **emphasis through doubling up** with descriptive prompts**.** What does this mean? Well considering I want that crop top for damn sure this is what I'm going to do:

* (white croptop:1.0), girl wearing a white croptop, croptop on chest, white top

By adding non emphasized descriptive, double up prompts, I'm increasing the chances the AI will catch that a crop top or at least a white top is absolutely essential for the image to include the croptop and because of the descriptive parameters I used, it's more likely the AI will use them in the way I want them to be used.

### Examples

So with all that said, it's not much use unless I show you right? One generation each only, no redos and lets generate WWA's very own Farmer Girl:

**Tutorial Not Followed**

**Tutorial Followed**

Like night and day right? Of course the first generation isn't awful and the second isn't perfect but only one got any semblance of close to what we wanted. AI generation is all about experimentation as well as trial and error. So use this guide as a baseline and build up to as close as perfection as you can!

## Colbyanon's Guide to Inpainting

### Simple inpainting:

The following are step by step instructions on how to change hair color using inpainting. To illustrate this process, I'm going to change Kelly DiVanna's hair color to blonde and include all of the steps as I go so that you can see what is happening here.

**Step 1:** Get the pic that you want to change, and open it in a graphics editor that allows multiple layers and transparency. (Don't use Windows Paint, LOL.) Paint.NET is free, so easy to use that I can use it, and so non-resource intensive it will run on a typewriter, so if you don't have something better just download and use that. It's what I use and I'm very happy with it. See below the starting picture of Kelly DiVanna.

**Step 2:** Add a layer on top of your picture in paint.NET or your graphics editing program of choice, and crudely draw an outline of the hair, then fill it in. This doesn't need to be perfect, so don't worry about it. If you have trouble getting the shape even close to right, either take your time, or zoom in really close-up on the pic.

**Step 3:**  Turn the down the opacity of the layer you just added until you can still see the texture of the hair coming through. This will look like garbage, but that's okay. It's good enough for Stable Diffusion to pick up on what you're doing when you go to inpaint it.

**Step 4:** In Stable Diffusion, select the imgtoimg tab and then the inpaint sub-tab. Put all of the normal prompts in that you'd want for the picture in the text boxes, except that if the hair color is different, use the new hair color that you want. In this case, though it's not included in the image, I have pasted in all of Kelly DiVanna's prompts, but replaced "black hair" with "blond hair". Make sure to set your picture dimensions, # of steps, all of that stuff, to be the same as the other picture. You can use ADetailer if you're inpainting part of the face, just make sure you're using the exact same ADetailer settings and prompts. Again, everything should be the same as the prompts for the main picture, except for hair color - don't cut corners on the settings and prompts. And then most importantly, set denoising strength to a low-to-moderate level. I'm using 0.45 here. If you have it set to 0.7, your picture will probably look all crazy. This part is important.

Once your setting are right, shade over the hair that you want to recolor with the inpainting "brush" tool. Make sure you get all of it. If you get stuff that's outside of it, that's fine too; at 0.45 or thereabouts you're not going to hurt it too much. The only catch is, if the face used ADetailer before, and your inpainting brush gets part of the face, make sure you're using ADetailer here as well, with the same prompts, as I mentioned above.

**Step 5:** It's possible the generator will throw you a fail, just like is always possible with Stable Diffusion rendering. But in most cases if you've followed all the steps and set your settings correctly, you'll probably get something pretty close to what you want. You can always run multiple renders, or make minor edits and try again. If it's a complex job, you may have to do that anyway.

### Prop inpainting:

**Step 1:** Suppose you want to get a picture of this jerk holding up a Bible and frowning, but she just wants to play on her phone all day with that smug little smile. And worse than that, she also has three fingers on that hand. Not a problem; you have the phone pic and you can work with it.

**Step 2:** Find a picture of a Bible. You want a picture of a Bible, not a picture of a bible and its background, so use the online background remover to take away the background. If you're like me and it also takes away the pages of the Bible, then you'll have to fix that, LOL.

**Step 3:** Open both pics in photoshop, paint.NET, GIMP, or whatever it is you use and edit the Bible into her hands. Don't use the Paint program that comes with Microsoft Windows, that probably won't work. Paint.NET is free and it's easy enough to use that I am able to use it, so if you don't have another preferred option, use that. It doesn't need to look great now; in fact, if you could make it look great, you wouldn't need the generator and you'd already have your pic. Just do your best. Use copy and paste and the layering functions to get it as close as you can. In this case I selected her fingers and pasted them back in over the Bible's cover after I pasted the Bible over her phone. I did have to rotate the Bible and change its size in the graphics editor, but this is easy.

**Step 4:** Put the image in your generator and run it through imgtoimg, and use the prompts and settings you want like you would if you were making an image in txttoimg. Make sure to note any minor changes you want to the picture. In this case I used some (angry) and (scowl) prompts because I didn't want her smiling. I also used (sitting on a couch) because I didn't want her to be a torso that was buried halfway in a white bed. Use low-to-moderate denoising. Usually 0.3-0.6 denoising will be enough. The closer the pic you got in Step 3 was to the actual output you want, the lower denoising you can get away with. Higher denoising will make the pic get weird, so if you run it on 0.85 it's going to get goofy. Don't do that. I think you'll need to do 10-20 copies of the pic you want, maybe more if you're going for something really challenging.

**Step 5:** The pic you got from Step 4 probably isn't perfect, so you can try to fix it some more. In this case, I probably should have given her a fourth finger in Step 3, but I hoped it would come out right in imgtoimg. That was a bad idea on my part. It didn't. So now I have to add the 4th finger in. Go back to your graphics program, and use copy/paste, paintbrush, and the pencil tool to get somewhat close to what you want. Again, this doesn't have to be good; if you could draw it freehand and make it look good, you wouldn't need the generator. But what you're doing is trying to give the generator something it can work with on a low denoising level. Once you get it good enough, save it and get ready to inpaint.

**Step 6:** Inpaint just the part that you want to correct (in this case, the crudely drawn hand), using the same prompts from the original pic, and again, a low to moderate denoising. Set it to generate about 10-20 pics, so you can weed through them and only take the best one, and then you are there. Now we have a picture of Colby Jefferson holding something that sort of looks like a Bible, which is what we wanted. The pic could be better; the spine of the Bible is misaligned, and the pages are hanging out the bottom weirdly. We could fix this with more editing through a graphics program and more inpainting (repeat steps 5 and 6 until satisfied) or we could declare it good enough to post.

**Final Notes:**

* I want to emphasize that your denoising for this process (both imgtoimg and inpainting) should be only as high as it needs to be to get the pic looking good, no higher. If you're running on 0.7 denoising all the time, you're going to struggle.
* However, denoising lower than about 0.2 doesn't usually do much of anything. Experiment with it, find what works for you.
* I also want to emphasize that you will probably need to generate at least 10-20 pics at a time and choose the best one before moving on with the next step. Consider that you will probably get a lot of failures here, but you only need one success.
* I don't think Loras, extensions, ADetailer, and that sort of thing work great with inpainting. I guess feel free to try them, but I've not had much luck.
* Usually with inpainting you're fixing one, or one in a series of, very minor details, in a way that you basically want it to look like the rest of the pic already did (which goes back to the low denoising level), so you probably won't need them most of the time anyway.