Mod Lab Rats 2 Reformulate GenAI Mod Thread

idfkru

Newbie
Nov 6, 2024
41
38
86
Overview:
Lab Rats 2 GenAI mod. Uses Stable Diffusion to replace Daz models in base game with AI generated images. Forewarning: this is not a "download one folder and click play" kind of mod, it usually requires some tinkering with settings and possibly troubleshooting to function properly.​

Original Game: Lab Rats 2 Reformulate

Installation:
You don't have permission to view the spoiler content. Log in or register now.

Hardware requirements:
You don't have permission to view the spoiler content. Log in or register now.
 
Last edited:
  • Like
Reactions: F9Zoney
May 23, 2023
266
184
119
You'll need to be to make these mods work at all. For a good gaming experience you'll want the 'Recommended requirements' or better.
 
May 23, 2023
266
184
119
'Mature' GenAI mods:


AnotherMike's 'bugfix' version
AnotherMike's narration text version

All of the above include html instructions for installing Stable Diffusion.

Attached is the V0.01 alpha release of a mod I'm working up from AnotherMike's narration text version. It currently only works properly with the but I'll be adding more over time. It's meant to better fit generated GenAI images to what's happening in the game. Eventually I'll train a checkpoint optimised to LR2 image requirements and post a link in this forum.
 
Last edited:
  • Like
Reactions: Hjort

idfkru

Newbie
Nov 6, 2024
41
38
86
'Mature' GenAI mods:


AnotherMike's 'bugfix' version
AnotherMike's narration text version

All of the above include html instructions for installing Stable Diffusion.

Attached is the V0.01 alpha release of a mod I'm working up from AnotherMike's narration text version. It currently only works properly with the but I'll be adding more over time. It's meant to better fit generated GenAI images to what's happening in the game.
Thanks again! Appreciate you helping get this thread going. I'll just leave installation instructions as link to discord for now since I've seen tons of different possible configs and common problem solves in there. Leaving this pretty bare bones until I get the thumbs up from one of the devs to have this as the official GenAI thread that gets linked in the game OP, wouldn't want to spend hours making FAQs etc. just to delete it the next day because one of the devs/modders would rather make their own thread lol
 

waaazzzaaa

New Member
Nov 3, 2022
6
5
127
I've been testing the GenAI mods for about 2 weeks now.
CyberPony version is the best I've used so far but if you have a fantastic GPU or use a simple model the narration version is amazing.

CyberPony suggested settings are:
Sampling method: DPM++ SDE Karras / DPM++ 2M Karras / Euler a
Sampling steps: 30+ Steps
Resolution: 896x1152 / 832x1216
CFG: 5
Clip Skip: 2

at those setting each render was about 40 seconds for me using a laptop with 16gb ram and 8gb vram GTX3070

optimizations I've tried with COMMANDLINE_ARGS= in the webui-user.bat

