From 4421506b676634529241ac66832d4186aa196da0 Mon Sep 17 00:00:00 2001 From: lvmin Date: Thu, 10 Aug 2023 20:14:30 -0700 Subject: [PATCH] i --- draft.py | 28 ---------------------------- webui.py | 26 +++++++++++++++----------- 2 files changed, 15 insertions(+), 39 deletions(-) delete mode 100644 draft.py diff --git a/draft.py b/draft.py deleted file mode 100644 index b7ca7e79..00000000 --- a/draft.py +++ /dev/null @@ -1,28 +0,0 @@ -import gradio as gr - -from modules.sdxl_styles import apply_style -from modules.default_pipeline import process - - -def generate_clicked(positive_prompt): - - p, n = apply_style('cinematic-default', positive_prompt, '') - - print(p) - print(n) - - return process(positive_prompt=p, - negative_prompt=n) - - -block = gr.Blocks().queue() -with block: - with gr.Column(): - prompt = gr.Textbox(label="Prompt", value='a handsome man in forest') - run_button = gr.Button(label="Run") - result_gallery = gr.Gallery(label='Fooocus', show_label=True, elem_id="gallery", - object_fit='contain', height=768) - run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[result_gallery]) - - -block.launch() diff --git a/webui.py b/webui.py index 2c12b3c2..181381f6 100644 --- a/webui.py +++ b/webui.py @@ -15,17 +15,21 @@ def generate_clicked(positive_prompt): negative_prompt=n) -block = gr.Blocks().queue() +block = gr.Blocks() with block: - with gr.Column(): - gallery = gr.Gallery(label='Gallery', show_label=False, object_fit='contain', height=768) - with gr.Row(): - with gr.Column(scale=0.85): - prompt = gr.Textbox(show_label=False, placeholder="Type prompt here.", container=False) - with gr.Column(scale=0.15, min_width=0): - run_button = gr.Button(label="Generate", value="Generate") - with gr.Row(): - advanced_checkbox = gr.Checkbox(label='Advanced', value=False, container=False) - run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[gallery]) + with gr.Row(): + with gr.Column(scale=0.7): + gallery = gr.Gallery(label='Gallery', show_label=False, object_fit='contain', height=768) + with gr.Row(): + with gr.Column(scale=0.85): + prompt = gr.Textbox(show_label=False, placeholder="Type prompt here.", container=False) + with gr.Column(scale=0.15, min_width=0): + run_button = gr.Button(label="Generate", value="Generate") + with gr.Row(): + advanced_checkbox = gr.Checkbox(label='Advanced', value=False, container=False) + with gr.Column(scale=0.3): + with gr.Group(): + gr.Textbox() + run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[gallery]) block.launch()