Create and Fuck your AI Slut -70% OFF
x

Mod Lab Rats 2 Reformulate GenAI Mod Thread

May 23, 2023
266
184
119
Thanks but to be honest it would be way more simple for me to take a look at the changes you made to vanilla (vanilla mod?) then to your promts.
Not the vanilla LR2. The July version of the modded version.

Are that the things you guys call checkpoints
Checkpoints are another word for the models. I prefer it because it's less ambiguous. Some people refer to checkpoints and loras collectively as 'models'. Both A1111 and Civitai use 'checkpoint'.

Sorry I'm a noob to this. What did you change and were, what file. Was it of the mod was it of the game. I hope I don't come of as rude :) that is not my intention. For me SD_Cache is only a file of the mod. I guess it reffers to Stable Diffiusion. If you could share that file that would be great.
A month ago I was just as noob as you. I hope no-one considered my questions rude and I sure don't see that in yours.

I hope my answers don't come across as rude or patronising. I try to assume minimal prior knowledge from the person I'm writing for and I can see why some people might think I'm insulting their intelligence.

The files I mess with are all in the GenAI folder and come originally from AnotherMike's narration GenAI mod. SD_ColorConversion_ren.py
SD_NarratorOverride_ren.py
SD_PromptBuilder_ren.py
SDClient_ren.py
SD_UI.rpy

PromptBuilder is the one I modded the most in the alpha test version I posted here but it now bears little resemblance to the one I'm still developing. If you look in the alpha version you'll see the big ugly slabs of code I use to build the prompts from the game data (mostly) defined in SDClient. They're set up for CyberRealistic_Pony and will give mixed results for other checkpoints.

I haven't touched any core LR2 code, just GenAI mods.
 
  • Like
Reactions: elpe

elpe

Newbie
Feb 8, 2021
26
56
114
Yeah I figured out that I had to work in promt builder. I did not touch the narration version jet, as I did not get how to change checkpoints (models) or promtlists. The Ui Ingame seems reducet to me. Could you explain that?
 
May 23, 2023
266
184
119
Yeah I figured out that I had to work in promt builder.
Depends on what you're trying to change and which mod you're starting from. I started with AnotherMike's because that was the first one I found. In maswoo's version you can mod the prompts in jsons associated with checkpoints - which makes a lot more sense. I'm shifting towards that but as maswoo's doesn't handle narration or character sensitive prompting or backgrounds well I'm using a slightly different approach.

I did not get how to change checkpoints (models)
To train checkpoints (or loras) you need to use a training package and a big collection of images. I use because installing A1111's 'native' Dreambooth extension inflicts a world of pain with library and requirement incompatabilities. But I've barely started on that and am still learning how to use Onetrainer.

The Ui Ingame seems reducet to me. Could you explain that?
I'm guessing you mean 'the GenAI config UI seems reduced to me" but I'm not sure what you're comparing. Different GenAI mods use different UIs, with different fields in the UI. Most of what AnotherMike puts in the UI maswoo puts in jsons, but a big advantage of AnotherMike's is that if the prompt you built didn't work you can tweak it on the fly ingame until you find something that does, then code it into the PromptBuilder.
 

elpe

Newbie
Feb 8, 2021
26
56
114
Depends on what you're trying to change and which mod you're starting from. I started with AnotherMike's because that was the first one I found. In maswoo's version you can mod the prompts in jsons associated with checkpoints - which makes a lot more sense. I'm shifting towards that but as maswoo's doesn't handle narration or character sensitive prompting or backgrounds well I'm using a slightly different approach.
I think we are talking past each other rn.
Right now the only thing I want to know how to change Mawos Ai mod (the SD_promtbuilder file ) to get more positions.

I did not jet get the code changes to work that busoni posted. But I'm sure I figured out how they should work. I'm more of an autodidact.
If you share your edited file for example I'm sure I could figure it out. How Models (Checkpoints) and Loras work I know by now (a bit). :)
 

gimb

Newbie
Feb 17, 2018
16
8
179
Yeah, they look good (albeit a bit colourless), but how well do they match the game locations?

The modded version of AnotherMikes GenAI I've been working on uses the currentPerson.location of the girl to detect location, ...
That code snippet is in this version as well.

