Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,37 +25,17 @@ css = """
|
|
25 |
"""
|
26 |
|
27 |
with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", fill_width=True, css=css) as demo:
|
28 |
-
with gr.Tab("
|
29 |
with gr.Row():
|
30 |
with gr.Column(scale=10):
|
31 |
with gr.Group():
|
32 |
-
with gr.Accordion("Prompt from Image File", open=False):
|
33 |
-
tagger_image = gr.Image(label="Input image", type="pil", format="png", sources=["upload", "clipboard"], height=256)
|
34 |
-
with gr.Accordion(label="Advanced options", open=False):
|
35 |
-
with gr.Row(equal_height=True):
|
36 |
-
tagger_general_threshold = gr.Slider(label="Threshold", minimum=0.0, maximum=1.0, value=0.3, step=0.01, interactive=True)
|
37 |
-
tagger_character_threshold = gr.Slider(label="Character threshold", minimum=0.0, maximum=1.0, value=0.8, step=0.01, interactive=True)
|
38 |
-
tagger_tag_type = gr.Radio(label="Convert tags to", info="danbooru for common, e621 for Pony.", choices=["danbooru", "e621"], value="danbooru")
|
39 |
-
with gr.Row(equal_height=True):
|
40 |
-
tagger_recom_prompt = gr.Radio(label="Insert reccomended prompt", choices=["None", "Animagine", "Pony"], value="None", interactive=True)
|
41 |
-
tagger_keep_tags = gr.Radio(label="Remove tags leaving only the following", choices=["body", "dress", "all"], value="all")
|
42 |
-
tagger_algorithms = gr.CheckboxGroup(["Use WD Tagger", "Use Florence-2-SD3-Long-Captioner"], label="Algorithms", value=["Use WD Tagger"])
|
43 |
-
tagger_generate_from_image = gr.Button(value="Generate Tags from Image", variant="secondary")
|
44 |
with gr.Accordion("Prompt Transformer", open=False):
|
45 |
-
with gr.Row(equal_height=True):
|
46 |
-
v2_character = gr.Textbox(label="Character", placeholder="hatsune miku", scale=2)
|
47 |
-
v2_series = gr.Textbox(label="Series", placeholder="vocaloid", scale=2)
|
48 |
with gr.Row(equal_height=True):
|
49 |
v2_rating = gr.Radio(label="Rating", choices=list(V2_RATING_OPTIONS), value="sfw")
|
50 |
v2_aspect_ratio = gr.Radio(label="Aspect ratio", info="The aspect ratio of the image.", choices=list(V2_ASPECT_RATIO_OPTIONS), value="square", visible=False)
|
51 |
v2_length = gr.Radio(label="Length", info="The total length of the tags.", choices=list(V2_LENGTH_OPTIONS), value="long")
|
52 |
-
|
53 |
-
|
54 |
-
v2_ban_tags = gr.Textbox(label="Ban tags", info="Tags to ban from the output.", placeholder="alternate costumen, ...", value="censored")
|
55 |
-
v2_tag_type = gr.Radio(label="Tag Type", info="danbooru for common, e621 for Pony.", choices=["danbooru", "e621"], value="danbooru", visible=False)
|
56 |
-
v2_model = gr.Dropdown(label="Model", choices=list(V2_ALL_MODELS.keys()), value=list(V2_ALL_MODELS.keys())[0])
|
57 |
-
v2_copy = gr.Button(value="Copy to clipboard", variant="secondary", size="sm", interactive=False)
|
58 |
-
random_prompt = gr.Button(value="Extend 🎲", variant="secondary")
|
59 |
prompt = gr.Text(label="Prompt", lines=2, max_lines=8, placeholder="1girl, solo, ...", show_copy_button=True)
|
60 |
with gr.Accordion("Advanced options", open=False):
|
61 |
neg_prompt = gr.Text(label="Negative Prompt", lines=1, max_lines=8, placeholder="")
|
@@ -75,9 +55,7 @@ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", fill_width=True, css=css) as demo:
|
|
75 |
negative_suffix = gr.CheckboxGroup(label="Use Negative Suffix", choices=get_negative_suffix(), value=["Common"])
|
76 |
with gr.Row(equal_height=True):
|
77 |
image_num = gr.Slider(label="Number of images", minimum=1, maximum=max_images, value=1, step=1, interactive=True, scale=2)
|
78 |
-
|
79 |
-
clear_prompt = gr.Button(value="Clear 🗑️", variant="secondary", size="sm", scale=1)
|
80 |
-
|
81 |
with gr.Row(equal_height=True):
|
82 |
run_button = gr.Button("Generate Image", variant="primary", scale=6)
|
83 |
random_button = gr.Button("Random Model 🎲", variant="secondary", scale=3)
|
|
|
25 |
"""
|
26 |
|
27 |
with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", fill_width=True, css=css) as demo:
|
28 |
+
with gr.Tab(""):
|
29 |
with gr.Row():
|
30 |
with gr.Column(scale=10):
|
31 |
with gr.Group():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
with gr.Accordion("Prompt Transformer", open=False):
|
|
|
|
|
|
|
33 |
with gr.Row(equal_height=True):
|
34 |
v2_rating = gr.Radio(label="Rating", choices=list(V2_RATING_OPTIONS), value="sfw")
|
35 |
v2_aspect_ratio = gr.Radio(label="Aspect ratio", info="The aspect ratio of the image.", choices=list(V2_ASPECT_RATIO_OPTIONS), value="square", visible=False)
|
36 |
v2_length = gr.Radio(label="Length", info="The total length of the tags.", choices=list(V2_LENGTH_OPTIONS), value="long")
|
37 |
+
|
38 |
+
|
|
|
|
|
|
|
|
|
|
|
39 |
prompt = gr.Text(label="Prompt", lines=2, max_lines=8, placeholder="1girl, solo, ...", show_copy_button=True)
|
40 |
with gr.Accordion("Advanced options", open=False):
|
41 |
neg_prompt = gr.Text(label="Negative Prompt", lines=1, max_lines=8, placeholder="")
|
|
|
55 |
negative_suffix = gr.CheckboxGroup(label="Use Negative Suffix", choices=get_negative_suffix(), value=["Common"])
|
56 |
with gr.Row(equal_height=True):
|
57 |
image_num = gr.Slider(label="Number of images", minimum=1, maximum=max_images, value=1, step=1, interactive=True, scale=2)
|
58 |
+
|
|
|
|
|
59 |
with gr.Row(equal_height=True):
|
60 |
run_button = gr.Button("Generate Image", variant="primary", scale=6)
|
61 |
random_button = gr.Button("Random Model 🎲", variant="secondary", scale=3)
|