Alexander Bagus commited on
Commit
b5bc414
·
1 Parent(s): b4f488e
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -65,7 +65,7 @@ def generate_lora(
65
  progress=gr.Progress(track_tqdm=True),
66
  ):
67
 
68
- ulid = str(ULID()).lower()
69
  print(f"ulid: {ulid}")
70
 
71
  # Load images
@@ -88,7 +88,7 @@ def generate_lora(
88
 
89
  save_file(lora, lora_path)
90
 
91
- return True
92
 
93
  @spaces.GPU
94
  def generate_image(
@@ -140,9 +140,9 @@ with gr.Blocks() as demo:
140
  with gr.Column():
141
  lora_path = gr.Textbox(label="Generated LoRA path",lines=2, interactive=False)
142
  lora_download = gr.DownloadButton(label=f"Download LoRA", visible=has_lora)
143
- with gr.Group(visible=has_lora) as my_container:
 
144
  with gr.Row():
145
- gr.Markdown("Your LoRA is ready! Now, try generating some images.")
146
  with gr.Column():
147
  prompt = gr.Textbox(
148
  label="Prompt",
@@ -210,7 +210,7 @@ with gr.Blocks() as demo:
210
  inputs=[
211
  input_images
212
  ],
213
- outputs=[lora_path, lora_download, has_lora],
214
  )
215
 
216
 
 
65
  progress=gr.Progress(track_tqdm=True),
66
  ):
67
 
68
+ ulid = str(ULID()).lower()[:12]
69
  print(f"ulid: {ulid}")
70
 
71
  # Load images
 
88
 
89
  save_file(lora, lora_path)
90
 
91
+ return lora_path, lora_url, True
92
 
93
  @spaces.GPU
94
  def generate_image(
 
140
  with gr.Column():
141
  lora_path = gr.Textbox(label="Generated LoRA path",lines=2, interactive=False)
142
  lora_download = gr.DownloadButton(label=f"Download LoRA", visible=has_lora)
143
+ with gr.Group(visible=has_lora) as imagen_container:
144
+ gr.Markdown("Your LoRA is ready! Now, try generating some images.")
145
  with gr.Row():
 
146
  with gr.Column():
147
  prompt = gr.Textbox(
148
  label="Prompt",
 
210
  inputs=[
211
  input_images
212
  ],
213
+ outputs=[lora_path, lora_download, has_lora, imagen_container],
214
  )
215
 
216