opparco / stable-diffusion-webui-two-shot

Latent Couple extension (two shot diffusion port)
MIT License
717 stars 152 forks source link

It not possible to make 2 people with different Lora #14

Open levelmaxcat opened 1 year ago

levelmaxcat commented 1 year ago

I try Two shot extension https://github.com/opparco/stable-diffusion-webui-two-shot

It not possible to make 2 people with different Lora

example.

2girls AND 2girls, black hair , AND 2girls, blonde hair ,

result always be 2girls ,same face with +

ClashSAN commented 1 year ago

your actual desire might be to create 1 lora with the 2 characters from 2 loras with 1 character each.

Maybe a merging method already exists to do this effectively, for checkpoints? Then you could extract your lora.

https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion ? I don't know if this works better for dreambooth models, I've only tried style models.

scruffynerf commented 1 year ago

I was totally able to use 2 lora in one image.

I split the space into 3 plus the entire space (so 4 sections) I used a Barbara Eden lora in 3 out of the 4, and a Robot Lora in the middle of the 3...

LORAs are only loaded once, so make sure LORAs are loaded with the prompt part using it.

Results included:

00193-792545082-barbara_eden_AND_barbara_eden_AND_robot_AND_barbara_eden 00191-792545080-barbara_eden_AND_barbara_eden_AND_robot_AND_barbara_eden 00188-3447715649-a_pretty_woman_AND_barbara_eden_AND_robot_AND_barbara_eden 00194-792545083-barbara_eden_AND_barbara_eden_AND_robot_AND_barbara_eden 00192-792545081-barbara_eden_AND_barbara_eden_AND_robot_AND_barbara_eden

If you were correct, she'd be entirely robotic, but the outside edges are normal (Eden Lora) and only the middle is Robot (Robot Lora) (Cover the rest of the photo in 3rds, and look.)

cloudman123 commented 1 year ago

I try Two shot extension https://github.com/opparco/stable-diffusion-webui-two-shot

It not possible to make 2 people with different Lora

example.

2girls AND 2girls, black hair , lora:A AND 2girls, blonde hair , lora:B

result always be 2girls ,same face with lora:A+lora:B

same issue maybe not support?

opparco commented 1 year ago

webui issue, not this extension. extra_networks.parse_prompt does not consider the position on the prompt (i.e. which subprompt to apply to) when reading lora.

scruffynerf commented 1 year ago

I got it to work, by making sure the triggers of the lora were only in the prompt parts I wanted:

it's a tricky balance but doable: prompt: 2girls AND <lora:1xsheHulk_:.5> shehulk wearing a shirt AND 2girls <lora:LuisapSuperCopyright_v1:.8> red cap standard default 3 part split, (whole plus 2 halfs), and did weights of 0.5,1,0.4

took a few tries but...

00071-840416034-2girls AND  shehulk wearing a shirt AND 2girls  red cap

00064-1658389063-2girls AND  shehulk wearing a shirt AND 2girls    red cap

00066-757020145-2girls AND  shehulk wearing a shirt AND 2girls  red cap

you need to adjust loras to not bleed thru, use triggered loras, and weight to reduce the overlap. (again, cover half the image and notice the dividing line...)

levelmaxcat commented 1 year ago

try this prompt

2girls AND 2girls <lora:1xsheHulk_:.5> wearing blue cap AND 2girls <lora:LuisapSuperCopyright_v1:.8> wearing red cap

this works or not?

scruffynerf commented 1 year ago

2girls AND 2girls wearing blue cap AND 2girls wearing red cap

the above lack the lora trigger 'shehulk', so the cap pulls in the other lora, and they look more alike. adding shehulk fixes that... and you can see the cap triggers the other lora, so it's similar... going with a different word/color like 'purple hat' tended (but not always) to avoid the similar hat

examples: 01855-1446048692-2girls AND 2girls  shehulk with a blue cap  AND 2girls  wearing red cap

01837-2359549834-2girls AND 2girls  wearing blue cap AND 2girls  wearing red cap

01842-3751822815-2girls AND 2girls  shehulk with a purple hat  AND 2girls  wearing red cap

In summary, it's doable, it's not impossible. You have to be aware of the potential for bleed, use triggered loras (and not lora that just add influence), and try a bit. As mentioned, there is definitely a technical issue with the parsing, so it's not truly isolated. But it's very doable. I suggest closing this ticket.

Padusarbor commented 1 year ago

https://github.com/opparco/stable-diffusion-webui-composable-lora