Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -3,65 +3,24 @@ import gradio as gr
|
|
3 |
import numpy as np
|
4 |
|
5 |
# DiffuseCraft
|
6 |
-
from dc import (
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
get_vaes,
|
13 |
-
enable_model_recom_prompt,
|
14 |
-
enable_diffusers_model_detail,
|
15 |
-
get_t2i_model_info,
|
16 |
-
get_all_lora_tupled_list,
|
17 |
-
update_loras,
|
18 |
-
apply_lora_prompt,
|
19 |
-
download_my_lora,
|
20 |
-
search_civitai_lora,
|
21 |
-
select_civitai_lora,
|
22 |
-
search_civitai_lora_json,
|
23 |
-
preset_quality,
|
24 |
-
preset_styles,
|
25 |
-
process_style_prompt,
|
26 |
-
)
|
27 |
# Translator
|
28 |
-
from llmdolphin import (
|
29 |
-
|
30 |
-
|
31 |
-
get_llm_formats,
|
32 |
-
get_dolphin_model_format,
|
33 |
-
get_dolphin_models,
|
34 |
-
get_dolphin_model_info,
|
35 |
-
select_dolphin_model,
|
36 |
-
select_dolphin_format,
|
37 |
-
get_dolphin_sysprompt,
|
38 |
-
)
|
39 |
# Tagger
|
40 |
-
from tagger.v2 import
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
COPY_ACTION_JS,
|
48 |
-
V2_ASPECT_RATIO_OPTIONS,
|
49 |
-
V2_RATING_OPTIONS,
|
50 |
-
V2_LENGTH_OPTIONS,
|
51 |
-
V2_IDENTITY_OPTIONS
|
52 |
-
)
|
53 |
-
from tagger.tagger import (
|
54 |
-
predict_tags_wd,
|
55 |
-
convert_danbooru_to_e621_prompt,
|
56 |
-
remove_specific_prompt,
|
57 |
-
insert_recom_prompt,
|
58 |
-
compose_prompt_to_copy,
|
59 |
-
translate_prompt,
|
60 |
-
select_random_character,
|
61 |
-
)
|
62 |
-
from tagger.fl2sd3longcap import (
|
63 |
-
predict_tags_fl2_sd3,
|
64 |
-
)
|
65 |
def description_ui():
|
66 |
gr.Markdown(
|
67 |
"""
|
@@ -219,8 +178,8 @@ with gr.Blocks(css=css, fill_width=True, elem_id="container") as demo:
|
|
219 |
|
220 |
vae_model = gr.Dropdown(label="VAE Model", choices=get_vaes(), value=get_vaes()[0])
|
221 |
recom_prompt = gr.Checkbox(label="Recommended prompt", value=True)
|
222 |
-
quality_selector = gr.
|
223 |
-
style_selector = gr.
|
224 |
|
225 |
with gr.Accordion("Translation Settings", open=False):
|
226 |
chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
|
|
|
3 |
import numpy as np
|
4 |
|
5 |
# DiffuseCraft
|
6 |
+
from dc import (infer, _infer, pass_result, get_diffusers_model_list, get_samplers,
|
7 |
+
get_vaes, enable_model_recom_prompt, enable_diffusers_model_detail,
|
8 |
+
get_t2i_model_info, get_all_lora_tupled_list, update_loras,
|
9 |
+
apply_lora_prompt, download_my_lora, search_civitai_lora,
|
10 |
+
select_civitai_lora, search_civitai_lora_json,
|
11 |
+
preset_quality, preset_styles, process_style_prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
# Translator
|
13 |
+
from llmdolphin import (dolphin_respond_auto, dolphin_parse_simple,
|
14 |
+
get_llm_formats, get_dolphin_model_format, get_dolphin_models,
|
15 |
+
get_dolphin_model_info, select_dolphin_model, select_dolphin_format, get_dolphin_sysprompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# Tagger
|
17 |
+
from tagger.v2 import v2_upsampling_prompt, V2_ALL_MODELS
|
18 |
+
from tagger.utils import (gradio_copy_text, gradio_copy_prompt, COPY_ACTION_JS,
|
19 |
+
V2_ASPECT_RATIO_OPTIONS, V2_RATING_OPTIONS, V2_LENGTH_OPTIONS, V2_IDENTITY_OPTIONS)
|
20 |
+
from tagger.tagger import (predict_tags_wd, convert_danbooru_to_e621_prompt,
|
21 |
+
remove_specific_prompt, insert_recom_prompt, compose_prompt_to_copy,
|
22 |
+
translate_prompt, select_random_character)
|
23 |
+
from tagger.fl2sd3longcap import predict_tags_fl2_sd3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
def description_ui():
|
25 |
gr.Markdown(
|
26 |
"""
|
|
|
178 |
|
179 |
vae_model = gr.Dropdown(label="VAE Model", choices=get_vaes(), value=get_vaes()[0])
|
180 |
recom_prompt = gr.Checkbox(label="Recommended prompt", value=True)
|
181 |
+
quality_selector = gr.Radio(label="Quality Tag Presets", interactive=True, choices=list(preset_quality.keys()), value="None")
|
182 |
+
style_selector = gr.Radio(label="Style Presets", interactive=True, choices=list(preset_styles.keys()), value="None")
|
183 |
|
184 |
with gr.Accordion("Translation Settings", open=False):
|
185 |
chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
|