Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,13 @@ Mistralclient = Mistral(api_key=api_key)
|
|
27 |
def clear():
|
28 |
return None
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
# Function to query the API and return the generated image
|
31 |
def query(prompt, is_negative=False, steps=35, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=896, height=1152):
|
32 |
if prompt == "" or prompt is None:
|
@@ -186,8 +193,7 @@ with gr.Blocks(theme=theme, css=css) as app:
|
|
186 |
with gr.Group():
|
187 |
# Image output area to display the generated image
|
188 |
with gr.Row():
|
189 |
-
|
190 |
-
image_output = gr.Image(type="pil", label="Image Output", format="png", show_share_button=False, elem_id="gallery")
|
191 |
|
192 |
gr.Examples(
|
193 |
examples = examples,
|
|
|
27 |
def clear():
|
28 |
return None
|
29 |
|
30 |
+
def pbar(x, progress=gr.Progress()):
|
31 |
+
progress(0, desc="Starting...")
|
32 |
+
time.sleep(1)
|
33 |
+
for i in progress.tqdm(range(100)):
|
34 |
+
time.sleep(0.1)
|
35 |
+
return x
|
36 |
+
|
37 |
# Function to query the API and return the generated image
|
38 |
def query(prompt, is_negative=False, steps=35, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=896, height=1152):
|
39 |
if prompt == "" or prompt is None:
|
|
|
193 |
with gr.Group():
|
194 |
# Image output area to display the generated image
|
195 |
with gr.Row():
|
196 |
+
image_output = gr.Image(type="pil", label="Image Output", format="png", show_share_button=False, pbar, elem_id="gallery")
|
|
|
197 |
|
198 |
gr.Examples(
|
199 |
examples = examples,
|