Update app.py
Browse files
app.py
CHANGED
@@ -37,6 +37,9 @@ def gen_fn(model_str, prompt, negative_prompt=None, image_style="Default"):
|
|
37 |
with gr.Blocks() as demo:
|
38 |
with gr.Tab('The Dream'):
|
39 |
txt_input = gr.Textbox(label='Your prompt:', lines=4)
|
|
|
|
|
|
|
40 |
gen_button = gr.Button('Generate up to 6 images in up to 1 minutes total')
|
41 |
stop_button = gr.Button('Stop', variant='secondary', interactive=False)
|
42 |
|
@@ -59,14 +62,9 @@ with gr.Blocks() as demo:
|
|
59 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
60 |
|
61 |
for m, o in zip(current_models, output):
|
62 |
-
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
63 |
stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
64 |
|
65 |
-
with gr.Accordion('Advanced Settings', open=False):
|
66 |
-
neg_prompt = gr.Textbox(label='Negative prompt (Optional):', placeholder='Enter undesirable attributes here', lines=2)
|
67 |
-
image_style = gr.Dropdown(label='Select Style', choices=["Default", "Cinematic", "Digital Art", "Portrait"], value="Default")
|
68 |
-
gen_button.change(gen_fn, [txt_input, neg_prompt, image_style], output)
|
69 |
-
|
70 |
with gr.Accordion('Model selection'):
|
71 |
model_choice = gr.CheckboxGroup(models, label=f'Choose up to {num_models} different models from the best available!', value=default_models, multiselect=True, max_choices=num_models, interactive=True, filterable=False)
|
72 |
model_choice.change(update_imgbox, model_choice, output)
|
|
|
37 |
with gr.Blocks() as demo:
|
38 |
with gr.Tab('The Dream'):
|
39 |
txt_input = gr.Textbox(label='Your prompt:', lines=4)
|
40 |
+
neg_prompt = gr.Textbox(label='Negative prompt (Optional):', placeholder='Enter undesirable attributes here', lines=2)
|
41 |
+
image_style = gr.Dropdown(label='Select Style', choices=["Default", "Cinematic", "Digital Art", "Portrait"], value="Default")
|
42 |
+
|
43 |
gen_button = gr.Button('Generate up to 6 images in up to 1 minutes total')
|
44 |
stop_button = gr.Button('Stop', variant='secondary', interactive=False)
|
45 |
|
|
|
62 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
63 |
|
64 |
for m, o in zip(current_models, output):
|
65 |
+
gen_event = gen_button.click(gen_fn, [m, txt_input, neg_prompt, image_style], o)
|
66 |
stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
67 |
|
|
|
|
|
|
|
|
|
|
|
68 |
with gr.Accordion('Model selection'):
|
69 |
model_choice = gr.CheckboxGroup(models, label=f'Choose up to {num_models} different models from the best available!', value=default_models, multiselect=True, max_choices=num_models, interactive=True, filterable=False)
|
70 |
model_choice.change(update_imgbox, model_choice, output)
|