aboutsummaryrefslogtreecommitdiffstats
path: root/modules/interrogate.py
diff options
context:
space:
mode:
authoryfszzx <yfszzx@gmail.com>2022-10-17 07:23:32 +0000
committeryfszzx <yfszzx@gmail.com>2022-10-17 07:23:32 +0000
commit2a3e7ed872dc9b8da27cccc7f78df092f4a2f578 (patch)
tree5a288fe646eb58d35f4079b734a6d3765a98fd3f /modules/interrogate.py
parent5b1394bead93e5485ced5de10f1c000eea4458c6 (diff)
parentcccc5a20fce4bde9a4299f8790366790735f1d05 (diff)
downloadstable-diffusion-webui-gfx803-2a3e7ed872dc9b8da27cccc7f78df092f4a2f578.tar.gz
stable-diffusion-webui-gfx803-2a3e7ed872dc9b8da27cccc7f78df092f4a2f578.tar.bz2
stable-diffusion-webui-gfx803-2a3e7ed872dc9b8da27cccc7f78df092f4a2f578.zip
Merge branch 'master' of https://github.com/yfszzx/stable-diffusion-webui-plus
Diffstat (limited to 'modules/interrogate.py')
-rw-r--r--modules/interrogate.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/interrogate.py b/modules/interrogate.py
index 9263d65a..64b91eb4 100644
--- a/modules/interrogate.py
+++ b/modules/interrogate.py
@@ -123,7 +123,7 @@ class InterrogateModels:
return caption[0]
- def interrogate(self, pil_image, include_ranks=False):
+ def interrogate(self, pil_image):
res = None
try:
@@ -156,10 +156,10 @@ class InterrogateModels:
for name, topn, items in self.categories:
matches = self.rank(image_features, items, top_count=topn)
for match, score in matches:
- if include_ranks:
- res += ", " + match
+ if shared.opts.interrogate_return_ranks:
+ res += f", ({match}:{score/100:.3f})"
else:
- res += f", ({match}:{score})"
+ res += ", " + match
except Exception:
print(f"Error interrogating", file=sys.stderr)