Skip to content

Fix bug when using sd2.0 #23

Open
Open
@zhangsdly

Description

@zhangsdly

When using the sd2.0 model, SD2Tokenizer.clip_name = "h", #L266 will report an error when executing adv_encode.py. Fix bug using the follow code:

      if 'h' in tokenized:
          return advanced_encode_from_tokens(tokenized['h'],
                                          token_normalization, 
                                          weight_interpretation, 
                                          lambda x: (clip.encode_from_tokens({'h': x}), None),
                                          w_max=w_max)
      else:
          return advanced_encode_from_tokens(tokenized['l'],
                                          token_normalization, 
                                          weight_interpretation, 
                                          lambda x: (clip.encode_from_tokens({'l': x}), None),
                                          w_max=w_max)

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