AlekseyCalvin commited on
Commit
dc18d3e
·
verified ·
1 Parent(s): cacafb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -77,9 +77,10 @@ class calculateDuration:
77
 
78
  def update_selection(evt: gr.SelectData, width, height):
79
  selected_lora = loras[evt.index]
80
- new_placeholder = f"Type a prompt for {selected_lora['title']}"
81
  lora_repo = selected_lora["repo"]
82
- updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨"
 
83
  if "aspect" in selected_lora:
84
  if selected_lora["aspect"] == "portrait":
85
  width = 768
@@ -159,7 +160,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
159
 
160
  # Info blob stating what the app is running
161
  info_blob = gr.HTML(
162
- """<div id="info_blob">Prephrase prompts w/: 1: RCA agitprop poster style || 2-thru-9: HST style (then optional:) autochrome film photo || 10: ZOS AOS art by Austin Osman Spare || 11: Bakst style art || 12-22: HST || 23: LEN Vladimir Lenin || 24: SOTS art style || 25: crisp photo || 26: filmfotos || 27: TOK hybrid || 28: 2004 photo || 29: TOK portra || 30: flmft Kodachrome || 31: HST Austin Osman Spare style || 32: TSVETAEVA || 33: BLOK || 34: TROTSKY || 35-36: ROSA || 37-39: HST || 40: pficonics || 41: wh3r3sw4ld0 || 42: retrofuturism || 43: Propaganda Poster || 44: HST || 45: Letov photo of Yegor Letov || 46: Velimir Khlebnikov || 47-49: Akhmatova || 50-52: MAYAK style poster by Vladimir Mayakovsky || 54: Olga Petrovskaya || 55: Konstantin Vaginov || 56: Vladimir Sillov || 57: Osip Mandelshtam || 58: ADU || 59-61: MAYAK style poster by Vladimir Mayakovsky || 62-70: Neurealist textographic photo collage || 71-73: Enst style (optional:) transposed overlaid images by Max Ernst || 74-80: RCA style agitprop poster art || 81-84: RCA MAYAL style agitprop poster art (or photo, etc) || 85: vintage cover || </div>"""
163
  )
164
  selected_index = gr.State(None)
165
  with gr.Row():
@@ -186,16 +187,16 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
186
  with gr.Column():
187
  with gr.Row():
188
  cfg_scale = gr.Slider(label="CFG Scale", minimum=0, maximum=20, step=.1, value=1.0)
189
- steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=8)
190
 
191
  with gr.Row():
192
- width = gr.Slider(label="Width", minimum=256, maximum=1536, step=64, value=768)
193
- height = gr.Slider(label="Height", minimum=256, maximum=1536, step=64, value=768)
194
 
195
  with gr.Row():
196
  randomize_seed = gr.Checkbox(True, label="Randomize seed")
197
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
198
- lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=2.5, step=0.01, value=0.95)
199
 
200
  gallery.select(
201
  update_selection,
 
77
 
78
  def update_selection(evt: gr.SelectData, width, height):
79
  selected_lora = loras[evt.index]
80
+ new_placeholder = f"Prompt for {selected_lora['title']} using activator word(s): '{selected_lora["trigger_word"]}'! "
81
  lora_repo = selected_lora["repo"]
82
+ lora_trigger = selected_lora["trigger_word"]
83
+ updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}). Prompt using: '{lora_trigger}'!"
84
  if "aspect" in selected_lora:
85
  if selected_lora["aspect"] == "portrait":
86
  width = 768
 
160
 
161
  # Info blob stating what the app is running
162
  info_blob = gr.HTML(
163
+ """<div id="info_blob"> To reinforce/focus in selected fine-tuned LoRAs (Low-Rank Adapters), add special “trigger" words/phrases to your prompts. </div>"""
164
  )
165
  selected_index = gr.State(None)
166
  with gr.Row():
 
187
  with gr.Column():
188
  with gr.Row():
189
  cfg_scale = gr.Slider(label="CFG Scale", minimum=0, maximum=20, step=.1, value=1.0)
190
+ steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=9)
191
 
192
  with gr.Row():
193
+ width = gr.Slider(label="Width", minimum=256, maximum=1536, step=64, value=1024)
194
+ height = gr.Slider(label="Height", minimum=256, maximum=1536, step=64, value=1024)
195
 
196
  with gr.Row():
197
  randomize_seed = gr.Checkbox(True, label="Randomize seed")
198
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
199
+ lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=2.5, step=0.01, value=1.0)
200
 
201
  gallery.select(
202
  update_selection,