How 2 duo or "Just inpaint bro lmao"
Prompt info:
- You can use whatever model you like.
- Model is stablemondaiSDG (noobAI-vpred SDXL).
- 30 steps, DPM++ 2M SDE, beta.
- Smoothed Energy Guidance (Sigma End: 8)
- RescaleCFG for reForge (Alternative; 0.7)
Extra info:
- Images may be slightly cherrypicked due to the natural variance of AI. In no case did I need more than 3 attempts.
- As always there are many solutions to the same problem. My methods focus on being consistent, rather than being strictly automated.
- "OC" in this tutorial refers to characters that are a sum of tags, not single tag IP character trained into the model.
- The pics look like shit. Idc for a tutorial.
TODO:
- Add a more complex example that does not use IP chars or uses a character lora.
Why are duos hard
1: SDXL has no real order within tags. Natural language prompting is inconsistent/placebo.
- SDXL Prompts have no real way to associate the order of tags or spatially connect them with each other. (male, blue crocodile), (female, red leopard), may result in an association of a colour with a given character, but not ensuring that it will land on the correct one. The same goes for the gender.
The BREAK keyword does NOT help here either, a common myth. - This is also why duo scenes with established IP characters are far easier since all descriptions of them are baked into one tag. You will never have a yellow Lucario and a blue Braixen because you aren't required to specify their fur color.
2: Prompts have bleedover issues and biases.
- Bleedover is when a tag intrinsically implies another associated concept. Prompting "Kimono" will steer the rest of the scene to be Japanese. These associations also result in biases. A Lucario/Braixen pairing will more often result in Lucario being male and Braixen female because that's the common training data with these chars. Wanting to swap their genders can be a nuisance.
- Bleedover can also simply refer to features landing on the "wrong" character. For the AI there is never a "wrong" location for a feature.
3: Character Loras have inherent issues with bleeding into the other character
- Not much to say. This is an issue with Loras themselves and does not imply that the Lora is bad.
4: Regional prompting is an imperfect solution.
- Regional prompting is a somewhat hacky implementation for prompts to only affect certain regions. This can work quite well, but has a couple of limitations that one needs to be aware of.
- RP tends to not be very compatible with loras. This includes character AND style loras. Specifically separating a lora into only a specific region is possible with certain modes you can toggle, but those have their own caveats.
- RP can be very rigid unless very specific masks are provided. Sectioning two vertical regions will make two chars stand next to each other, but that's a little boring. Providing masks 'can' solve this.
- RP is unintuitive in how it should be used. Common/global regions, different weights, sometimes things will just not work. The more complex your scene, or the more regions, the more it shits the bed. Sometimes it works well sometimes not at all. Prone to user error.
- RP often does not even solve practical problems. Imagine a mating press image that is 2-sectioned horizontally, a male human on top and a female fox on the bottom. The lower portion has the prompt "fox, digitigrade". Since the human will extend his legs to the lower portion of the image, he suddenly gets pawpads. As soon as characters actually intersect, RP becomes clunky.
- RP is still useful for generating bases for images, to use in image2image, or for simpler scenes.
The Solution: Dummy Inpainting
While several Solutions exist, the most consistent solution I have found goes something like this:
Duo scene with char A and char B.
- Generate your duo scene with "dummy" characters and focus on the pose and background.
- Optional: I2i Upscale your image.
- Separate your prompt similar to how you would for a regional prompt. Global | Char A | Char B.
- Roughly sketch additional features your characters have into your image. IE; if char A has purple horns you draw roughly draw purple horns on their head. You want to "prime" inpainting to autofill these features after.
- Inpaint char A by '#' commenting out the lines for char B. Mask the entire character and try ~0.6 denoise, and maybe do a second pass after on a lower ~0.3 denoise. Repeat the same for char B.
- Optional: Use the prompts from both char A/B to inpaint the "seam" or overlapping regions in-between the characters at high padding and low denoise to blend them in.
As always: The most powerful AI feature is inpainting and the second is an image editor to help inpainting out.
Dummy gen (generating a base)
Goal:
In the following example the goal is to have a male Braixen fucking a female Lucario.
Problem: The gender bias is heavily skewed towards female Braixen, male Lucario.
Solution: Generate a base, swap the chars.
Note: This technique also works for OCs, or chars with Loras. For tutorials sake I chose an easy example with IP chars.
Positive
masterpiece,
side view,
vaginal penetration,
duo, braixen, lucario,
Negative
worst quality
Not much to say here. Remember to keep your prompts simple. The larger your prompts, the less it will adhere to each individual tag.
Image2image sketch rerolling (combating bias / making a base)
First I sketch over the image in GIMP. Any image editor will work. The position here makes the penetrator pretty clear and hopefully swaps the gender bias around.
Same prompt as above.
0.8 denoise 1x scale image2image.
+raised leg, table lotus position, balls, breasts,
I add a few extra prompts. The minimal prompt above resulted in a table lotus position so for AI coherency it gets added.
After a few attempts resulted in double-sided dicks, adding balls mostly ensures it starts with Braixen (the AI will have an easier time figuring out whose dick it is). I also added breasts because Lucario should have some. These are things I added after 2 failed attempts because I figured they would fix it, which it did.
OC's and Lora chars.
Since so much of the image is changing I opted to do an i2i roll to somewhat render these chars before upscaling.
As IP chars, it's fairly reliable to do a full i2I. If you did OC's or Lora chars, you may want to separately inpaint them as explained later, instead of just doing a full i2i.
3rd try. Closer to what we want. Breasts landed on both chars (again, the prompt has no way of knowing on who to put breasts on!).
Smaller edit over egregious parts.
Same prompt as above.
0.6 denoise 1.75x scale image2image.
+looking at partner,
removed breasts
At this point I feel like I mostly have my rough edits down and target my final resolution.
I removed the breasts tag to hopefully skew Braixen to not get them again, Lucario already has them so it should recognize that. Looking at partner was added after the first attempt made them go cross-eyed.
0.6 denoise is high but Noob can handle it reasonably well at those resolutions (especially for simple scenes). You can use lower denoises if things mess up or you want less change, I recommend 0.4 for a safe one.
Braixens breasts are back. The female Braixen bias is that strong. we will need to inpaint.
Inpaint refining (Seperate char Inpainting / The better regional prompt)
I sent the above image to inpainting.
I divide my prompt so I can toggle the individual chars section on and off with the "#" which comments the rest of that line out.
The resolution I choose is 1344x1344 (NoobAI allows for slightly higher resolution, you can go 1024x1024 on Pony or similar).
The denoise I choose is 0.4, which works fine with my sampler/scheduler combo for refining for details and mild changes.
Padding 94, only masked.
In GIMP i quickly cut Braixens tits off again (not pictured). This is again to "prime" the image. Inpainting will try to autofill, so if it sees tits it will continue to have them in even if not prompted for.
I mask the entire Braixen roughly. You don't need to be precise (not pictured).
Obviously not perfect, but I hope you get the general gist. Next I would disable Braixen's prompt and go over Lucario again. Rinse repeat until satisfied.
An additional last step would be to activate both char regions and inpaint the regions where they intersect on a high padding and low denoise, to blend them together seamlessly.
If you are using a character lora, you may also put the <lora> activation phrase into the characters section to on/off it easily.
This is by far the most time consuming (and fun!) step.
Tips and Tricks: (unfinished/todo)
When to use Regional Prompting:
I personally think Regional Prompting is more useful to ensure certain prompts don't land in a region, rather than they do land in one. If you image2image an image that is already semi-finished, RP is useful in making sure that prompts don't bleed over again. An example would be upscaling your image while having RP on.
Regional Prompter or Forge Couple or one of the others:
Whichever works. Last I checked the regular Regional Prompter works on reForge too.
What about 2 OC's or characters needing a Lora?:
Essentially just the same method as the Braixen/Lucario example, only you may want to inpaint before the upscale to roughly get the characters in place. This is mostly to make your life easier since working on larger images is slower.
FAQ
Why not use the BREAK keyword?
TL;DR: You probably never ever want to use BREAK outside of Regional Prompting.
- First of all, when using Regional Prompting the BREAK keyword gets a new function to separate regions (equivalent to the ADDCOL/ADDROW keywords). Usage here makes sense, but it's usually not what people are talking about when "separating characters with BREAK".
- Outside of Regional Prompting the BREAK keyword closes the current token block, visible in the top right of the prompt box on the webUI. Prompt blocks are 75 tokens long. By using BREAK you can force the current block to close prematurely. The supposed effect this might have is, if 2 separate characters are in 2 separate token blocks, then their features will not bleedover. Opinions differ but it is generally agreed upon that this is not consistently reproducible and mostly placebo. It is also not how CLIP functions from a more technical viewpoint.
- A legitimate use for BREAK would be ensuring that a tag does not get split up by the token block ending. Imagine (snow leopard) sitting right on the 75 to 76 mark and getting sent separately as snow and then in the next block as leopard, losing the proper tag association. Realistically no one actually places manual BREAKS to avoid this. It's too hard to spot, too annoying to manually fix.
- Another mostly placebo use is to give "more emphasis" to a given set of tags if they sit in a smaller block. For example (masterpiece, best quality, BREAK), would not mean that the AI spends proportionally more effort on these tags because they occupy the entire block.
- Most importantly, the more Token blocks you open, the less emphasis your individual prompts have. You will always notice a drastic difference between a gen that just uses a single 75 token block and one that uses 76 (2 blocks). The general strategy is to be efficient with your prompt. The smaller the prompt the better. BREAKs generally tend to make images worse by filling your blocks with junk.
When to upscale
- Usually I recommend making rough edits first and fine edits on the upscale. Since upscaling generally requires the full prompt, most inpainted features for the two chars are bleeding into each other again. I find it's less work if I do my sketch and edits on the upscale. You can try to upscale with Regional Prompting turned on and masked regions, I personally don't bother. Depending on the specific chars it could be very useful to properly inpaint render the characters on the raw resolution though. YMMV.
Okay but when to use Regional Prompting
- Truth be told I never use it anymore. It's way too annoying to make work tbqh. Might be skill issue. Might be the fact that I don't just do 4 chars standing next to each other, not interacting at all. I also don't really use it for upscaling or i2i.
Inpaint Sketch tab
- Don't use. It does nothing special, its just Inpainting+1bit brush. It does not interpret your sketch differently than regular Inpainting would. Use an image editor (I use GIMP). You have more options to move things, useful brushes, layers, etc.