This commit is contained in:
lvmin
2023-08-10 20:14:30 -07:00
parent 1e40fb8729
commit 4421506b67
2 changed files with 15 additions and 39 deletions
-28
View File
@@ -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()
+15 -11
View File
@@ -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()