News:

Please request registration email again and then check your "Spam" folder

Former www.henthighschool.com

AI art girl pack expansion

Started by bremul, Feb 27, 2023, 04:11 PM

Previous topic - Next topic

bremulTopic starter

A few months ago i saw a discussion whether you could use AI art to expand girl packs and raise their rating by creating images for rare categories. I've wanted to make this post for quite some time, but i'm incredibly lazy, so here we go. The answer is Yes! With some limitations.

For example, the Higuchi Madoka pack by _neronero lacks any monster images. It took me about 3-4 hours to train the model and after that a few minutes until i've created some passable pictures, 1 hour preparation and 2 hours unsupervised training. https://imgur.com/a/sFZ35kD

How is this possible? Stable Diffusion, Textual Inversion Embeddings (and LORAs, which i've not tried yet).

Requirements
  • A graphics card with at least 8 GB of VRAM. If you have an Nvidia card, you can simply use it in Windows, but with AMD cards, you probably have to use Linux. I've tried Windows, Mint, Ubuntu and Arch and i could only make it work in Arch. Not working means that it defaults to using the CPU instead of the GPU. But let me know if you have an AMD GPU and made it work on Windows, there are some turtorials that say it works.
  • A set of images of the character. Easy if there is already a large girl pack, but the features you want the model to show, need to be consistent. 25-200 images or more realistically 50-150. You need to convert .webp images to .png or .jpg for the pruning. I have used 76 to train the Madoka embedding.
  • Dedication and time. If you have already made a girl pack, you probably have both. Basically you need the select the images for the training and manually delete tags from an automatically created dataset. And it's very much not an exact science, you might have to do a lot of experimentation with the training images, the training and the generation.
[close]
Basic pipeline
There are a lot of tutorials out there.
The two sketchy things here are the leaked NovelAI model and the program in the guide. With the model, get the torrent that is seeded by many people. I haven't had any problems so far, but beware that if you download random things from the internet, they might contain malware. If you can, download .safetensors models instead of .ckpt. You were warned and i'm not responsible for any damages. ;)
[close]
Textual Inversion and LORA
Since AI art generation is basically black magic and i don't want to spread any incorrect information, let's just say that Textual Inversion trains a tiny portion of the model based on images and tags. Then you can embed this training to any model by using the tag you've specified. They are mostly used to introduce new characters and concepts to the model. LORAs are even more complicated and I haven't yet tried training one, but they are much larger and you can specify how strongly they should affect generation. While style TIs are rarely used for styles, there are just as many LORAs for styles as for characters. There are also Hypernetworks, but they aren't used that often.
[close]
Possibilities and limitations
It's an incredibly powerful tool, but you are probably aware of some limitations. AI art can be quite janky when it comes to details, though it can be mitigated by tuning the tags and parameters. If you don't show hands and feet, you won't get very bad results most of the time, and you can get good results even with them. However, it takes time. Prompt engineering isn't an exact science, you have to experiment a lot and every random seed is coin toss. Even if you have found a good seed for the specific prompts, changing parameters might change the result a lot.

The most important thing for the training imageset is that the features, that you want the model to reproduce, need to be consistent. Basically face, hair, cat ears, etc., and change up the things you don't want to always see, like specific clothes.

It works quite well with anime images as they are quite similar to one another, but if you want to train a girl with a different art style and especially many different art styles and not a lot of images, you will have a much harder time. Nevertheless, with work (and a bit of luck), you can achieve passable results.

The more specific the concepts are and the more detail they need, the harder it is to get good results. Things like a maid outfit or a bunny girl suit will work right outside the box, but you will have a harder time getting good results when you introducing an additional character, positions, motions to the scene. With sex there are often penises without body, fused limbs of the characters, fused and distorted hands, other weird anatomical features and so on, but i want to emphasize that you can create good pictures, it's just somewhat harder. There are also a lot of great TIs and LORAs you can use.

