linoyts HF staff commited on
Commit
bfcafaf
·
verified ·
1 Parent(s): 20ff7bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -23,7 +23,8 @@ pipe.load_lora_weights(hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8
23
  pipe.fuse_lora(lora_scale=0.125)
24
  pipe.to(DEVICE)
25
 
26
- examples = [[Image.open("cat.jpg"), "a tiger", 0, 0.7, 0.5, 0.9, 8, 8, 789385745, False]]
 
27
  def reset_do_inversion():
28
  return True
29
 
@@ -34,8 +35,8 @@ def resize_img(image, max_size=1024):
34
  new_height = int(height * scaling_factor)
35
  return image.resize((new_width, new_height), Image.LANCZOS)
36
 
37
- def check_style(stylezation, eta, eta_decay, decay_power, start_timestep, stop_timestep):
38
- return eta, eta_decay, decay_power, start_timestep, stop_timestep
39
 
40
  @spaces.GPU(duration=85)
41
  def invert_and_edit(image,
@@ -239,7 +240,7 @@ based on the implementations of [@raven38](https://github.com/raven38) & [@DarkM
239
 
240
  gr.Examples(
241
  examples=examples,
242
- inputs=[input_image, prompt,start_timestep, stop_timestep, gamma, eta, num_inversion_steps, num_inference_steps, seed, randomize_seed ],
243
  outputs=[result, inverted_latents, image_latents, latent_image_ids, do_inversion, seed],
244
  fn=invert_and_edit,
245
  )
@@ -256,8 +257,8 @@ based on the implementations of [@raven38](https://github.com/raven38) & [@DarkM
256
 
257
  stylezation.change(
258
  fn=check_style,
259
- inputs=[stylezation, eta, eta_decay, decay_power, start_timestep, stop_timestep],
260
- outputs=[eta, eta_decay, decay_power, start_timestep, stop_timestep]
261
  )
262
 
263
 
 
23
  pipe.fuse_lora(lora_scale=0.125)
24
  pipe.to(DEVICE)
25
 
26
+ examples = [[Image.open("cat.jpg"), "a tiger", 0, 4, 0.5, 0.9, False, 1, 8, 8, 789385745, False],
27
+ [Image.open("metal.png"), "a dragon, 3d melting gold metal", 0, 4, 0.5, 0.9, True, 2, 8, 8, 789385745, False]]
28
  def reset_do_inversion():
29
  return True
30
 
 
35
  new_height = int(height * scaling_factor)
36
  return image.resize((new_width, new_height), Image.LANCZOS)
37
 
38
+ def check_style(stylezation):
39
+ return eta, True, 2
40
 
41
  @spaces.GPU(duration=85)
42
  def invert_and_edit(image,
 
240
 
241
  gr.Examples(
242
  examples=examples,
243
+ inputs=[input_image, prompt,start_timestep, stop_timestep, gamma, eta, eta_decay, decay_power, num_inversion_steps, num_inference_steps, seed, randomize_seed ],
244
  outputs=[result, inverted_latents, image_latents, latent_image_ids, do_inversion, seed],
245
  fn=invert_and_edit,
246
  )
 
257
 
258
  stylezation.change(
259
  fn=check_style,
260
+ inputs=[stylezation],
261
+ outputs=[eta_decay, decay_power]
262
  )
263
 
264