--medvram-sdxl (recomended for 8gb vram - seems to be the fastest I've tried)
--medvram (slightly slower for me - recommended for 6gb vram)
--lowvram (much slower - recomemded for 4gb vram)

--xformers (seems to help all the above)
--opt-sdp-attention (also seems to slightly help the speeds a little)

However at 896x1152, 30sec renders (I only use 22 steps) makes the game almost unplayabe. So i've been running CyberPony with 512x768 rez and the renders are usually about 15 seconds. 2x the speed seems to be mainly from less background being generated which is great. Also, 2x the "hallucinations" which is not so great but realatively rare i'd say. Maybe one outta every 20 are freaky but almost never extra limbs or anything.


CyberPony v14 released yesterday. Seems to have a huge quality improvement for my settings. (but not speed improvement)

My GenAI mod config:
Steps: 22, Sampler: DPM++ SDE, Schedule type: Karras, CFG scale: 8.0, Size: 512x768, Model: cyberrealisticPony_v140, Version: v1.10.1

My observations:
hybrid graphics (keeping AMD iGPU active) makes things 30% slower.
Nvidia control panel - CUDA sysmem fallback off/on doesn't seem to change much of anything - most recommend off but if you have 4gb vram card CUDA sysmem fallback may enable using sytem memory for larger models
Many recommend adding CyberRealistic_Negative_PONY_V2-neg and CyberRealisticPony_POSV1 as positive/negative embeddings but v14 seems to be doing great without them.

AUTOMATIC1111 webui is almost abandoned at this point from what I understand. (in my nearly 2 weeks of AI wisdom xD)
Comfyui can do 896x1152 in about 20 seconds and 512x768 in 11 seconds on my rig but is not compatible with GenAI mod (hopefully comfyui is in GenAI mods future)

If you want to easily add ADtetailer or background remover to AUTOMATIC1111 remove --listen from COMMANDLINE_ARGS= in the webui-user.bat. Then you can just add it from the extensions/avaliabe tab in webui. When done add --listen back to COMMANDLINE_ARGS=
ADetailer adds a lot of quality to the faces but increases render time by about 30% and greatly increases the chances of the face randomly becoming a different person, so I almost always have it off.



Any good SD1.5 models made for 512x512? Those seem to render in about 6 seconds but I haven't found any that are even close to CyberPony quality. I'm fine waiting an extra 6 seconds for realistic renders.

I'll probably try forge soon which works with only minor tweaks to the GenAI mod I think... but would appreciate any recomendations.



GenAI mod wishlist:
*make the -Generating,prev,next- toolbar always visible (even when autogen is on) but much higher so it doesn't block images
*add a HQ settings toggle to toolbar for scenes that derserve/need it

and what would be a total GAME CHANGER --

*if the GenAI mod could somehow send the next prompt to webui before we actually progress the scene. (maybe a whole sqeuquence up to the next "choice" if that's possible)
So while helping do a photoshoot and we're reading/seeing the character taking off shoes, the GenAI is alreading passing the next scene >socks>pants etc. This would make many scene trasitions instant as they'd be rendrerd before we progressed.
 

NaughtyAnon

Newbie
Apr 2, 2020
44
36
152
So this is where the party is! I'll post more when I have time. Work is kicking my ass. The testing with Maswoo/Forge/UntraRealistic by Stable Yogi continues!
 
  • Like
Reactions: Magister Crudi
May 23, 2023
266
184
119
CyberPony version is the best I've used so far
Yeah, I find Cyberpony pretty good too and am using it to develop my own GenAI mod. I use 'Euler a' with 20-25 steps and get good balance between appearance, generation time and fidelity to prompts (according to my taste at least). Just started on V14 myself and though it's a bit better in its range of appearances (faces, ages, skin tones ...) I've gotta disagree about ADetailer. I find using it with face_yolov8s.pt greatly improves faces, but at significant cost in image generation time. I also find CyberRealistic_Negative_PONY_V2-neg and CyberRealisticPony_POSV1 useful for nicer faces and less cartoons or monsters - especially in sex positions - with no extra processing overhead I've noticed.

A tip for using ADetailer without adding too much image lag.
When you've got a frequently interacted character with a commonly reused image (i.e. one that pops up immediately without regenerating), switch ADetailer on and Auto Generate off (if you're using more detailed images you can also switch on Upscaling). Return to the game and use "X" to delete the current image then "+" to regenerate it with ADetailer on. Then go back to GenAI Config and switch Auto Generate back on (if that's how you like it) and ADetailer and Upscaling off. Then you'll get the better quality image 'for free' whenever you return to it.

A tip for the 'hallucinations' (which I often find entertaining, TBH) - including the ones where you just get a flat 2D field of amorphous colour - is to 'Append' something fairly neutral (e.g. pretty) to the positive prompt then force an image regen. Often it's a permanent fix for that NPC.

if the GenAI mod could somehow send the next prompt to webui before we actually progress the scene.
Can't imagine how to do that unless they start rolling out quantum computers with precognition :unsure:. I've moved the toolbar up a bit and will have a think about your other toolbar suggestions and see what I can do, but don't expect anything soon. My 'to do' list is already receding into the hazy distance and the new LR2 update hasn't helped.

But hey, if you want me to give your suggestions more priority you could start testing my mod and making suggestions specific to it ;). So far it's basically add-ons to AnotherMike's narration text version, though I can't guarantee I haven't introduced extra bugs. I'd recommend leaving Process Narration off to avoid the error when meeting Nora and Stephanie on Saturday night (still unfixed from AnotherMike's original). Even with it off my mod uses narration text to contextually inform a lot of image generation, hopefully with a bit more effect and relevance than merely appending the narration text to the prompt as AnotherMike does. Pony models aren't too clever with natural English.
 
