Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about style mixing #6

Open
whit3mperial opened this issue Aug 15, 2024 · 1 comment
Open

Question about style mixing #6

whit3mperial opened this issue Aug 15, 2024 · 1 comment

Comments

@whit3mperial
Copy link

whit3mperial commented Aug 15, 2024

Hi, thanks to your great work.
But I wonder how can perform style mixing using this code. I didn't see any part of code related to this, should I modify the code myself to achieve this?

@nmhkahn
Copy link
Collaborator

nmhkahn commented Aug 24, 2024

Hi, sorry for the late reply.
As you mentioned, the open-source code does not include style mixing.
You can implement style mixing by providing different prompt tokens for each layer
For example,

prompt = "A painting of a bridge in the style of {}"
prompt_style = [prompt.format(f"<17>-T{i}, <10>-T{i}, <22>-T{i}") for i in range(6)]
...
output = pipeline(
    prompt=prompt_style,
    num_inference_steps=25,
    cross_attention_kwargs=cross_attention_kwargs,
    generator=torch.Generator(device=accelerator.device).manual_seed(seed)
).images[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants