AlekseyCalvin commited on
Commit
35472c6
·
verified ·
1 Parent(s): 266e725

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -174,7 +174,7 @@ def infer_with_lora(input_image, prompt, selected_index, custom_lora, seed=42, r
174
  elif trigger_word == ", video game screenshot in the style of THSMS":
175
  prompt = f"create a video game screenshot in the style of THSMS with the person from the photo, {prompt}. maintain the facial identity of the person and general features"
176
  else:
177
- prompt = f"convert the style of this portrait photo to {trigger_word} while maintaining the identity of the person. {prompt}. Make sure to maintain the person's facial identity and features, while still changing the overall style to {trigger_word}."
178
 
179
  try:
180
  image = pipe(
@@ -231,8 +231,8 @@ with gr.Blocks(css=css) as demo:
231
  gr_flux_loras = gr.State(value=flux_loras_raw)
232
 
233
  title = gr.HTML(
234
- """<h1> FLUX.1 Kontext Portrait 👩🏻‍🎤
235
- <br><small style="font-size: 13px; opacity: 0.75;">Flux.1 Kontext [dev] + community Flux LoRAs 🤗</small></h1>""",
236
  )
237
 
238
  selected_state = gr.State(value=None)
@@ -241,7 +241,7 @@ with gr.Blocks(css=css) as demo:
241
  with gr.Row(elem_id="main_app"):
242
  with gr.Column(scale=4, elem_id="box_column"):
243
  with gr.Group(elem_id="gallery_box"):
244
- input_image = gr.Image(label="Upload a picture of yourself", type="pil", height=300)
245
 
246
  gallery = gr.Gallery(
247
  label="Pick a LoRA",
@@ -255,10 +255,10 @@ with gr.Blocks(css=css) as demo:
255
  custom_model = gr.Textbox(
256
  label="Or enter a custom HuggingFace FLUX LoRA",
257
  placeholder="e.g., username/lora-name",
258
- visible=False
259
  )
260
  custom_model_card = gr.HTML(visible=False)
261
- custom_model_button = gr.Button("Remove custom LoRA", visible=False)
262
 
263
  with gr.Column(scale=5):
264
  with gr.Row():
@@ -267,7 +267,7 @@ with gr.Blocks(css=css) as demo:
267
  show_label=False,
268
  lines=1,
269
  max_lines=1,
270
- placeholder="optional description, e.g. 'a man with glasses and a beard'",
271
  elem_id="prompt"
272
  )
273
  run_button = gr.Button("Generate", elem_id="run_button")
 
174
  elif trigger_word == ", video game screenshot in the style of THSMS":
175
  prompt = f"create a video game screenshot in the style of THSMS with the person from the photo, {prompt}. maintain the facial identity of the person and general features"
176
  else:
177
+ prompt = f"{prompt}. edit the image whilst limiting influence from {trigger_word} to superficial flourishes, and only in regions of the image with low or missing source details. Maintain with perfect fidelity the identity of any persons or subjects! Leave the composition and the details of the image absolutely unchanged. Make sure to retain all facial identity and other image features, while still potentially allowing some influence from {trigger_word}. Retain facial features and proportions with great fidelity to the source."
178
 
179
  try:
180
  image = pipe(
 
231
  gr_flux_loras = gr.State(value=flux_loras_raw)
232
 
233
  title = gr.HTML(
234
+ """<h1> FLUX.1 Kontext w/LoRAs by Silver Age Poets & SOON®
235
+ <br><small style="font-size: 13px; opacity: 0.75;">Edit images w/our trained adapters as style templates!</small></h1>""",
236
  )
237
 
238
  selected_state = gr.State(value=None)
 
241
  with gr.Row(elem_id="main_app"):
242
  with gr.Column(scale=4, elem_id="box_column"):
243
  with gr.Group(elem_id="gallery_box"):
244
+ input_image = gr.Image(label="Upload a picture", type="pil", height=300)
245
 
246
  gallery = gr.Gallery(
247
  label="Pick a LoRA",
 
255
  custom_model = gr.Textbox(
256
  label="Or enter a custom HuggingFace FLUX LoRA",
257
  placeholder="e.g., username/lora-name",
258
+ visible=True
259
  )
260
  custom_model_card = gr.HTML(visible=False)
261
+ custom_model_button = gr.Button("Remove custom LoRA", visible=True)
262
 
263
  with gr.Column(scale=5):
264
  with gr.Row():
 
267
  show_label=False,
268
  lines=1,
269
  max_lines=1,
270
+ placeholder="optional description, e.g. 'colorize and stylize, leave all else as is'",
271
  elem_id="prompt"
272
  )
273
  run_button = gr.Button("Generate", elem_id="run_button")