Update app.py
Browse files
app.py
CHANGED
|
@@ -56,13 +56,47 @@ def inference(input_images, mode, best_max_flavors):
|
|
| 56 |
prompt_result = ci.interrogate_classic(image)
|
| 57 |
else:
|
| 58 |
prompt_result = ci.interrogate_fast(image)
|
| 59 |
-
prompt_results.append((prompt_result)) # Use dictionary to set image labels
|
| 60 |
return prompt_results
|
| 61 |
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
css = '''
|
| 68 |
#col-container {width: width: 80%;; margin-left: auto; margin-right: auto;}
|
|
|
|
| 56 |
prompt_result = ci.interrogate_classic(image)
|
| 57 |
else:
|
| 58 |
prompt_result = ci.interrogate_fast(image)
|
| 59 |
+
prompt_results.append((image, prompt_result)) # Use dictionary to set image labels
|
| 60 |
return prompt_results
|
| 61 |
|
| 62 |
|
| 63 |
+
title = """
|
| 64 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;">
|
| 65 |
+
<div
|
| 66 |
+
style="
|
| 67 |
+
display: inline-flex;
|
| 68 |
+
align-items: center;
|
| 69 |
+
gap: 0.8rem;
|
| 70 |
+
font-size: 1.75rem;
|
| 71 |
+
margin-bottom: 10px;
|
| 72 |
+
"
|
| 73 |
+
>
|
| 74 |
+
<h1 style="font-weight: 600; margin-bottom: 7px;">
|
| 75 |
+
CLIP Interrogator 2.1
|
| 76 |
+
</h1>
|
| 77 |
+
</div>
|
| 78 |
+
<p style="margin-bottom: 10px;font-size: 94%;font-weight: 100;line-height: 1.5em;">
|
| 79 |
+
Want to figure out what a good prompt might be to create new images like an existing one?
|
| 80 |
+
<br />The CLIP Interrogator is here to get you answers!
|
| 81 |
+
<br />This version is specialized for producing nice prompts for use with Stable Diffusion 2.0 using the ViT-H-14 OpenCLIP model!
|
| 82 |
+
</p>
|
| 83 |
+
</div>
|
| 84 |
+
"""
|
| 85 |
+
|
| 86 |
+
article = """
|
| 87 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;font-size: 94%;">
|
| 88 |
+
|
| 89 |
+
<p>
|
| 90 |
+
Server busy? You can also run on <a href="https://colab.research.google.com/github/pharmapsychotic/clip-interrogator/blob/open-clip/clip_interrogator.ipynb">Google Colab</a>
|
| 91 |
+
</p>
|
| 92 |
+
<p>
|
| 93 |
+
Has this been helpful to you? Follow Pharma on twitter
|
| 94 |
+
<a href="https://twitter.com/pharmapsychotic">@pharmapsychotic</a>
|
| 95 |
+
and check out more tools at his
|
| 96 |
+
<a href="https://pharmapsychotic.com/tools.html">Ai generative art tools list</a>
|
| 97 |
+
</p>
|
| 98 |
+
</div>
|
| 99 |
+
"""
|
| 100 |
|
| 101 |
css = '''
|
| 102 |
#col-container {width: width: 80%;; margin-left: auto; margin-right: auto;}
|