jiuface commited on
Commit
4039bad
·
1 Parent(s): daf6c0f
Files changed (1) hide show
  1. app.py +14 -16
app.py CHANGED
@@ -149,13 +149,11 @@ def run_flux(
149
  resolution_wh: Tuple[int, int],
150
  ) -> Image.Image:
151
  print("Running FLUX...")
152
-
153
-
154
-
155
- with calculateDuration("load lora"):
156
- print("start to load lora", lora_path, lora_weights)
157
- pipe.unload_lora_weights()
158
- pipe.load_lora_weights(lora_path, weight_name=lora_weights)
159
 
160
  width, height = resolution_wh
161
  if randomize_seed_checkbox:
@@ -253,16 +251,16 @@ with gr.Blocks() as demo:
253
  with gr.Column():
254
 
255
  image_url = gr.Text(
256
- label="Image url for inpainting",
257
- show_label=False,
258
  max_lines=1,
259
  placeholder="Enter image url for inpainting",
260
  container=False,
261
  )
262
 
263
  mask_url = gr.Text(
264
- label="image url of masking",
265
- show_label=False,
266
  max_lines=1,
267
  placeholder="Enter url of masking",
268
  container=False,
@@ -270,7 +268,7 @@ with gr.Blocks() as demo:
270
 
271
  inpainting_prompt_text_component = gr.Text(
272
  label="Inpainting prompt",
273
- show_label=False,
274
  max_lines=1,
275
  placeholder="Enter text to generate inpainting",
276
  container=False,
@@ -285,14 +283,14 @@ with gr.Blocks() as demo:
285
  max_lines=1,
286
  placeholder="Enter your model path",
287
  info="Currently, only LoRA hosted on Hugging Face'model can be loaded properly.",
288
- value="XLabs-AI/flux-RealismLora"
289
  )
290
  lora_weights = gr.Textbox(
291
  label="Lora weights",
292
  show_label=True,
293
  max_lines=1,
294
  placeholder="Enter your lora weights name",
295
- value="lora.safetensors"
296
  )
297
  lora_scale = gr.Slider(
298
  label="Lora scale",
@@ -359,7 +357,8 @@ with gr.Blocks() as demo:
359
  step=1,
360
  value=20,
361
  )
362
-
 
363
  upload_to_r2 = gr.Checkbox(label="Upload to R2", value=False)
364
  with gr.Row():
365
  account_id = gr.Textbox(label="Account Id", placeholder="Enter R2 account id")
@@ -368,7 +367,6 @@ with gr.Blocks() as demo:
368
  with gr.Row():
369
  access_key = gr.Textbox(label="Access Key", placeholder="Enter R2 access key here")
370
  secret_key = gr.Textbox(label="Secret Key", placeholder="Enter R2 secret key here")
371
-
372
 
373
  with gr.Column():
374
 
 
149
  resolution_wh: Tuple[int, int],
150
  ) -> Image.Image:
151
  print("Running FLUX...")
152
+ if lora_path and lora_weights:
153
+ with calculateDuration("load lora"):
154
+ print("start to load lora", lora_path, lora_weights)
155
+ pipe.unload_lora_weights()
156
+ pipe.load_lora_weights(lora_path, weight_name=lora_weights)
 
 
157
 
158
  width, height = resolution_wh
159
  if randomize_seed_checkbox:
 
251
  with gr.Column():
252
 
253
  image_url = gr.Text(
254
+ label="Orginal image url",
255
+ show_label=True,
256
  max_lines=1,
257
  placeholder="Enter image url for inpainting",
258
  container=False,
259
  )
260
 
261
  mask_url = gr.Text(
262
+ label="Mask image url",
263
+ show_label=True,
264
  max_lines=1,
265
  placeholder="Enter url of masking",
266
  container=False,
 
268
 
269
  inpainting_prompt_text_component = gr.Text(
270
  label="Inpainting prompt",
271
+ show_label=True,
272
  max_lines=1,
273
  placeholder="Enter text to generate inpainting",
274
  container=False,
 
283
  max_lines=1,
284
  placeholder="Enter your model path",
285
  info="Currently, only LoRA hosted on Hugging Face'model can be loaded properly.",
286
+ value=""
287
  )
288
  lora_weights = gr.Textbox(
289
  label="Lora weights",
290
  show_label=True,
291
  max_lines=1,
292
  placeholder="Enter your lora weights name",
293
+ value=""
294
  )
295
  lora_scale = gr.Slider(
296
  label="Lora scale",
 
357
  step=1,
358
  value=20,
359
  )
360
+
361
+ with gr.Accordion("R2 Settings", open=False):
362
  upload_to_r2 = gr.Checkbox(label="Upload to R2", value=False)
363
  with gr.Row():
364
  account_id = gr.Textbox(label="Account Id", placeholder="Enter R2 account id")
 
367
  with gr.Row():
368
  access_key = gr.Textbox(label="Access Key", placeholder="Enter R2 access key here")
369
  secret_key = gr.Textbox(label="Secret Key", placeholder="Enter R2 secret key here")
 
370
 
371
  with gr.Column():
372