Sadly those pictures are how far i've could push the background to the location specific while stille retaining most benefits of img2img.
The colorlessness also stems from that.

I will try later if i can push it a bit further, the images without img2img are fine
 
Last edited:

gimb

Newbie
Feb 17, 2018
16
8
179
I think we are talking past each other rn.
Right now the only thing I want to know how to change Mawos Ai mod (the SD_promtbuilder file ) to get more positions.

I did not jet get the code changes to work that busoni posted. But I'm sure I figured out how they should work. I'm more of an autodidact.
If you share your edited file for example I'm sure I could figure it out. How Models (Checkpoints) and Loras work I know by now (a bit). :)
Havent gotten busoni's changes to work either. But for maasows mod there aren't currently more positions available than those in the sample json. There is a merge request to the main game that should enable it but i didn't figure out yet how to enable it via the mod.
 
May 23, 2023
266
184
119
I think we are talking past each other rn.
Now I think I get it.

I'm pretty sure you can edit all the game sexual prompts in maswoo's jsons. However I haven't seen any json's that use all of them.

My current version has had all the prompt code stripped out to be read from json's as with maswoo's, but you can download an earlier version with most of the game's July version sex prompts here. The recently posted version has a couple more sex positions and may not retain the same position names as the July version.
 

NaughtyAnon

Newbie
Apr 2, 2020
44
36
152
Now I think I get it.

I'm pretty sure you can edit all the game sexual prompts in maswoo's jsons. However I haven't seen any json's that use all of them.

My current version has had all the prompt code stripped out to be read from json's as with maswoo's, but you can download an earlier version with most of the game's July version sex prompts here. The recently posted version has a couple more sex positions and may not retain the same position names as the July version.
I actually recently dug through all the game source code and have began attempting to build the prompt set using the full list. Well at least what I saw when I last checked, need to see if there were updates. I added them all because I noticed I was getting a suppressed error "No Position Found" when generating. Here's the list added into a prompt file that I was testing before work slammed me.

Screenshot 2025-10-18 084639.png
 

elpe

Newbie
Feb 8, 2021
26
56
114
I first did this checking if it was a sex scene or not so it could show doggy sex or just bending over at the office :D, everything is doggy. Then it would be the "missionary" for sleeping vs "missionary sex" and many others. the positions repeat a lot and do not translate well. Then when I wanted specific images for "Show me your tits", or "give me your panties", I looked into labels. Now I check for the label called and associate it with a custom pose in the prompt file. This really expands the mod but you end up having to "babysit" sooooo many position prompts :D only recommended when you've got your desired checkpoint picked, otherwise you will be in a never endind cycle of tweaking the prompt for the right result, changing checkpoint and seeing it doesnt work anymore. I leave the basic references for label based detection:


Code:
def detect_label(label_name, abnormal):
     
        if label_name == "demand_strip_tits_label.start_stripping":
            store.current_label_name = label_name
         
        elif label_name == "demand_panties_label.start_stripping":
            store.current_label_name = label_name
         
        elif label_name == "sleeping_walk_in_label":
            store.current_label_name = label_name
         
        else:
            store.current_label_name = ""
         
    config.label_callbacks.append(detect_label)

Code:
 position_data = PositionData()
         
            current_position = current_person.position
            position_key = current_position
            # Access the stored label name
            if store.current_label_name == "demand_strip_tits_label.start_stripping":
                position_key = "strip_tits"
         
            elif store.current_label_name == "demand_panties_label.start_stripping":
                position_key = "panties"
         
            elif store.current_label_name == "sleeping_walk_in_label":
                position_key = "sleepwalkin"
         
         
            else:
                position_key = current_person.position
Well they figured it out if you look into the promt shared file you can see it. The lables replace positions and corespond to the action you take ingame. But I don't know were to put this in the mods code.
busoni share your modded files pls ^^!!!!111!!11!
 

gimb

Newbie
Feb 17, 2018
16
8
179
That code snippet is in this version as well.

Sadly those pictures are how far i've could push the background to the location specific while stille retaining most benefits of img2img.
The colorlessness also stems from that.

