fountai commited on
Commit
4d9a51c
·
1 Parent(s): 39e8c88

update interface

Browse files
Files changed (1) hide show
  1. app.py +20 -10
app.py CHANGED
@@ -124,6 +124,9 @@ def process_image(image, prompt, steps, use_lora, use_controlnet, use_depth, use
124
 
125
 
126
  custom_css = """
 
 
 
127
  .gradio-container {
128
  margin: unset !important;
129
  padding: unset !important;
@@ -133,6 +136,10 @@ custom_css = """
133
  min-height: unset !important;
134
  }
135
 
 
 
 
 
136
  .app-container {
137
  height: 100vh;
138
  background: rgb(24, 24, 27);
@@ -140,6 +147,8 @@ custom_css = """
140
  }
141
 
142
  .sidebar {
 
 
143
  max-width: 300px;
144
  padding: 1rem;
145
  background: rgb(31, 31, 35);
@@ -168,12 +177,12 @@ custom_css = """
168
  }
169
 
170
  .side_items {
171
- height: 96vh;
172
  }
173
 
174
  .form {
175
  flex-wrap: unset;
176
- height: 100%;
177
  }
178
  """
179
 
@@ -182,26 +191,27 @@ with gr.Blocks(css=custom_css) as demo:
182
  with gr.Column(scale=1, min_width=300, elem_classes="sidebar"):
183
  with gr.Column(elem_classes="side_items"):
184
  input_image = gr.Image(label="Image", type="filepath")
185
- negative_image = gr.Image(label="Negative_image", type="filepath")
186
- submit_btn = gr.Button("Submit")
187
  prompt = gr.Textbox(label="Prompt")
 
188
  neg_prompt = gr.Textbox(label="Neg Prompt")
189
  steps = gr.Slider(step=1, minimum=1, maximum=64, value=28, label="Num Steps")
190
- use_lora = gr.Checkbox(label="Use LORA", value=True)
191
- lora_path = gr.Textbox(label="LoraPath", value="XLabs-AI/flux-lora-collection")
192
- lora_name = gr.Textbox(label="LoraName", value="realism_lora.safetensors")
193
- lora_weight = gr.Slider(step=0.1, minimum=0, maximum=1, value=0.7, label="Lora Weight")
194
  controlnet = gr.Checkbox(label="Use Controlnet(by default uses canny)", value=True)
195
- use_ip = gr.Checkbox(label="Use IP")
196
  use_depth = gr.Checkbox(label="Use depth")
197
  use_hed = gr.Checkbox(label="Use hed")
 
 
 
 
198
  true_gs = gr.Slider(step=0.1, minimum=0, maximum=10, value=3.5, label="TrueGs")
199
  guidance = gr.Slider(minimum=1, maximum=10, value=4, label="Guidance")
200
  cfg = gr.Slider(minimum=1, maximum=10, value=1, label="CFG")
 
201
 
202
  with gr.Column(scale=2, elem_classes="app"):
203
  output = gr.Gallery(label="Galery output", elem_classes="galery", selected_index=0)
204
 
205
  submit_btn.click(process_image, inputs=[input_image, prompt, steps, use_lora, controlnet, use_depth, use_hed, use_ip, lora_name, lora_path, lora_weight, negative_image, neg_prompt, true_gs, guidance, cfg], outputs=output)
206
 
207
- demo.launch(share=True)
 
 
124
 
125
 
126
  custom_css = """
127
+ body {
128
+ overflow-y: hidden;
129
+ }
130
  .gradio-container {
131
  margin: unset !important;
132
  padding: unset !important;
 
136
  min-height: unset !important;
137
  }
138
 
139
+ .app {
140
+ height: 100%;
141
+ }
142
+
143
  .app-container {
144
  height: 100vh;
145
  background: rgb(24, 24, 27);
 
147
  }
148
 
149
  .sidebar {
150
+ overflow-y: auto;
151
+ height: 100%;
152
  max-width: 300px;
153
  padding: 1rem;
154
  background: rgb(31, 31, 35);
 
177
  }
178
 
179
  .side_items {
180
+ height: auto;
181
  }
182
 
183
  .form {
184
  flex-wrap: unset;
185
+ height: auto;
186
  }
187
  """
188
 
 
191
  with gr.Column(scale=1, min_width=300, elem_classes="sidebar"):
192
  with gr.Column(elem_classes="side_items"):
193
  input_image = gr.Image(label="Image", type="filepath")
 
 
194
  prompt = gr.Textbox(label="Prompt")
195
+ submit_btn = gr.Button("Submit")
196
  neg_prompt = gr.Textbox(label="Neg Prompt")
197
  steps = gr.Slider(step=1, minimum=1, maximum=64, value=28, label="Num Steps")
198
+ use_ip = gr.Checkbox(label="Use IP Adapter")
 
 
 
199
  controlnet = gr.Checkbox(label="Use Controlnet(by default uses canny)", value=True)
 
200
  use_depth = gr.Checkbox(label="Use depth")
201
  use_hed = gr.Checkbox(label="Use hed")
202
+ use_lora = gr.Checkbox(label="Use LORA", value=True)
203
+ lora_path = gr.Textbox(label="LoraPath", value="XLabs-AI/flux-lora-collection")
204
+ lora_name = gr.Textbox(label="LoraName", value="realism_lora.safetensors")
205
+
206
  true_gs = gr.Slider(step=0.1, minimum=0, maximum=10, value=3.5, label="TrueGs")
207
  guidance = gr.Slider(minimum=1, maximum=10, value=4, label="Guidance")
208
  cfg = gr.Slider(minimum=1, maximum=10, value=1, label="CFG")
209
+ negative_image = gr.Image(label="Negative_image", type="filepath")
210
 
211
  with gr.Column(scale=2, elem_classes="app"):
212
  output = gr.Gallery(label="Galery output", elem_classes="galery", selected_index=0)
213
 
214
  submit_btn.click(process_image, inputs=[input_image, prompt, steps, use_lora, controlnet, use_depth, use_hed, use_ip, lora_name, lora_path, lora_weight, negative_image, neg_prompt, true_gs, guidance, cfg], outputs=output)
215
 
216
+ print("starting")
217
+ demo.launch(share=True, debug=True)