mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
fix the problem with infinite prompts where empty cond would be calculated incorrectly
This commit is contained in:
@@ -177,12 +177,13 @@ class SD3Cond(torch.nn.Module):
|
||||
self.weights_loaded = False
|
||||
|
||||
def forward(self, prompts: list[str]):
|
||||
lg_out, vector_out = self.model_lg(prompts)
|
||||
with devices.without_autocast():
|
||||
lg_out, vector_out = self.model_lg(prompts)
|
||||
|
||||
token_count = lg_out.shape[1]
|
||||
token_count = lg_out.shape[1]
|
||||
|
||||
t5_out = self.model_t5(prompts, token_count=token_count)
|
||||
lgt_out = torch.cat([lg_out, t5_out], dim=-2)
|
||||
t5_out = self.model_t5(prompts, token_count=token_count)
|
||||
lgt_out = torch.cat([lg_out, t5_out], dim=-2)
|
||||
|
||||
return {
|
||||
'crossattn': lgt_out,
|
||||
|
@@ -47,8 +47,7 @@ class SD3Inferencer(torch.nn.Module):
|
||||
return contextlib.nullcontext()
|
||||
|
||||
def get_learned_conditioning(self, batch: list[str]):
|
||||
with devices.without_autocast():
|
||||
return self.cond_stage_model(batch)
|
||||
return self.cond_stage_model(batch)
|
||||
|
||||
def apply_model(self, x, t, cond):
|
||||
return self.model(x, t, c_crossattn=cond['crossattn'], y=cond['vector'])
|
||||
|
Reference in New Issue
Block a user