This commit is contained in:
space-nuko
2023-05-16 08:58:13 -05:00
parent c548be7071
commit 1709b8aa69
+3 -2
View File
@@ -50,8 +50,9 @@ class OpenAICLIPLoader:
# For my own notes (because I was confused about this earlier):
# DD requires the use of torch.autograd.grad so it can steer the output
# image towards CLIP embeddings by calculating loss.
# But it's more efficient to load tensors without support for calculating loss
# because most people aren't training models, they're just running inference.
# But it's more efficient to run operations on tensors loaded without
# support for calculating loss, and most people aren't training models,
# they're just running inference.
# And "torch.autograd.grad" is a function mostly used for training models.
# But because (this implementation of) guided diffusion requires autograd,
# we have to load the tensors with inference mode off ourselves (ComfyUI