mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 19:22:32 +00:00
support loading clip/t5 from the main model checkpoint
This commit is contained in:
@@ -31,7 +31,7 @@ class SD3Inferencer(torch.nn.Module):
|
||||
|
||||
self.alphas_cumprod = 1 / (self.model.model_sampling.sigmas ** 2 + 1)
|
||||
|
||||
self.cond_stage_model = SD3Cond()
|
||||
self.text_encoders = SD3Cond()
|
||||
self.cond_stage_key = 'txt'
|
||||
|
||||
self.parameterization = "eps"
|
||||
@@ -40,8 +40,12 @@ class SD3Inferencer(torch.nn.Module):
|
||||
self.latent_format = SD3LatentFormat()
|
||||
self.latent_channels = 16
|
||||
|
||||
def after_load_weights(self):
|
||||
self.cond_stage_model.load_weights()
|
||||
@property
|
||||
def cond_stage_model(self):
|
||||
return self.text_encoders
|
||||
|
||||
def before_load_weights(self, state_dict):
|
||||
self.cond_stage_model.before_load_weights(state_dict)
|
||||
|
||||
def ema_scope(self):
|
||||
return contextlib.nullcontext()
|
||||
|
Reference in New Issue
Block a user