linoyts HF staff commited on
Commit
bff13e4
·
verified ·
1 Parent(s): 1507f22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -18
app.py CHANGED
@@ -23,6 +23,7 @@ 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
  def reset_do_inversion():
27
  return True
28
 
@@ -109,14 +110,6 @@ Stochastic Rectified Differential Equations*](https://rf-inversion.github.io/dat
109
  placeholder="describe the edited output",
110
  )
111
  with gr.Row():
112
- eta = gr.Slider(
113
- label="eta",
114
- info = "lower eta to ehnace the edits",
115
- minimum=0.0,
116
- maximum=1.0,
117
- step=0.1,
118
- value=0.9,
119
- )
120
  start_timestep = gr.Slider(
121
  label="start timestep",
122
  info = "lower gamma to ehnace the edits",
@@ -133,6 +126,14 @@ Stochastic Rectified Differential Equations*](https://rf-inversion.github.io/dat
133
  step=0.1,
134
  value=0.9,
135
  )
 
 
 
 
 
 
 
 
136
 
137
  run_button = gr.Button("Edit", variant="primary")
138
 
@@ -140,16 +141,16 @@ Stochastic Rectified Differential Equations*](https://rf-inversion.github.io/dat
140
  result = gr.Image(label="Result")
141
 
142
  with gr.Accordion("Advanced Settings", open=False):
143
- with gr.Row():
144
- seed = gr.Slider(
145
- label="Seed",
146
- minimum=0,
147
- maximum=MAX_SEED,
148
- step=1,
149
- value=42,
150
- )
151
-
152
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
153
 
154
  with gr.Row():
155
  gamma = gr.Slider(
@@ -209,6 +210,13 @@ Stochastic Rectified Differential Equations*](https://rf-inversion.github.io/dat
209
  outputs=[result, inverted_latents, image_latents, latent_image_ids, do_inversion, seed],
210
  )
211
 
 
 
 
 
 
 
 
212
  input_image.change(
213
  fn=reset_do_inversion,
214
  outputs=[do_inversion]
 
23
  pipe.fuse_lora(lora_scale=0.125)
24
  pipe.to(DEVICE)
25
 
26
+ examples = [[Image.open("cat.jpg"), "a tiger"]]
27
  def reset_do_inversion():
28
  return True
29
 
 
110
  placeholder="describe the edited output",
111
  )
112
  with gr.Row():
 
 
 
 
 
 
 
 
113
  start_timestep = gr.Slider(
114
  label="start timestep",
115
  info = "lower gamma to ehnace the edits",
 
126
  step=0.1,
127
  value=0.9,
128
  )
129
+ eta = gr.Slider(
130
+ label="eta",
131
+ info = "lower eta to ehnace the edits",
132
+ minimum=0.0,
133
+ maximum=1.0,
134
+ step=0.1,
135
+ value=0.9,
136
+ )
137
 
138
  run_button = gr.Button("Edit", variant="primary")
139
 
 
141
  result = gr.Image(label="Result")
142
 
143
  with gr.Accordion("Advanced Settings", open=False):
144
+
145
+ seed = gr.Slider(
146
+ label="Seed",
147
+ minimum=0,
148
+ maximum=MAX_SEED,
149
+ step=1,
150
+ value=42,
151
+ )
152
+
153
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
154
 
155
  with gr.Row():
156
  gamma = gr.Slider(
 
210
  outputs=[result, inverted_latents, image_latents, latent_image_ids, do_inversion, seed],
211
  )
212
 
213
+ gr.Examples(
214
+ examples=examples,
215
+ inputs=[input_image, prompt,],
216
+ outputs=[result, inverted_latents, image_latents, latent_image_ids, do_inversion, seed],
217
+ fn=infer,
218
+ )
219
+
220
  input_image.change(
221
  fn=reset_do_inversion,
222
  outputs=[do_inversion]