prithivMLmods commited on
Commit
4c2f1aa
·
verified ·
1 Parent(s): 92bfd13

update app

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -14,7 +14,7 @@ try:
14
  except ImportError:
15
  class spaces:
16
  @staticmethod
17
- def GPU(duration=60):
18
  def decorator(func):
19
  return func
20
  return decorator
@@ -135,7 +135,7 @@ pipe.load_lora_weights("dx8152/Qwen-Image-Edit-2509-Fusion",
135
 
136
  # 3. Face Swap
137
  pipe.load_lora_weights("Alissonerdx/BFS-Best-Face-Swap",
138
- weight_name="bfs_head_v3_qwen_image_edit_2509.safetensors",
139
  adapter_name="face-swap")
140
 
141
 
@@ -169,7 +169,7 @@ def update_dimensions_on_upload(image):
169
 
170
  return new_width, new_height
171
 
172
- @spaces.GPU(duration=60)
173
  def infer(
174
  input_gallery_items,
175
  prompt,
@@ -235,7 +235,7 @@ def infer(
235
 
236
  return result, seed
237
 
238
- @spaces.GPU(duration=60)
239
  def infer_example(input_gallery_items, prompt, lora_adapter):
240
  # input_gallery_items will be the list structure from gr.Examples
241
  if not input_gallery_items:
@@ -252,8 +252,8 @@ def infer_example(input_gallery_items, prompt, lora_adapter):
252
  lora_adapter,
253
  seed=0,
254
  randomize_seed=True,
255
- guidance_scale=4.0,
256
- steps=30
257
  )
258
 
259
 
@@ -305,8 +305,6 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
305
  guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=1.0)
306
  steps = gr.Slider(label="Inference Steps", minimum=1, maximum=50, step=1, value=4)
307
 
308
- # FIX: Correctly formatted inputs for gr.Gallery in Examples.
309
- # Each example input corresponding to the Gallery component must be a LIST of images.
310
  gr.Examples(
311
  examples=[
312
  # Format: [ [Image_List], Prompt, Adapter ]
 
14
  except ImportError:
15
  class spaces:
16
  @staticmethod
17
+ def GPU(duration=30):
18
  def decorator(func):
19
  return func
20
  return decorator
 
135
 
136
  # 3. Face Swap
137
  pipe.load_lora_weights("Alissonerdx/BFS-Best-Face-Swap",
138
+ weight_name="bfs_face_v1_qwen_image_edit_2509.safetensors",
139
  adapter_name="face-swap")
140
 
141
 
 
169
 
170
  return new_width, new_height
171
 
172
+ @spaces.GPU(duration=30)
173
  def infer(
174
  input_gallery_items,
175
  prompt,
 
235
 
236
  return result, seed
237
 
238
+ @spaces.GPU(duration=30)
239
  def infer_example(input_gallery_items, prompt, lora_adapter):
240
  # input_gallery_items will be the list structure from gr.Examples
241
  if not input_gallery_items:
 
252
  lora_adapter,
253
  seed=0,
254
  randomize_seed=True,
255
+ guidance_scale=1.0,
256
+ steps=4
257
  )
258
 
259
 
 
305
  guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=1.0)
306
  steps = gr.Slider(label="Inference Steps", minimum=1, maximum=50, step=1, value=4)
307
 
 
 
308
  gr.Examples(
309
  examples=[
310
  # Format: [ [Image_List], Prompt, Adapter ]