Spaces:
Running
on
Zero
Running
on
Zero
fancyfeast
commited on
Commit
·
1435089
1
Parent(s):
07f9554
Fix typos.
Browse files
app.py
CHANGED
|
@@ -58,15 +58,15 @@ DESCRIPTION = """
|
|
| 58 |
<td>Same idea as above but tuned to MidJourney’s prompt style.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time.</em></td></tr>
|
| 59 |
<tr><td><strong>Danbooru tag list</strong></td>
|
| 60 |
<td>Comma-separated tags strictly following Danbooru conventions
|
| 61 |
-
(artist:, copyright:, etc.). Lower-case underscores only.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time
|
| 62 |
<tr><td><strong>e621 tag list</strong></td>
|
| 63 |
<td>Alphabetical, namespaced tags in e621 style – includes species/meta
|
| 64 |
-
tags when relevant.<br><em>⚠︎ Experimental – can glitch ≈ 3
|
| 65 |
<tr><td><strong>rul34 tag list</strong></td>
|
| 66 |
<td>Rule34 style alphabetical tag dump; artist/copyright/character
|
| 67 |
-
prefixes first.<br><em>⚠︎ Experimental – can glitch ≈ 3
|
| 68 |
<tr><td><strong>Booru-like tag list</strong></td>
|
| 69 |
-
<td>Looser tag list when you want labels but not a specific Booru format.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time
|
| 70 |
<tr><td><strong>Art Critic</strong></td>
|
| 71 |
<td>Paragraph of art-historical commentary: composition, symbolism, style,
|
| 72 |
lighting, movement, etc.</td></tr>
|
|
@@ -214,6 +214,10 @@ def toggle_name_box(selected_options: list[str]):
|
|
| 214 |
def chat_joycaption(input_image: Image.Image, prompt: str, temperature: float, top_p: float, max_new_tokens: int, log_prompt: bool) -> Generator[str, None, None]:
|
| 215 |
torch.cuda.empty_cache()
|
| 216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
if log_prompt:
|
| 218 |
print(f"PromptLog: {repr(prompt)}")
|
| 219 |
|
|
|
|
| 58 |
<td>Same idea as above but tuned to MidJourney’s prompt style.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time.</em></td></tr>
|
| 59 |
<tr><td><strong>Danbooru tag list</strong></td>
|
| 60 |
<td>Comma-separated tags strictly following Danbooru conventions
|
| 61 |
+
(artist:, copyright:, etc.). Lower-case underscores only.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time.</em></td></tr>
|
| 62 |
<tr><td><strong>e621 tag list</strong></td>
|
| 63 |
<td>Alphabetical, namespaced tags in e621 style – includes species/meta
|
| 64 |
+
tags when relevant.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time.</em></td></tr>
|
| 65 |
<tr><td><strong>rul34 tag list</strong></td>
|
| 66 |
<td>Rule34 style alphabetical tag dump; artist/copyright/character
|
| 67 |
+
prefixes first.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time.</em></td></tr>
|
| 68 |
<tr><td><strong>Booru-like tag list</strong></td>
|
| 69 |
+
<td>Looser tag list when you want labels but not a specific Booru format.<br><em>⚠︎ Experimental – can glitch ≈ 3% of the time.</em></td></tr>
|
| 70 |
<tr><td><strong>Art Critic</strong></td>
|
| 71 |
<td>Paragraph of art-historical commentary: composition, symbolism, style,
|
| 72 |
lighting, movement, etc.</td></tr>
|
|
|
|
| 214 |
def chat_joycaption(input_image: Image.Image, prompt: str, temperature: float, top_p: float, max_new_tokens: int, log_prompt: bool) -> Generator[str, None, None]:
|
| 215 |
torch.cuda.empty_cache()
|
| 216 |
|
| 217 |
+
if input_image is None:
|
| 218 |
+
yield "No image provided. Please upload an image."
|
| 219 |
+
return
|
| 220 |
+
|
| 221 |
if log_prompt:
|
| 222 |
print(f"PromptLog: {repr(prompt)}")
|
| 223 |
|