Here is a snapshot of the img2img version of the GenAI mod (attached zip file), based on version 0.31 (I don't use Discord, so not sure if this is the latest one) I added a few options in the config to switch between img2img and text2img, and to set the denoising strength. The settings I currently use with the DMD2 Real Dream model are this:
View attachment 4814800
I recommend also playing with the denoising strength - a low value like 0.3 will stick more closely to the original graphics/clothing (the ADetailer will still "fix" the face, which can be an improvement) while larger numbers will yield more creative interpretation of the scene/prompt, and possibly more realistic image, but things can also get a bit weird, especially as you get closer to 1 - I would stay below 0.7
Note that the prompt generation is tweaked to work best with img2img, so if you turn img2img off, you might get different results. You can add things to the "Prompt Style" for additional prompting, or edit the python code for more custom prompt construction.
This is still mainly a proof of concept, no a polished product by any means - the prompting needs more work still. Each model has its own optimal settings (sampler, steps, cfg) and handles the prompting differently as well, so its always worth playing around with that if you want different results, but at least this can be a starting point.
There are also situations the mod doesn't handle yet (displaying multiple people at one time ?) and things can also get out of sync when lots of images are being generated in rapid succession, and the wrong image is generated or image skipped/lost. Sometimes generation just stops for me too, and requires a reload (Shift-R in dev mode) and occasionally the game just crashes - not sure if due to bugs in this code, or something else - so beware and YMMV.
Also, model switching from the GenAI mod config screen might not currently work (I commented out some stuff that was giving me issues, but didn't have time to debug) - I use the a1111 Web GUI to switch the model, and just ignore the model in the mod config for now.
Edit: I have been making refinements to the prompting to fix issues that crop up as I play along, so the version attached to the post has been updated to V2 - it's still not perfect, but definitely a lot better, so I recommend upgrading if you are playing along. I have also changed the parameters slightly from above, and now use CFG of 1.5 and denoising strength of 0.6 which seems to work better overall, but feel free to experiment for best results (especially if using different models)
I'm new to all this and I keep getting this error - any help would be appreciated
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/bugfix_additions/compatibility_fix.rpy", line 187, in script call
label missing_label_called(arg1 = None, Arg2 = None):
File "game/script.rpy", line 525, in script call
call talk_person(picked_option) from _call_talk_person
File "game/script.rpy", line 604, in script
$ the_person.draw_person()
File "game/script.rpy", line 604, in <module>
$ the_person.draw_person()
AttributeError: module 'renpy.exports' has no attribute 'render_to_surface'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/bugfix_additions/compatibility_fix.rpy", line 187, in script call
label missing_label_called(arg1 = None, Arg2 = None):
File "game/script.rpy", line 525, in script call
call talk_person(picked_option) from _call_talk_person
File "game/script.rpy", line 604, in script
$ the_person.draw_person()
File "C:\Various\Games\LabRats 2 Beta\lr2mods\renpy\ast.py", line 823, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Various\Games\LabRats 2 Beta\lr2mods\renpy\python.py", line 1178, in py_exec_bytecode
exec(bytecode, globals, locals)
File "game/script.rpy", line 604, in <module>
$ the_person.draw_person()
File "game/mods/GenAI/SDClient_ren.py", line 78, in draw_person_SD
sdClient.draw_person_SD_Local(self, position, emotion, special_modifier, show_person_info, lighting, draw_layer, display_transform, display_zorder, wipe_scene)
File "game/mods/GenAI/SDClient_ren.py", line 159, in draw_person_SD_Local
surface = renpy.render_to_surface(image).convert()
AttributeError: module 'renpy.exports' has no attribute 'render_to_surface'