Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def clear():
|
|
37 |
return None
|
38 |
|
39 |
def change_tab():
|
40 |
-
return gr.Tabs.update(selected=
|
41 |
|
42 |
def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, strength=100, width=896, height=1152):
|
43 |
if prompt == "" or prompt == None:
|
@@ -160,18 +160,20 @@ def feifeichat(image):
|
|
160 |
|
161 |
|
162 |
css = """
|
|
|
163 |
#app-container {
|
164 |
max-width: 930px;
|
165 |
margin-left: auto;
|
166 |
margin-right: auto;
|
167 |
}
|
168 |
-
|
169 |
|
170 |
"""
|
171 |
with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
172 |
gr.HTML("<center><h6>🎨 FLUX.1-Dev with LoRA 🇬🇧</h6></center>")
|
|
|
173 |
with gr.Tabs() as tabs:
|
174 |
-
with gr.TabItem(label="Image To Prompt", visible=True, id=
|
175 |
with gr.Row():
|
176 |
with gr.Column():
|
177 |
input_img = gr.Image(label="Input Picture 🖼️",height=320,type="filepath")
|
@@ -183,7 +185,7 @@ with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
|
183 |
|
184 |
submit_btn.click(feifeichat, [input_img], [output_text])
|
185 |
|
186 |
-
with gr.TabItem(label="Text to Image", visible=True, id=
|
187 |
with gr.Column(elem_id="app-container"):
|
188 |
with gr.Row():
|
189 |
with gr.Column(elem_id="prompt-container"):
|
|
|
37 |
return None
|
38 |
|
39 |
def change_tab():
|
40 |
+
return gr.Tabs.update(selected=1)
|
41 |
|
42 |
def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, strength=100, width=896, height=1152):
|
43 |
if prompt == "" or prompt == None:
|
|
|
160 |
|
161 |
|
162 |
css = """
|
163 |
+
footer{display:none !important}
|
164 |
#app-container {
|
165 |
max-width: 930px;
|
166 |
margin-left: auto;
|
167 |
margin-right: auto;
|
168 |
}
|
169 |
+
|
170 |
|
171 |
"""
|
172 |
with gr.Blocks(theme=theme, css=css, elem_id="app-container") as app:
|
173 |
gr.HTML("<center><h6>🎨 FLUX.1-Dev with LoRA 🇬🇧</h6></center>")
|
174 |
+
|
175 |
with gr.Tabs() as tabs:
|
176 |
+
with gr.TabItem(label="Image To Prompt", visible=True, id=1):
|
177 |
with gr.Row():
|
178 |
with gr.Column():
|
179 |
input_img = gr.Image(label="Input Picture 🖼️",height=320,type="filepath")
|
|
|
185 |
|
186 |
submit_btn.click(feifeichat, [input_img], [output_text])
|
187 |
|
188 |
+
with gr.TabItem(label="Text to Image", visible=True, id=0):
|
189 |
with gr.Column(elem_id="app-container"):
|
190 |
with gr.Row():
|
191 |
with gr.Column(elem_id="prompt-container"):
|