Linoy Tsaban commited on
Commit
5a65206
1 Parent(s): 48725b2

Update app.py

Browse files

flip + shift ops

Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -77,9 +77,11 @@ def edit(input_image,
77
  warm_up=1,
78
  neg_guidance=False,
79
  flip=False,
80
- h_shift=0,
81
- v_shift=0):
82
- left,right, top, bottom=0,200,0,0
 
 
83
  # offsets=(0,0,0,0)
84
  x0 = load_512(input_image, left,right, top, bottom, device)
85
 
@@ -168,8 +170,10 @@ with gr.Blocks() as demo:
168
  skip = gr.Slider(minimum=0, maximum=40, value=36, precision=0, label="Skip Steps", interactive=True)
169
  tar_cfg_scale = gr.Slider(minimum=7, maximum=18,value=15, label=f"Guidance Scale", interactive=True)
170
  flip = gr.Checkbox(label="Flip")
171
- h_shift = gr.Number(value=0, precision=0, label="Horizontal Shift", interactive=True)
172
- v_shift = gr.Number(value=0, precision=0, label="Vertical Shift", interactive=True)
 
 
173
  # edit
174
  sega_edit_guidance = gr.Slider(value=10, label=f"SEGA Edit Guidance Scale", interactive=True)
175
  # warm_up = gr.Number(value=1, label=f"SEGA Warm-up Steps", interactive=True)
@@ -192,8 +196,10 @@ with gr.Blocks() as demo:
192
  # warm_up,
193
  # neg_guidance,
194
  flip,
195
- h_shift,
196
- v_shift
 
 
197
  ],
198
  outputs=[ddpm_edited_image, sega_edited_image],
199
  )
 
77
  warm_up=1,
78
  neg_guidance=False,
79
  flip=False,
80
+ left = 0,
81
+ right = 0,
82
+ top = 0,
83
+ bottom = 0):
84
+
85
  # offsets=(0,0,0,0)
86
  x0 = load_512(input_image, left,right, top, bottom, device)
87
 
 
170
  skip = gr.Slider(minimum=0, maximum=40, value=36, precision=0, label="Skip Steps", interactive=True)
171
  tar_cfg_scale = gr.Slider(minimum=7, maximum=18,value=15, label=f"Guidance Scale", interactive=True)
172
  flip = gr.Checkbox(label="Flip")
173
+ left = gr.Number(value=0, precision=0, label="Left Shift", interactive=True)
174
+ right = gr.Number(value=0, precision=0, label="Right Shift", interactive=True)
175
+ top = gr.Number(value=0, precision=0, label="Top Shift", interactive=True)
176
+ bottom = gr.Number(value=0, precision=0, label="Bottom Shift", interactive=True)
177
  # edit
178
  sega_edit_guidance = gr.Slider(value=10, label=f"SEGA Edit Guidance Scale", interactive=True)
179
  # warm_up = gr.Number(value=1, label=f"SEGA Warm-up Steps", interactive=True)
 
196
  # warm_up,
197
  # neg_guidance,
198
  flip,
199
+ left,
200
+ right,
201
+ top,
202
+ bottom
203
  ],
204
  outputs=[ddpm_edited_image, sega_edited_image],
205
  )