Skip to content

add a method 'get_weighted_text_embeddings_sd3_3p' to embedding_funcs.py please #33

@adrian-bacon

Description

@adrian-bacon

Looking at 'get_weighted_text_embeddings_sd3()' I noticed that it only takes a 'prompt' and 'neg_prompt', but in the function it passes the same prompt to all three tokenizers. I'm building a stable diffusion research tool right now that actually uses all three prompts and would like to be able to integrate sd_embed with it.

Would it be possible to change the method 'get_weighted_text_embeddings_sd3' to 'get_weighted_text_embeddings_sd3_3p' and add the two other positive and negative prompts to passed arguments, then pass each to each tokenizer, then add a method called 'get_weighted_text_embeddings_sd3' that just calls 'get_weighted_text_embeddings_sd3_3p' but passes prompt and neg_prompt to all three positive and all three negative prompts?

This way if people use 'get_weighted_text_embeddings_sd3', the behavior stays the same as it is now, but if anybody wants to separately control what goes into the three prompts, they have to option to do so by using 'get_weighted_text_embeddings_sd3_3p'. It would possibly look something like:

def get_weighted_text_embeddings_sd3(prompt, neg_prompt, pad_last_block, use_t5_encoder):
return get_weighted_text_embeddings_sd3_3p(prompt, prompt, prompt, neg_prompt, neg_prompt, neg_prompt, pad_last_block, use_t5_encoder)

def get_weighted_text_embeddings_sd3_3p(prompt, prompt_2, prompt_3, neg_prompt, neg_prompt_2, neg_prompt_3, pad_last_block, use_t5_encoder):
then in the section in lines 1221-1246 assign each of the prompts and neg prompts to each respective tokenizer instead of what it's doing now.

Does that make sense? It's similar to the two methods you provide for sdxl.

Many thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions