aboutsummaryrefslogtreecommitdiffstats
path: root/modules/interrogate.py
diff options
context:
space:
mode:
author不会画画的中医不是好程序员 <yfszzx@gmail.com>2022-10-10 12:21:25 +0000
committerGitHub <noreply@github.com>2022-10-10 12:21:25 +0000
commit1e18a5ffcc439b72adaaf425c0b79f3acb34322e (patch)
tree01f9c73c02076694a9bc3c965875646473771db8 /modules/interrogate.py
parent23f2989799ee3911d2959cfceb74b921f20c9a51 (diff)
parenta3578233395e585e68c2118d3630cb2a961d4a36 (diff)
downloadstable-diffusion-webui-gfx803-1e18a5ffcc439b72adaaf425c0b79f3acb34322e.tar.gz
stable-diffusion-webui-gfx803-1e18a5ffcc439b72adaaf425c0b79f3acb34322e.tar.bz2
stable-diffusion-webui-gfx803-1e18a5ffcc439b72adaaf425c0b79f3acb34322e.zip
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'modules/interrogate.py')
-rw-r--r--modules/interrogate.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/interrogate.py b/modules/interrogate.py
index eed87144..635e266e 100644
--- a/modules/interrogate.py
+++ b/modules/interrogate.py
@@ -140,11 +140,11 @@ class InterrogateModels:
res = caption
- cilp_image = self.clip_preprocess(pil_image).unsqueeze(0).type(self.dtype).to(shared.device)
+ clip_image = self.clip_preprocess(pil_image).unsqueeze(0).type(self.dtype).to(shared.device)
precision_scope = torch.autocast if shared.cmd_opts.precision == "autocast" else contextlib.nullcontext
with torch.no_grad(), precision_scope("cuda"):
- image_features = self.clip_model.encode_image(cilp_image).type(self.dtype)
+ image_features = self.clip_model.encode_image(clip_image).type(self.dtype)
image_features /= image_features.norm(dim=-1, keepdim=True)