Rename clip_t5base to t5base for stable audio text encoder.

This commit is contained in:
comfyanonymous 2024-07-08 08:48:38 -04:00
parent 628f0b8ebc
commit bb663bcd6c
2 changed files with 10 additions and 4 deletions

View File

@ -19,4 +19,4 @@ class SAT5Tokenizer(sd1_clip.SD1Tokenizer):
class SAT5Model(sd1_clip.SD1ClipModel):
def __init__(self, device="cpu", dtype=None, **kwargs):
super().__init__(device=device, dtype=dtype, clip_name="t5base", clip_model=T5BaseModel, **kwargs)
super().__init__(device=device, dtype=dtype, name="t5base", clip_model=T5BaseModel, **kwargs)

View File

@ -514,10 +514,16 @@ class SD1Tokenizer:
class SD1ClipModel(torch.nn.Module):
def __init__(self, device="cpu", dtype=None, clip_name="l", clip_model=SDClipModel, **kwargs):
def __init__(self, device="cpu", dtype=None, clip_name="l", clip_model=SDClipModel, name=None, **kwargs):
super().__init__()
if name is not None:
self.clip_name = name
self.clip = "{}".format(self.clip_name)
else:
self.clip_name = clip_name
self.clip = "clip_{}".format(self.clip_name)
setattr(self, self.clip, clip_model(device=device, dtype=dtype, **kwargs))
self.dtypes = set()