app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
-
# import os
|
3 |
-
# import sys
|
4 |
-
# from pathlib import Path
|
5 |
import time
|
6 |
|
7 |
models =[
|
@@ -12,7 +9,7 @@ models =[
|
|
12 |
"alvdansen/pola-photo-flux",
|
13 |
"black-forest-labs/FLUX.1-dev",
|
14 |
"XLabs-AI/flux-RealismLora",
|
15 |
-
"
|
16 |
]
|
17 |
|
18 |
model_functions = {}
|
@@ -50,14 +47,12 @@ def all_task_end(cnt,t_stamp):
|
|
50 |
if et > to and t_stamp != 0:
|
51 |
d = gr.update(value=0)
|
52 |
tog = gr.update(value=1)
|
53 |
-
#print(f'to: {to} et: {et}')
|
54 |
else:
|
55 |
if cnt != 0:
|
56 |
d = gr.update(value=et)
|
57 |
else:
|
58 |
d = gr.update(value=0)
|
59 |
tog = gr.update(value=0)
|
60 |
-
#print (f'passing: to: {to} et: {et}')
|
61 |
pass
|
62 |
return d, tog
|
63 |
|
@@ -76,14 +71,10 @@ def clear_fn():
|
|
76 |
|
77 |
with gr.Blocks(title="SD Models") as my_interface:
|
78 |
with gr.Column(scale=12):
|
79 |
-
# with gr.Row():
|
80 |
-
# gr.Markdown("""- Primary prompt: 你想画的内容(英文单词,如 a cat, 加英文逗号效果更好;点 Improve 按钮进行完善)\n- Real prompt: 完善后的提示词,出现后再点右边的 Run 按钮开始运行""")
|
81 |
with gr.Row():
|
82 |
with gr.Row(scale=6):
|
83 |
primary_prompt=gr.Textbox(label="Prompt", value="")
|
84 |
-
# real_prompt=gr.Textbox(label="Real prompt")
|
85 |
with gr.Row(scale=6):
|
86 |
-
# improve_prompts_btn=gr.Button("Improve")
|
87 |
with gr.Row():
|
88 |
run=gr.Button("Run",variant="primary")
|
89 |
clear_btn=gr.Button("Clear")
|
@@ -121,11 +112,6 @@ with gr.Blocks(title="SD Models") as my_interface:
|
|
121 |
pass
|
122 |
pass
|
123 |
|
124 |
-
# improve_prompts_btn_clicked=improve_prompts_btn.click(
|
125 |
-
# get_prompts,
|
126 |
-
# inputs=[primary_prompt],
|
127 |
-
# outputs=[primary_prompt],
|
128 |
-
# cancels=list(runs_dict.values()))
|
129 |
clear_btn.click(
|
130 |
clear_fn,
|
131 |
None,
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
2 |
import time
|
3 |
|
4 |
models =[
|
|
|
9 |
"alvdansen/pola-photo-flux",
|
10 |
"black-forest-labs/FLUX.1-dev",
|
11 |
"XLabs-AI/flux-RealismLora",
|
12 |
+
"Freepik/flux.1-lite-8B-alpha",
|
13 |
]
|
14 |
|
15 |
model_functions = {}
|
|
|
47 |
if et > to and t_stamp != 0:
|
48 |
d = gr.update(value=0)
|
49 |
tog = gr.update(value=1)
|
|
|
50 |
else:
|
51 |
if cnt != 0:
|
52 |
d = gr.update(value=et)
|
53 |
else:
|
54 |
d = gr.update(value=0)
|
55 |
tog = gr.update(value=0)
|
|
|
56 |
pass
|
57 |
return d, tog
|
58 |
|
|
|
71 |
|
72 |
with gr.Blocks(title="SD Models") as my_interface:
|
73 |
with gr.Column(scale=12):
|
|
|
|
|
74 |
with gr.Row():
|
75 |
with gr.Row(scale=6):
|
76 |
primary_prompt=gr.Textbox(label="Prompt", value="")
|
|
|
77 |
with gr.Row(scale=6):
|
|
|
78 |
with gr.Row():
|
79 |
run=gr.Button("Run",variant="primary")
|
80 |
clear_btn=gr.Button("Clear")
|
|
|
112 |
pass
|
113 |
pass
|
114 |
|
|
|
|
|
|
|
|
|
|
|
115 |
clear_btn.click(
|
116 |
clear_fn,
|
117 |
None,
|