Last edited:
May 23, 2023
266
184
119
The testing with Maswoo/Forge/UntraRealistic by Stable Yogi continues!
I just started retesting with the newly released LR2 update. (I wish they'd package the Real Porn mod separately. I don't use it and don't appreciate its doubling of download size).

The bad news is the only changes I've seen to the game so far are trivial alterations to some on-screen menus and having all the old save games broken.

The good news is I'm yet to find any compatibility issues with my GenAI mod, though it's early days yet. I'll be interested in hearing from you whether the new version impacts Maswoo's mod.
 

waaazzzaaa

New Member
Nov 3, 2022
6
5
127
The main negative about realistic diffusion models are the unrealistic hair colors in LR2. When I get a freaky render or the person keeps randomly changing to a totally different face my first suspect is crazy hair color and I change it to something realistic. (Even thou strawberry blond is realistic that has made some interesting hallucinations :ROFLMAO:)

Also, this is a great way to slightly change the prompt and render without breaking the 4th wall and editing the prompt manually. Adjust the hair color a bit- brown>medium brown>dark brown - with the cheat menu and the autogen instantly triggers.

Also, GLASSES!!! omg CybePony be failing bigtime with glasses (maybe unique to my 512x768 rez setting?) Any quick way to change a character to no-glasses?

Not a GenAI mod bug but it seems the new update lets you infinitely continue the last position even if both of you are at zero energy. Or is that a feature?

My temp workaround to autogen without a previous render button, is to keep the GenAI-Generated Images folder open in the background and quickly tab out to see what friend/relative they are introducing me to. When there are two people in a scene both get autogen'd but only one of the images is displayed in LR2.

I'll start testing with your mod and see what I can contribute.
I suppose a narration toggle on the toolbar would also be pretty awesome. At, 15-20 seconds per generation, I can't play with EVERY... single.... narration.... dialog.... getting rendered but being able to quickly toggle it on for a special/unique scene would be almost as game changing as my pre-cog render wish :alien:.

Anyway, serum daddy gotta get back to makin money to pay for LASIK for the entire city!!:cry:
 
May 23, 2023
266
184
119
Even thou strawberry blond is realistic that has made some interesting hallucinations
Actually CyberPony can't do 'strawberry blonde' (or 'bleached blonde'). If you go to A1111 and check you'll see 'strawberry blonde' and 'blonde' come out the same but with strawberries often somewhere in the picture of the former. The reason Lily so often wears clothes with 'bleached' (approx) written on them is because the model doesn't know what to do with "bleached" in "bleached blonde".

There's lots of other colours with similar problems (e.g. 'sea green' clothes often produce ordinary green clothes but with the ocean in the background - even if you're in the bar).

Maswoo's GenAI uses json files to translate colours, clothes, etc that confuse a model into something that doesn't. I'll be implementing that in mine too, with pretty much everything model-specific (including prompts) migrated to a json named and edited for the relevant model. When I do, 'strawberry blonde' will become 'golden' in the CyberPony json, which gives a pretty good approximation.

Also, GLASSES!!! omg CybePony be failing bigtime with glasses (maybe unique to my 512x768 rez setting?) Any quick way to change a character to no-glasses?
Yeah, CyberPony tends to revert to generic looking faces when they wear glasses and often gets confused about whether or not they're being worn. Part of the problem is coded. It tries to anticipate whether the glasses are visible (i.e. not when the NPC is facing away) and only puts them in the prompt when they are. Otherwise you can get odd effects as the model tries to put the glasses somewhere in the image. I'm gonna have a look at that but it's way down my list. And no, I don't know of any cheat to get rid of glasses without coughing up 5000 for LASIK surgery.

Not a GenAI mod bug but it seems the new update lets you infinitely continue the last position even if both of you are at zero energy. Or is that a feature?
Haven't progressed that far yet. I'll check it when I do. Thanks for the tip.

When there are two people in a scene both get autogen'd but only one of the images is displayed in LR2.
That's especially a problem during threesomes (which I've implemented in my mod). As the mod only captures one girl description at a time threesomes look like a guy fucking twin sisters, with the other participant left out. I suspect there's a fix but I'll have to dig through a lot of source code to find it, so it's a fair way down my list. It's also hard to stop descriptions for people who share an image from smearing together. The men in my images often resemble the women and wear makeup. If I try to make the men look more masculine it often affects the women too.

I suppose a narration toggle on the toolbar would also be pretty awesome. At, 15-20 seconds per generation, I can't play with EVERY... single.... narration.... dialog.... getting rendered but being able to quickly toggle it on for a special/unique scene would be almost as game changing as my pre-cog render wish :alien:.
If you switch off 'Process Narration' it will only incorporate narrative descriptions into the scenes I've hardcoded them into. If rendering every image is a problem (it would be for me if I had to wait 15-20s per image) you can open SD_PromptBuilder_ren.py in the GenAI folder with a simple text editor like Notepad and search for "actiontext:". Repeating the search will walk you through all the scenes where the narration affects the image. (Altering the file and saving voids the warranty.)
 
Last edited:
May 23, 2023
266
184
119
Not a GenAI mod bug but it seems the new update lets you infinitely continue the last position even if both of you are at zero energy. Or is that a feature?
Yeah, I got to that now. Definitely a bug. It also lets you keep fucking straight after orgasm even without Ashley's energy serums.

Kinda gobsmacking this one got through to a release version, especially given the time between releases for testing and that so little else seems to have changed. Looks like they released a porn game without testing the fucking.

The release notes are unchanged since the July version so I'm not sure what's supposed to have been updated.
Maybe there's good stuff I haven't come across so far, but for now this release is looking like a big step backwards.

