Update app.py
Browse files
app.py
CHANGED
@@ -39,6 +39,10 @@ inference_timeout = 400
|
|
39 |
default_models = models[:num_models]
|
40 |
MAX_SEED = 2**32-1
|
41 |
|
|
|
|
|
|
|
|
|
42 |
def extend_choices(choices):
|
43 |
return choices[:num_models] + (num_models - len(choices[:num_models])) * ['NA']
|
44 |
|
@@ -230,6 +234,7 @@ with gr.Blocks(head=CSS + JS) as demo:
|
|
230 |
with gr.Column(scale=2):
|
231 |
with gr.Group():
|
232 |
txt_input = gr.Textbox(label='Your prompt:', value=preSetPrompt, lines=3, autofocus=1)
|
|
|
233 |
neg_input = gr.Textbox(label='Negative prompt:', value=negPreSetPrompt, lines=1)
|
234 |
with gr.Accordion("Advanced", open=False, visible=True):
|
235 |
with gr.Row():
|
@@ -242,7 +247,7 @@ with gr.Blocks(head=CSS + JS) as demo:
|
|
242 |
seed_rand = gr.Button("Randomize Seed 🎲", size="sm", variant="secondary")
|
243 |
seed_rand.click(randomize_seed, None, [seed], queue=False)
|
244 |
with gr.Row():
|
245 |
-
gen_button = gr.Button(f'Generate up to {int(num_models)} images', variant='primary', scale=3,
|
246 |
random_button = gr.Button(f'Randomize Models', variant='secondary', scale=1)
|
247 |
|
248 |
with gr.Column(scale=1):
|
@@ -251,6 +256,14 @@ with gr.Blocks(head=CSS + JS) as demo:
|
|
251 |
output = [gr.Image(label=m, show_download_button=True, interactive=False, width=112, height=112, show_share_button=False, format="png", visible=True) for m in default_models]
|
252 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
with gr.Column(scale=4):
|
255 |
with gr.Accordion('Model selection'):
|
256 |
model_choice = gr.CheckboxGroup(models, label = f'Choose up to {int(num_models)} different models from the {len(models)} available!', value=default_models, interactive=True)
|
|
|
39 |
default_models = models[:num_models]
|
40 |
MAX_SEED = 2**32-1
|
41 |
|
42 |
+
def imgageHasUpdated(theImage):
|
43 |
+
print(theImage)
|
44 |
+
# outputs=lnk_output
|
45 |
+
|
46 |
def extend_choices(choices):
|
47 |
return choices[:num_models] + (num_models - len(choices[:num_models])) * ['NA']
|
48 |
|
|
|
234 |
with gr.Column(scale=2):
|
235 |
with gr.Group():
|
236 |
txt_input = gr.Textbox(label='Your prompt:', value=preSetPrompt, lines=3, autofocus=1)
|
237 |
+
lnk_output = gr.Textbox(label='The Link:',visible=True,interactive=False,elem_id="LnkBox")
|
238 |
neg_input = gr.Textbox(label='Negative prompt:', value=negPreSetPrompt, lines=1)
|
239 |
with gr.Accordion("Advanced", open=False, visible=True):
|
240 |
with gr.Row():
|
|
|
247 |
seed_rand = gr.Button("Randomize Seed 🎲", size="sm", variant="secondary")
|
248 |
seed_rand.click(randomize_seed, None, [seed], queue=False)
|
249 |
with gr.Row():
|
250 |
+
gen_button = gr.Button(f'Generate up to {int(num_models)} images', variant='primary', scale=3, elem_classes=["butt"])
|
251 |
random_button = gr.Button(f'Randomize Models', variant='secondary', scale=1)
|
252 |
|
253 |
with gr.Column(scale=1):
|
|
|
256 |
output = [gr.Image(label=m, show_download_button=True, interactive=False, width=112, height=112, show_share_button=False, format="png", visible=True) for m in default_models]
|
257 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
258 |
|
259 |
+
with gr.Column(scale=2):
|
260 |
+
gallery = gr.Gallery(label="Output", show_download_button=True,interactive=False, show_share_button=False, container=True, format="png", preview=True, object_fit="cover", columns=2, rows=2)
|
261 |
+
|
262 |
+
for m, o in zip(current_models, output):
|
263 |
+
gen_event = gr.on(triggers=[gen_button.click, txt_input.submit], fn=gen_fn,inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed], outputs=[o], concurrency_limit=None, queue=False)
|
264 |
+
# o.change(add_gallery, [o, m, gallery], [gallery])
|
265 |
+
# o.change(imgageHasUpdated,[o])
|
266 |
+
|
267 |
with gr.Column(scale=4):
|
268 |
with gr.Accordion('Model selection'):
|
269 |
model_choice = gr.CheckboxGroup(models, label = f'Choose up to {int(num_models)} different models from the {len(models)} available!', value=default_models, interactive=True)
|