Some pornography has a single character. Doing that in Stable Diffusion is pretty straightforward.
However, what happens if one wants to portray multiple, different characters? Normally, if you describe multiple characters, you’ll wind up with their characteristics merged. Granted, “twins” is a thing in pornography, but there’s more out there than that.
Two ways to do this:
-
Inpainting, where one manually erases part of an image, and then regenerates that part with a different prompt. This is powerful, but a pain in that it’s more-time-consuming, and annoying to go back and change the image as a whole.
-
Regional prompting. Here, the image is split into several sections, and different prompts can apply to different regions. Stable Diffusion has an extension to do this.
I put up a short, non-pornographic, description of using regional prompting with Stable Diffusion earlier:
https://lemmy.today/post/2916131
But…it’s also got handy applications in rendering pornography, as long as a scene tends to split around some region that can be defined by linearly splitting the image. That won’t work for all pornographic scenes, but it will work for some.
Let’s start from the final step in my original example, after the Regional Prompt extension has been installed and enabled and configured:
(two women sitting side-by-side:.1), by neal adams ADDCOMM ursula von der leyen ADDCOL angela merkel
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 11, Size: 1024x1024, Model hash: ebf42d1fae, Model: realmixXL_v15, Token merging ratio: 0.5, RP Active: True, RP Divide mode: Matrix, RP Matrix submode: Horizontal, RP Mask submode: Mask, RP Prompt submode: Prompt, RP Calc Mode: Attention, RP Ratios: “1,1”, RP Base Ratios: 0.2, RP Use Base: False, RP Use Common: True, RP Use Ncommon: False, RP Change AND: False, RP LoRA Neg Te Ratios: 0, RP LoRA Neg U Ratios: 0, RP threshold: 0.4, RP LoRA Stop Step: 0, RP LoRA Hires Stop Step: 0, Version: v1.5.1
But instead of a scene of “two women sitting side-by-side”, let’s replace this with some other scene that will split in about the middle of the image, with one character on each half: “lesbian kiss”:
(lesbian kiss:.1), by neal adams ADDCOMM ursula von der leyen ADDCOL angela merkel
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 11, Size: 1024x1024, Model hash: ebf42d1fae, Model: realmixXL_v15, Token merging ratio: 0.5, RP Active: True, RP Divide mode: Matrix, RP Matrix submode: Horizontal, RP Mask submode: Mask, RP Prompt submode: Prompt, RP Calc Mode: Attention, RP Ratios: “1,1”, RP Base Ratios: 0.2, RP Use Base: False, RP Use Common: True, RP Use Ncommon: False, RP Change AND: False, RP LoRA Neg Te Ratios: 0, RP LoRA Neg U Ratios: 0, RP threshold: 0.4, RP LoRA Stop Step: 0, RP LoRA Hires Stop Step: 0, Version: v1.5.1
And maybe instead of using government officials from the Bundeskabinett, we replace them with more-conventionally-portrayed-in-pornography characters. Let’s get Ursula von der Leyen out of there and put in a Disney princess:
(lesbian kiss:.1), by neal adams ADDCOMM princess jasmine ADDCOL angela merkel
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 9, Size: 1024x1024, Model hash: ebf42d1fae, Model: realmixXL_v15, Token merging ratio: 0.5, RP Active: True, RP Divide mode: Matrix, RP Matrix submode: Horizontal, RP Mask submode: Mask, RP Prompt submode: Prompt, RP Calc Mode: Attention, RP Ratios: “1,1”, RP Base Ratios: 0.2, RP Use Base: False, RP Use Common: True, RP Use Ncommon: False, RP Change AND: False, RP LoRA Neg Te Ratios: 0, RP LoRA Neg U Ratios: 0, RP threshold: 0.4, RP LoRA Stop Step: 0, RP LoRA Hires Stop Step: 0, Version: v1.5.1
And maybe drop Merkel in favor of Sailor Moon:
(lesbian kiss:.1), by neal adams ADDCOMM princess jasmine ADDCOL sailor moon
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4, Size: 1024x1024, Model hash: ebf42d1fae, Model: realmixXL_v15, Token merging ratio: 0.5, RP Active: True, RP Divide mode: Matrix, RP Matrix submode: Horizontal, RP Mask submode: Mask, RP Prompt submode: Prompt, RP Calc Mode: Attention, RP Ratios: “1,1”, RP Base Ratios: 0.2, RP Use Base: False, RP Use Common: True, RP Use Ncommon: False, RP Change AND: False, RP LoRA Neg Te Ratios: 0, RP LoRA Neg U Ratios: 0, RP threshold: 0.4, RP LoRA Stop Step: 0, RP LoRA Hires Stop Step: 0, Version: v1.5.1
Now we’ve got the prompt from one region influencing the other in a way that doesn’t quite make sense due to the prompts for different areas interacting; Jasmine has a few blonde hairs up front, and an outfit with coloration coming from Sailor Moon. Regional prompting can take it longer to converge on a single image. Let’s retry, giving Stable Diffusion more sampling steps – from 20 to 30 – to try to reconcile the images it’s working with, to converge on something stable. That’ll increase render time, but tend to produce fewer odd interactions.
(lesbian kiss:.1), by neal adams ADDCOMM princess jasmine ADDCOL sailor moon
Steps: 30, Sampler: Euler a, CFG scale: 7, Seed: 15, Size: 1024x1024, Model hash: ebf42d1fae, Model: realmixXL_v15, Token merging ratio: 0.5, RP Active: True, RP Divide mode: Matrix, RP Matrix submode: Horizontal, RP Mask submode: Mask, RP Prompt submode: Prompt, RP Calc Mode: Attention, RP Ratios: “1,1”, RP Base Ratios: 0.2, RP Use Base: False, RP Use Common: True, RP Use Ncommon: False, RP Change AND: False, RP LoRA Neg Te Ratios: 0, RP LoRA Neg U Ratios: 0, RP threshold: 0.4, RP LoRA Stop Step: 0, RP LoRA Hires Stop Step: 0, Version: v1.5.1
And we’re at the submitted image.
Note: I’m rendering batches of and choosing the (subjectively) best in each step, so the seed will change around from stage to stage; it’s a solid way to improve output at the expense of a bit more render time. I do include the seed of the used image in the description, so you should be able to reproduce the same image with the same settings.
Note: For reproduction purposes: I’m not using the base Stable Diffusion XL model, which hasn’t been trained on pornographic images, and which with one will have a difficult time rendering most pornography (well, maybe not non-nudes like this). I’m using a derived-from-the-base-model model available from civitai.com. There are probably more by now; this just happened to be the first that someone completed training on after the SDXL release.
Tangled Slinky@infosec.pubEnglish6·9 months ago