Staticaliza commited on
Commit
6095378
·
verified ·
1 Parent(s): 3c11d57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -14
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.Row():
69
- with gr.Column():
70
- input = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Input")
71
- negative_input = gr.Textbox(lines=1, value=DEFAULT_NEGATIVE_INPUT, label="Input Negative")
72
- height = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_HEIGHT, label="Height")
73
- width = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_WIDTH, label="Width")
74
- steps = gr.Slider(minimum=0, maximum=100, step=1, value=8, label="Steps")
75
- guidance = gr.Slider(minimum=0, maximum=100, step=0.001, value=3, label = "Guidance")
76
- seed = gr.Textbox(lines=1, value="", label="Seed (Blank for random)")
77
- submit = gr.Button("▶")
78
 
79
- with gr.Row():
80
- with gr.Column():
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