Linoy Tsaban commited on
Commit
8134c37
1 Parent(s): 6f62fc3

Update app.py

Browse files

Adding flip and shift operations

Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -79,7 +79,8 @@ def edit(input_image,
79
  flip=False,
80
  h_shift=0,
81
  v_shift=0):
82
- offsets=(0,0,0,0)
 
83
  x0 = load_512(input_image, *offsets, device)
84
 
85
 
@@ -87,7 +88,7 @@ def edit(input_image,
87
  # wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=src_cfg_scale)
88
  wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps)
89
  if flip:
90
- wt, zs, wts = torch.flip(wt, [0, 1]),torch.flip(zs, [0, 1]),torch.flip(wts, [0, 1])
91
 
92
  latnets = wts[skip].expand(1, -1, -1, -1)
93
 
 
79
  flip=False,
80
  h_shift=0,
81
  v_shift=0):
82
+ left=0, right=200, top=0, bottom=0
83
+ # offsets=(0,0,0,0)
84
  x0 = load_512(input_image, *offsets, device)
85
 
86
 
 
88
  # wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps, cfg_scale_src=src_cfg_scale)
89
  wt, zs, wts = invert(x0 =x0 , prompt_src=src_prompt, num_diffusion_steps=steps)
90
  if flip:
91
+ wt, zs, wts = torch.flip(wt, [2, 3]),torch.flip(zs, [2, 3]),torch.flip(wts, [2, 3])
92
 
93
  latnets = wts[skip].expand(1, -1, -1, -1)
94