I will try later if i can push it a bit further, the images without img2img are fine
So i fixed the colorless backgrounds by changing the background to green.
What do you think?
 

x760917

New Member
Jul 19, 2020
3
4
79
It's one of AnotherMike's. Here's the whole thing.
Don't forget to either delete the .rpyc files from the GenAI folder or force a full rebuild with shift-R.

Edit: 11-Oct-2025. GenAI.zip replaced with V0.01 alpha
I'm a Chinese user and downloaded your mod.
I know nothing about artificial intelligence or English. Using a 4070,
running a long image takes about 7 seconds.
I'm currently using .
I'm very happy with the final image and wanted to share it with everyone.
Without any programming knowledge, I modified SD_PromptBuilder_ren.py.
Added: teen, above the knee, masterpiece, best quality, cute
Deleted age-related prompts
Deleted shoe-related links
Deleted name and race prompts
The character doesn't scale up and down
Adjusted the UI so it doesn't block the image
Want to add a button to use a variable seed for the auto-image and modify the image
But I don't know programming.
Pornography makes people hard

57029547035520731.png 108619571935586267.png 70261310935782874.png 00009-34865365.png 00011-35258580.png 00002-34013390.png

I successfully modified the buttons.
I changed the left and right buttons to New Seed and Toggle Auto.
Always on button in automatic mode
Use Google Translate for all
螢幕擷取畫面 2025-10-19 122816.png
 
Last edited:

busoni

Newbie
Mar 15, 2022
27
22
85
Well they figured it out if you look into the promt shared file you can see it. The lables replace positions and corespond to the action you take ingame. But I don't know were to put this in the mods code.
busoni share your modded files pls ^^!!!!111!!11!
Here you go, keep in mind it's not clean code. There are leftover remnants there of previous iterations and things like that.

To add more positions:
in the file position_prompt_enhancer.rpy, line 171 you have the labels to detect.
in the line 209, you add the position name you give it on the prompt file.

I need to make it a dictionary to avoid creating 20 elifs, but the version I had of that got wrecked trying to get the threesome workings and had to restore backup.

various.txt files are references I took from the game code. pos_cmpl_list is very useful, it should give you most labels for sex positions but not the descriptions. There's another file caled command_descriptions with them. I wanted an AI agent to look in the first list on the second and based on the narration and dialog to write descriptive promts but it it got prudish about not wanting to work with sex stuff and I've been too lazy to make prompts for everything so far. Playing normally now and when there's a scene I miss not having photo for, I just add it.

Hope it helps :)
 
May 23, 2023
266
184
119
I actually recently dug through all the game source code and have began attempting to build the prompt set using the full list. Well at least what I saw when I last checked,
Thanks for that.

It seems to be missing a few though (e.g. threesome positions).
 

Junkbom

New Member
Apr 10, 2017
12
4
172
does this mod still only use outdated A1111?

also does it function better with illustrious checkpoints yet?

sorry if these questions were answered here or the game thread, its been months since i looked at the status of this mod.
 

samtide

New Member
Oct 23, 2020
1
0
11
Is there anyway to extract if a character is lactating? It would be cool to add.

Also I was trying to figure out how to extract the number of days preg so that I could use it on a pregnancy slider.
 
May 23, 2023
266
184
119
does this mod still only use outdated A1111?
There's a few versions of the mod but so far as I know all of them, including mine, are still locked into Stable Diffusion. That will probably change at some point (Flux maybe?) but I don't know of anyone doing it for now.

I can't say I've checked SD UIs other than A1111 - which I agree is not only outdated but no longer seems to be updated and is becoming increasingly incompatible with the software libraries it's built on - but I know of no reason you can't use any of the newer UIs. I've been considering moving to ComfyUI but haven't found time to learn it yet.

also does it function better with illustrious checkpoints yet?
'Better' is a subjective thing. If you've got a checkpoint you like and have found prompts for it that give images compatible with LR2 that you like I'd suggest you install and if none of his existing prompt jsons are to your liking, edit them until they are.
 
Last edited:
  • Like
Reactions: Junkbom

zalamander

