Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,14 @@ model.load_lora_weights(REPO_WEIGHT, weight_name=WEIGHT, adapter_name=ADAPTER)
|
|
34 |
model.set_adapters(ADAPTER, adapter_weights=[0.7])
|
35 |
model.to(DEVICE)
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
# Functions
|
38 |
def get_seed(seed):
|
39 |
seed = seed.strip()
|
@@ -64,21 +72,19 @@ def generate(input=DEFAULT_INPUT, negative_input=DEFAULT_NEGATIVE_INPUT, height=
|
|
64 |
return image
|
65 |
|
66 |
# Initialize
|
67 |
-
with gr.Blocks() as main:
|
68 |
-
with gr.
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
submit = gr.Button("▶")
|
78 |
|
79 |
-
with gr.
|
80 |
-
|
81 |
-
image = gr.Image(label="Image")
|
82 |
|
83 |
submit.click(generate, inputs=[input, negative_input, height, width, steps, guidance, seed], outputs=[image])
|
84 |
|
|
|
34 |
model.set_adapters(ADAPTER, adapter_weights=[0.7])
|
35 |
model.to(DEVICE)
|
36 |
|
37 |
+
css = '''
|
38 |
+
.gradio-container{max-width: 560px !important}
|
39 |
+
h1{text-align:center}
|
40 |
+
footer {
|
41 |
+
visibility: hidden
|
42 |
+
}
|
43 |
+
'''
|
44 |
+
|
45 |
# Functions
|
46 |
def get_seed(seed):
|
47 |
seed = seed.strip()
|
|
|
72 |
return image
|
73 |
|
74 |
# Initialize
|
75 |
+
with gr.Blocks(css=css) as main:
|
76 |
+
with gr.Column():
|
77 |
+
input = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Input")
|
78 |
+
negative_input = gr.Textbox(lines=1, value=DEFAULT_NEGATIVE_INPUT, label="Input Negative")
|
79 |
+
height = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_HEIGHT, label="Height")
|
80 |
+
width = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_WIDTH, label="Width")
|
81 |
+
steps = gr.Slider(minimum=0, maximum=100, step=1, value=8, label="Steps")
|
82 |
+
guidance = gr.Slider(minimum=0, maximum=100, step=0.001, value=3, label = "Guidance")
|
83 |
+
seed = gr.Textbox(lines=1, value="", label="Seed (Blank for random)")
|
84 |
+
submit = gr.Button("▶")
|
|
|
85 |
|
86 |
+
with gr.Column():
|
87 |
+
image = gr.Image(label="Image")
|
|
|
88 |
|
89 |
submit.click(generate, inputs=[input, negative_input, height, width, steps, guidance, seed], outputs=[image])
|
90 |
|