Commit
·
515ca04
1
Parent(s):
a3dc06c
draft.py
DELETED
|
@@ -1,28 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
|
| 3 |
-
from modules.sdxl_styles import apply_style
|
| 4 |
-
from modules.default_pipeline import process
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
def generate_clicked(positive_prompt):
|
| 8 |
-
|
| 9 |
-
p, n = apply_style('cinematic-default', positive_prompt, '')
|
| 10 |
-
|
| 11 |
-
print(p)
|
| 12 |
-
print(n)
|
| 13 |
-
|
| 14 |
-
return process(positive_prompt=p,
|
| 15 |
-
negative_prompt=n)
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
block = gr.Blocks().queue()
|
| 19 |
-
with block:
|
| 20 |
-
with gr.Column():
|
| 21 |
-
prompt = gr.Textbox(label="Prompt", value='a handsome man in forest')
|
| 22 |
-
run_button = gr.Button(label="Run")
|
| 23 |
-
result_gallery = gr.Gallery(label='Fooocus', show_label=True, elem_id="gallery",
|
| 24 |
-
object_fit='contain', height=768)
|
| 25 |
-
run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[result_gallery])
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
block.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
webui.py
CHANGED
|
@@ -15,17 +15,21 @@ def generate_clicked(positive_prompt):
|
|
| 15 |
negative_prompt=n)
|
| 16 |
|
| 17 |
|
| 18 |
-
block = gr.Blocks()
|
| 19 |
with block:
|
| 20 |
-
with gr.
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
with gr.
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
block.launch()
|
|
|
|
| 15 |
negative_prompt=n)
|
| 16 |
|
| 17 |
|
| 18 |
+
block = gr.Blocks()
|
| 19 |
with block:
|
| 20 |
+
with gr.Row():
|
| 21 |
+
with gr.Column(scale=0.7):
|
| 22 |
+
gallery = gr.Gallery(label='Gallery', show_label=False, object_fit='contain', height=768)
|
| 23 |
+
with gr.Row():
|
| 24 |
+
with gr.Column(scale=0.85):
|
| 25 |
+
prompt = gr.Textbox(show_label=False, placeholder="Type prompt here.", container=False)
|
| 26 |
+
with gr.Column(scale=0.15, min_width=0):
|
| 27 |
+
run_button = gr.Button(label="Generate", value="Generate")
|
| 28 |
+
with gr.Row():
|
| 29 |
+
advanced_checkbox = gr.Checkbox(label='Advanced', value=False, container=False)
|
| 30 |
+
with gr.Column(scale=0.3):
|
| 31 |
+
with gr.Group():
|
| 32 |
+
gr.Textbox()
|
| 33 |
+
run_button.click(fn=generate_clicked, inputs=[prompt], outputs=[gallery])
|
| 34 |
|
| 35 |
block.launch()
|