For the beast tag you would need to train specific animals and probably a LORA instead of a TI, though no guarantees it would work as animals are a whole another beast compared to humans and neither can i imagine machines being very easy as they vary greatly. Though they can be approximated with dildos, background and such.EDIT: You can actually get pretty decent results for machines without any training: https://imgur.com/a/O4P59xo
[close]
AMD cards
If you are lucky, it's enough for you to follow the instructions on the wiki. If not, good luck, there is a lot information scattered around the web, multiple video guides, reddit and stack overflow post, blogposts, just try things out and don't get discouraged if it doesn't work. Just check if your GPU is compatible at all. I honestly don't know what exactly made it work for me, as it was already the third Linux distro i installed and at that point i wasn't exactly noting every step, but i followed the first part of this video https://www.youtube.com/watch?v=d_CgaHyA_n4&t=188s. I also installed some AMD drivers, i forgot where i got the information from, but these are the ones i could find (it may vary depending on your card and some might be just dependency):
amd-ucode 20230117.7e4f0ed-1
hsa-amd-aqlprofile-bin 5.4.1-1
xf86-video-amdgpu 22.0.0-1.
vulkan-radeon 22.3.3-3
also the kernels from the video:
rocm-opencl-runtime 5.4.2-1
rocminfo 5.4.2-2
[close]

I hope this post will be helpful to at least one person in creating better girl packs or expanding existing ones. Those, who created girl packs, thank you, i know it's a ton of work and extra thanks to Goldo for developing the game. Can't wait for the next version.

I would also propose that the girl pack creators put AI generated images into a subfolder as someone might not want to use them, but more importantly, if someone only creates an expansion, instead of creating duplicates for existing packs, we simply put the expansions into the database. I'm happy to answer any question.

bremulTopic starter

I might have overemphasized the need for training. There are already many characters that are covered by TIs and LORAs (possibly even better than you would make) and in that case you don't have to waste time with training. But unfortunately many are not and when you download one from an untrusted source, you always risk getting infected with malware.

If you first start using SD, try first reproducing shared images on civitai and then experiment with them a little to get a feel how the prompts and settings change the ouput.

Additional resources:
https://rentry.org/hdgpromptassist#loras - Embeddings, LORAs (training guide and repository) -probably safe
https://rentry.org/sdupdates2#embeddings - A lot of links, some might lead to malware infested models/networks/embeddings
https://rentry.org/voldy#-ti-hypernetworks-and-loras- - Basics guide and links (i haven't used this)



neronero

Thanks for the guide! I haven't tried TI or LORA yet, sounds very promising.

I hope that at some point we can do something similar with language models (extensively training them on BK's codebase and then generating events with them)
Heck, I wouldn't be surprised if a few years down the line, an AI will be capable of properly tagging a girlpack all on its own, after studying our database of thousands of tagged girlpacks.
My Girl Packs: [ link ] - Trait King mod: [ link ]

Smaug

Great guide! I just got a used 3080 so I will definitely play around with this.
There is a lot of info about using models and checkpoints, but much less info about how to go about your own training.
And often the info about the good leaked models is hidden due to legal reasons (for example SD 1.6).

neronero

I found this video very informative on explaining the differences between TI/LoRA/Hypernetworks/Dreambooth

Here's a photorealistic version of Sill. I think I'll try to create a LoRA for her, but I have no idea how accurate/consistent it'll end up being.

My Girl Packs: [ link ] - Trait King mod: [ link ]

kirkmo


neronero

Here are the results & lessons learned of my Sill LoRA experiment!

- Making a LoRA is super easy! But making it as perfect as it can be seems extremely complicated and timeconsuming.
- I think I've made it a bit too difficult for myself by choosing a completely imaginary yet photorealistic subject. Training-data of a consistent face & body-type with all kinds of emotions and poses and clothes doesn't exist. So all things considered, I'm pleasantly surprised by the results.
- I don't know why exactly (newer models, I guess?) but I'm generating way way way less amputees and nightmare fueling faces compared to a few months ago. Making an entire girlpack with SD seems really viable to me.
- There are already some LoRA's out there that are very useful for BK, even for things that are rare finds in girlpacks (bukkake, lactation, group service)
- Dynamic Prompts is my favorite extension, don't sleep on it.

left to right top to bottom:
input image (one of many), waitress, dancer, masseuse
geisha, beach, naked chilling, naked back (implied doggy)
constitution, kiss, lactation, naked

My Girl Packs: [ link ] - Trait King mod: [ link ]

dcsobral

One trick I've learned on correcting images like, say, the nude one is generating multiple derivatives from the same image keeping the same pose, cut&pasting the best parts of the of the generated images together and then submitting the mashup image as the source for a final pass with very low freedom so the AI can smooth out the borders.

Goldo

Damn, this is all really cool... Makes me really curious to try my hand at this (but last thing I need is a new rabbit hole to go down into)!
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!