Files
stable-diffusion-webui-forge/backend/modules/clip.py
layerdiffusion bc9977a305 UNet from Scratch
Now backend rewrite is about 50% finished.
Estimated finish is in 72 hours.
After that, many newer features will land.
2024-08-01 21:19:41 -07:00

15 lines
478 B
Python

import torch
class JointTokenizer:
def __init__(self, huggingface_components):
self.clip_l = huggingface_components.get('tokenizer', None)
self.clip_g = huggingface_components.get('tokenizer_2', None)
class JointCLIP(torch.nn.Module):
def __init__(self, huggingface_components):
super().__init__()
self.clip_l = huggingface_components.get('text_encoder', None)
self.clip_g = huggingface_components.get('text_encoder_2', None)