If I wasn't using this to inform my modding I'd revert to the previous version and wait for the devs to get their act together.
 
Last edited:

gimb

Newbie
Feb 17, 2018
17
8
179
So for those interested in speed i definitely recommend DMD2 models like those done by Mklan

or

i consistently get under 10 sec with the minimum hardware requirements and the following settings

"cgi": "1",
"resolution": "616x792",
"steps": "5",
"sampler": "Euler a",
"scheduler": "Karras"

if you have better hardware you can easily increase the steps to 8 cfg to 1.5 and add an aDetailer for faces
 
  • Like
Reactions: Magister Crudi

NaughtyAnon

Newbie
Apr 2, 2020
44
36
152
I just started retesting with the newly released LR2 update. (I wish they'd package the Real Porn mod separately. I don't use it and don't appreciate its doubling of download size).

The bad news is the only changes I've seen to the game so far are trivial alterations to some on-screen menus and having all the old save games broken.

The good news is I'm yet to find any compatibility issues with my GenAI mod, though it's early days yet. I'll be interested in hearing from you whether the new version impacts Maswoo's mod.
I jumped in a little before having to run off to work and so far nothing appears to have changed for me using Maswoo. All my saves work and its still generating decently from my unfinished prompts. I'll try more later once I am off work and have a moment to sit down.
 

elpe

Newbie
Feb 8, 2021
26
56
114
Can someone explain how to build prompts for this mod? Not in game but as a .json.
 

kxx

Newbie
Aug 11, 2016
24
29
106
Do you need to do anything else other than setting up stable diffusion, copying the GenAI folder into the mod folder and putting those command lines into webui-user.bat?

Cause Stable diffusion worked just fine if I used a prompt on their UI, but when I put those args inside the bat file (--medvram --no-half-vae --listen --port=7860 --api --cors-allow-origins *) and tried running the game, even thought the UI worked and the game ran, those image generation buttons didn't do jackshit. They just showed "generating" for like half a second after clicking them and no image ever showed up.

And that's with AnotherMike's, with maswoo's the game doesn't even open anymore, I just get some error about some print line having no parenthesis on the mod files and that's it.

Also, if I close the terminal, the game warns me that it can't connect to the API, so it's connecting to it, it just doesn't do anything for whatever reason.

You don't have permission to view the spoiler content. Log in or register now.
 
May 23, 2023
266
184
119
Can someone explain how to build prompts for this mod? Not in game but as a .json.
If you're using maswoo's GenAI you can already edit his jsons to have some effect on the prompts.

If you're using mine or AnotherMike's you need to edit SD_PromptBuilder_ren.py in the GenAI folder, though I wouldn't recommend it unless you have some basic familiarity with programming. After saving the edit you will need to either delete the SD_PromptBuilder_ren.pyc file or (preferably) use 'shift-R' ingame to force a rebuild.

I've started work on moving some prompt building out to jsons in my version but I'm more than a week from an alpha release for that.
 
May 23, 2023
266
184
119
putting those command lines into webui-user.bat?

Cause Stable diffusion worked just fine if I used a prompt on their UI, but when I put those args inside the bat file (--medvram --no-half-vae --listen --port=7860 --api --cors-allow-origins *)
Those command line args are AnotherMike's suggestions for GPUs that struggle with Stable Diffusion. If you've got a recent NVidia GPU you should take out --medvram and --no-half-vae.

But that wouldn't fully explain the errors you're getting. Your first screenshot suggests SD is throwing garbage images from the prompts the game sends it.

Also, if I close the terminal,
What do you mean by 'close the terminal'?
Do you mean the GenAI Config menu or are you running it across a network?

If you tell me your hardware specs and post a screenshot from GenAI Config showing a prompt it's generating I might be able to offer more advice.
 
Last edited:

idfkru

Newbie
Nov 6, 2024
41
38
86
I just get some error about some print line having no parenthesis on the mod files and that's it.
Yeah there's a mistake in the code. Go to the mods/GenAI folder, edit the file SD_UI.rpy, go to line 127 (just ctrl+f for mismatch, it's the only place it's used in the document) and put parentheses where the error message tells you to, so it should say:
print("JSON type mismatch for "+name)
Can't speak for AnotherMike's, haven't played around with it yet, but let me know if maswoo's works after fixing that line. I've been having some issues with maswoo's when toggling prompt override but with that excluded, I haven't run into any other issues thus far.
 
  • Like
Reactions: Magister Crudi
May 23, 2023
266
184
119
Yeah there's a mistake in the code.
I'm guessing it only crops up when you don't have a json that matches your checkpoint.

So would putting your model name in the json "Model" field avoid this?

I haven't done much testing with maswoo's and appreciate your feedback as I'm trying to implement some of his features in my GenAI mod.