Linoy Tsaban commited on
Commit
a9bc524
1 Parent(s): 0235960

Update app.py

Browse files

added a help text

Files changed (1) hide show
  1. app.py +51 -19
app.py CHANGED
@@ -204,6 +204,38 @@ For faster inference without waiting in queue, you may duplicate the space and u
204
  <a href="https://huggingface.co/spaces/LinoyTsaban/ddpm_sega?duplicate=true">
205
  <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
206
  <p/>"""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  with gr.Blocks(css='style.css') as demo:
208
 
209
  def add_concept(sega_concepts_counter):
@@ -314,7 +346,7 @@ with gr.Blocks(css='style.css') as demo:
314
 
315
 
316
 
317
- # gr.Markdown(help_text)
318
  plus.click(fn = add_concept, inputs=sega_concepts_counter,
319
  outputs= [row2, row3, plus, sega_concepts_counter], queue = False)
320
 
@@ -389,24 +421,24 @@ with gr.Blocks(css='style.css') as demo:
389
  outputs = [do_inversion], queue = False)
390
 
391
 
392
- gr.Examples(
393
- label='Examples',
394
- examples=get_example(),
395
- inputs=[input_image, src_prompt, tar_prompt, steps,
396
- # src_cfg_scale,
397
- skip,
398
- tar_cfg_scale,
399
- edit_concept_1,
400
- edit_concept_2,
401
- guidnace_scale_1,
402
- warmup_1,
403
- # neg_guidance,
404
- sega_edited_image
405
- ],
406
- outputs=[sega_edited_image],
407
- # fn=edit,
408
- # cache_examples=True
409
- )
410
 
411
 
412
 
 
204
  <a href="https://huggingface.co/spaces/LinoyTsaban/ddpm_sega?duplicate=true">
205
  <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
206
  <p/>"""
207
+
208
+ help_text = """
209
+ - **Getting Started - edit images with DDPM X SEGA:**
210
+
211
+ The are 3 general setting options you can play with -
212
+
213
+ 1. **Pure DDPM Edit -** Describe the desired edited output image in detail
214
+ 2. **Pure SEGA Edit -** Keep the target prompt empty ***or*** with a description of the original image and add editing concepts for Semantic Gudiance editing
215
+ 3. **Combined -** Describe the desired edited output image in detail and add additional SEGA editing concepts on top
216
+ - **Getting Started - Tips**
217
+
218
+ While the best approach depends on your editing objective and source image, we can layout a few guiding tips to use as a starting point -
219
+
220
+ 1. **DDPM** is usually more suited for scene/style changes and major subject changes (for example ) while **SEGA** allows for more fine grained control, changes are more delicate, more suited for adding details (for example facial expressions and attributes, subtle style modifications, object adding/removing)
221
+ 2. The more you describe the scene in the target prompt (both the parts and details you wish to keep the same and those you wish to change), the better the result
222
+ 3. **Combining DDPM Edit with SEGA -**
223
+ Try dividing your editing objective to more significant scene/style/subject changes and detail adding/removing and more moderate changes. Then describe the major changes in a detailed target prompt and add the more fine grained details as SEGA concepts.
224
+ 4. **Reconstruction:** Using an empty source prompt + target prompt will lead to a perfect reconstruction
225
+ - **Fidelity vs creativity**:
226
+
227
+ Bigger values → more fidelity, smaller values → more creativity
228
+
229
+ 1. `Skip Steps`
230
+ 2. `Warmup` (SEGA)
231
+ 3. `Threshold` (SEGA)
232
+
233
+ Bigger values → more creativity, smaller values → more fidelity
234
+
235
+ 1. `Guidance Scale`
236
+ 2. `Concept Guidance Scale` (SEGA)
237
+ """
238
+
239
  with gr.Blocks(css='style.css') as demo:
240
 
241
  def add_concept(sega_concepts_counter):
 
346
 
347
 
348
 
349
+ gr.Markdown(help_text)
350
  plus.click(fn = add_concept, inputs=sega_concepts_counter,
351
  outputs= [row2, row3, plus, sega_concepts_counter], queue = False)
352
 
 
421
  outputs = [do_inversion], queue = False)
422
 
423
 
424
+ # gr.Examples(
425
+ # label='Examples',
426
+ # examples=get_example(),
427
+ # inputs=[input_image, src_prompt, tar_prompt, steps,
428
+ # # src_cfg_scale,
429
+ # skip,
430
+ # tar_cfg_scale,
431
+ # edit_concept_1,
432
+ # edit_concept_2,
433
+ # guidnace_scale_1,
434
+ # warmup_1,
435
+ # # neg_guidance,
436
+ # sega_edited_image
437
+ # ],
438
+ # outputs=[sega_edited_image],
439
+ # # fn=edit,
440
+ # # cache_examples=True
441
+ # )
442
 
443
 
444