Update ldm dir with latest upstream stable diffusion changes.

This commit is contained in:
comfyanonymous
2023-02-09 13:47:36 -05:00
parent 642516a3a6
commit 1f6a467e92
5 changed files with 21 additions and 10 deletions

View File

@@ -1331,7 +1331,13 @@ class DiffusionWrapper(torch.nn.Module):
cc = torch.cat(c_crossattn, 1)
else:
cc = c_crossattn
out = self.diffusion_model(x, t, context=cc)
if hasattr(self, "scripted_diffusion_model"):
# TorchScript changes names of the arguments
# with argument cc defined as context=cc scripted model will produce
# an error: RuntimeError: forward() is missing value for argument 'argument_3'.
out = self.scripted_diffusion_model(x, t, cc)
else:
out = self.diffusion_model(x, t, context=cc)
elif self.conditioning_key == 'hybrid':
xc = torch.cat([x] + c_concat, dim=1)
cc = torch.cat(c_crossattn, 1)