Linoy Tsaban commited on
Commit
1988c7f
1 Parent(s): 62abbd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +84 -52
app.py CHANGED
@@ -177,53 +177,81 @@ def randomize_seed_fn(seed, randomize_seed):
177
  def get_example():
178
  case = [
179
  [
180
- 'examples/source_a_cat_sitting_next_to_a_mirror.jpeg',
181
- 'a cat sitting next to a mirror',
182
- 'watercolor painting of a cat sitting next to a mirror',
 
 
 
 
 
 
 
183
  100,
184
  36,
185
  15,
186
- 'Schnauzer dog', 'cat',
187
- 5.5,
188
- 1,
189
- 'examples/ddpm_sega_watercolor_painting_a_cat_sitting_next_to_a_mirror_plus_dog_minus_cat.png'
190
  ],
191
  [
192
- 'examples/source_a_man_wearing_a_brown_hoodie_in_a_crowded_street.jpeg',
193
- 'a man wearing a brown hoodie in a crowded street',
194
- 'a robot wearing a brown hoodie in a crowded street',
 
 
 
 
 
 
195
  100,
196
  36,
197
  15,
198
- 'painting','',
199
- 10,
200
- 1,
201
- 'examples/ddpm_sega_painting_of_a_robot_wearing_a_brown_hoodie_in_a_crowded_street.png'
202
  ],
203
- [
204
- 'examples/source_wall_with_framed_photos.jpeg',
205
- '',
206
- '',
207
- 100,
 
 
 
 
 
 
208
  36,
209
  15,
210
- 'pink drawings of muffins','',
211
- 10,
212
- 1,
213
- 'examples/ddpm_sega_plus_pink_drawings_of_muffins.png'
214
  ],
215
- [
216
- 'examples/source_an_empty_room_with_concrete_walls.jpg',
217
- 'an empty room with concrete walls',
218
- 'glass walls',
219
- 100,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  36,
221
- 17,
222
- 'giant elephant','',
223
- 10,
224
- 1,
225
- 'examples/ddpm_sega_glass_walls_gian_elephant.png'
226
- ]]
227
  return case
228
 
229
 
@@ -667,24 +695,28 @@ with gr.Blocks(css="style.css") as demo:
667
  outputs = [seed],
668
  queue = False)
669
 
670
- # gr.Examples(
671
- # label='Examples',
672
- # examples=get_example(),
673
- # inputs=[input_image, src_prompt, tar_prompt, steps,
674
- # # src_cfg_scale,
675
- # skip,
676
- # tar_cfg_scale,
677
- # edit_concept_1,
678
- # edit_concept_2,
679
- # guidnace_scale_1,
680
- # warmup_1,
681
- # # neg_guidance,
682
- # sega_edited_image
683
- # ],
684
- # outputs=[sega_edited_image],
685
- # # fn=edit,
686
- # # cache_examples=True
687
- # )
 
 
 
 
688
 
689
 
690
 
 
177
  def get_example():
178
  case = [
179
  [
180
+ 'examples/lemons_input.jpg',
181
+ # '',
182
+ 'a ceramic bowl',
183
+ 'apples', 'lemons',
184
+ 'examples/lemons_output.jpg',
185
+
186
+
187
+ 7,7,
188
+ 1,1,
189
+ False, True,
190
  100,
191
  36,
192
  15,
193
+
 
 
 
194
  ],
195
  [
196
+ 'examples/rockey_shore_input.jpg',
197
+ # '',
198
+ 'watercolor painting',
199
+ 'sea turtle', '',
200
+ 'examples/rockey_shore_output.jpg',
201
+
202
+
203
+ 7,7,
204
+ 1,2,
205
  100,
206
  36,
207
  15,
 
 
 
 
208
  ],
209
+ [
210
+ 'examples/flower_field_input.jpg',
211
+ # '',
212
+ 'oil painting',
213
+ 'colorful flowers', 'red flowers',
214
+ 'examples/flower_field_output.jpg',
215
+
216
+ 20,7,
217
+ 1,1,
218
+ False, True,
219
+ 100,
220
  36,
221
  15,
222
+
223
+
 
 
224
  ],
225
+ [
226
+ 'examples/flower_field_input.jpg',
227
+ # '',
228
+ 'oil painting',
229
+ 'wheat', 'red flowers',
230
+ 'examples/flower_field_output_2.jpg',
231
+
232
+
233
+ 20,7,
234
+ 1,1,
235
+ False,True,
236
+ 100,
237
+ 36,
238
+ 15,
239
+
240
+ ],
241
+ [
242
+ 'examples/butterfly.jpg',
243
+ # '',
244
+ 'oil painting',
245
+ 'bee', 'butterfly',
246
+ 'examples/butterfly_output.jpg',
247
+ 7, 7,
248
+ 1,1,
249
+ False, True,
250
+ 100,
251
  36,
252
+ 15,
253
+ ]
254
+ ]
 
 
 
255
  return case
256
 
257
 
 
695
  outputs = [seed],
696
  queue = False)
697
 
698
+ gr.Examples(
699
+ label='Examples',
700
+ examples=get_example(),
701
+ inputs=[input_image,
702
+ # src_prompt,
703
+ tar_prompt,
704
+ edit_concept_1,
705
+ edit_concept_2,
706
+ sega_edited_image,
707
+ guidnace_scale_1,
708
+ guidnace_scale_2,
709
+ warmup_1,
710
+ warmup_2,
711
+ neg_guidance_1,
712
+ neg_guidance_2,
713
+ steps,
714
+ skip,
715
+ tar_cfg_scale,
716
+
717
+ ],
718
+ outputs=[sega_edited_image],
719
+ )
720
 
721
 
722