Spaces:
Running
on
Zero
Running
on
Zero
Delete utils.py
Browse files
utils.py
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from dartrs.v2 import AspectRatioTag, LengthTag, RatingTag, IdentityTag
|
3 |
-
|
4 |
-
|
5 |
-
V2_ASPECT_RATIO_OPTIONS: list[AspectRatioTag] = [
|
6 |
-
"ultra_wide",
|
7 |
-
"wide",
|
8 |
-
"square",
|
9 |
-
"tall",
|
10 |
-
"ultra_tall",
|
11 |
-
]
|
12 |
-
V2_RATING_OPTIONS: list[RatingTag] = [
|
13 |
-
"sfw",
|
14 |
-
"general",
|
15 |
-
"sensitive",
|
16 |
-
"nsfw",
|
17 |
-
"questionable",
|
18 |
-
"explicit",
|
19 |
-
]
|
20 |
-
V2_LENGTH_OPTIONS: list[LengthTag] = [
|
21 |
-
"very_short",
|
22 |
-
"short",
|
23 |
-
"medium",
|
24 |
-
"long",
|
25 |
-
"very_long",
|
26 |
-
]
|
27 |
-
V2_IDENTITY_OPTIONS: list[IdentityTag] = [
|
28 |
-
"none",
|
29 |
-
"lax",
|
30 |
-
"strict",
|
31 |
-
]
|
32 |
-
|
33 |
-
|
34 |
-
# ref: https://qiita.com/tregu148/items/fccccbbc47d966dd2fc2
|
35 |
-
def gradio_copy_text(_text: None):
|
36 |
-
gr.Info("Copied!")
|
37 |
-
|
38 |
-
|
39 |
-
COPY_ACTION_JS = """\
|
40 |
-
(inputs, _outputs) => {
|
41 |
-
// inputs is the string value of the input_text
|
42 |
-
if (inputs.trim() !== "") {
|
43 |
-
navigator.clipboard.writeText(inputs);
|
44 |
-
}
|
45 |
-
}"""
|
46 |
-
|
47 |
-
|
48 |
-
def gradio_copy_prompt(prompt: str):
|
49 |
-
gr.Info("Copied!")
|
50 |
-
return prompt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|