Newbie
Oct 2, 2017
20
16
178
Automatic1111 is outdated, but still is the only one that works flawlessly with Nvidia (from 30xx and upwards), and AMD (6800 and UP)) flawlessly. SD.NEXT has a random bug that produces black images from time to time, and ATM cannot be fixed because the coder cannot replicate the bug. SD.FORGE is hit and miss. For some reason that is unknown at this stage, it can be quite fast or quite slow. ConfyUI Nodal API has a level of pain that i find disturbing.

Anyways, i present another of my bastardizations of code, based on an older version of Magister Crudi mod, with some personal editions to the prompts. It will auto detect AUTOMATIC1111, SD.NEXT, and SD.FORGE versions of SD. (main difference is the API's and ADetailer plugin call, SD.NEXT is not compatible with it, and has it's own detailer). No guaranties whatsoever, and is for those who knows how to install any of the SD versions. (Can be used as is, but if you use another computer to do the generation,put the IP address in SDClient_ren.py and change "self.sd_main_url = 127.0.0.1" to the IP address you will use).
 
  • Like
Reactions: Magister Crudi

waaazzzaaa

New Member
Nov 3, 2022
6
5
127
does this mod still only use outdated A1111?

sorry if these questions were answered here or the game thread, its been months since i looked at the status of this mod.
Yes and no.

There are a few versions of this mod now and some work with newer SD stuff easlily and some don't. Or maybe it's more precise to say, some are tuned for speciffic setups.

I've been using Magister Crudi mod from page 1 to test with. I'm on a 16gb ram 8gb vram 3070 laptop. I kept getting randomly huge generation times trying to generate any sdxl resolution on a1111. Turns out the randomness was how much ram was being used by windows and when vram+ram runs out the swapfile gets involved with generation.

I tried every combo of settings in a1111 and the best I could get - with every other program closed - just using a1111 webui @ 832x1216, was about 30 seconds. Running LR2 and usually a few browser tabs, generation would often jump to 1.5min in game because those programs ate up 2gb or more of my 16.

I was reluctant to try Forge (a1111 first successor) because I heard it was "complicated" to get it to work with the GenAI mod.

Well, it's not. Forge is just about as easy to setup as a1111. Possibly easier because it picks the best memory setting for you unless you override them. Forge generated 832x1216 sdxl images in 15s and is much better at memory management. Running LR2 and a few browser tabs didn't ever make generations 1.5min.

For any that want to test what works best with their system, I highly recommend StabilityMatrix. It basically automates the install of a1111, forge, forge classic, comfyui and others. Plus it keeps all the checkpoints in a central location for everything to access.

Forge Classic, would be my top reccomendation. It's the succesor to Forge (well, one of the forks) and is being activly developed by a team. Original forge works fine but it's a one man team now from my understanding.

I'm currently using Forge Classic - Neo, beacuse it supports sageattention2, which is supposed to be the bestest fastest, but it wasn't worth the hastle to get that running as it's maybe only 10% faster in game.

Using Forge I can enable hybrid graphics and use the iGPU for all my windows stuff and GPU is just for SD. For me that makes generation go from 1.75it/s to 1.99it/s, if i have youtube goiing in background. I couldn't do that in a1111 because hybrid mode eats about a gig extra of ram.

tl;dr: Use StabilityMatrix to install a1111 and/or Forge Classic. About the only thing you'll need to add is
--api in the config to get it working with LR2. Forge classic will probably be 50% faster than a1111 for most users and the older your card and the less ram you have, the better it will be compared to a1111.


Anyways, i present another of my bastardizations of code, based on an older version of Magister Crudi mod, with some personal editions to the prompts. It will auto detect AUTOMATIC1111, SD.NEXT, and SD.FORGE versions of SD.
I couldn't get it to generate in Forge, Forge classic - neo, StabilityMatrix - Forge Classic or Stability Matrix - a1111. Just flickered Generating for a second. I deleted my a1111 standalone so dunno if it'd work with that. I replaced the SDClient_ren.py with one from Magister Crudi and everything was ok. Probably the autodetect. Which could be a nice feature but if it's mainly for adetailer, maybe just have a user pick their version in the adetailer section?

Prompt changes look interesting tho, I'll try em out on CyberPony.